當前位置: 首頁>>代碼示例>>Java>>正文


Java GLES20.glGenFramebuffers方法代碼示例

本文整理匯總了Java中android.opengl.GLES20.glGenFramebuffers方法的典型用法代碼示例。如果您正苦於以下問題:Java GLES20.glGenFramebuffers方法的具體用法?Java GLES20.glGenFramebuffers怎麽用?Java GLES20.glGenFramebuffers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.opengl.GLES20的用法示例。


在下文中一共展示了GLES20.glGenFramebuffers方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createFrameBuffer

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * 創建FrameBuffer
 * @param hasRenderBuffer 是否啟用RenderBuffer
 * @param width 寬度
 * @param height 高度
 * @param texType 類型,一般為{@link GLES20#GL_TEXTURE_2D}
 * @param texFormat 紋理格式,一般為{@link GLES20#GL_RGBA}、{@link GLES20#GL_RGB}等
 * @param minParams 紋理的縮小過濾參數
 * @param maxParams 紋理的放大過濾參數
 * @param wrapS 紋理的S環繞參數
 * @param wrapT 紋理的W環繞參數
 * @return 創建結果,0表示成功,其他值為GL錯誤
 */
public int createFrameBuffer(boolean hasRenderBuffer,int width,int height,int texType,int texFormat,
                             int minParams,int maxParams,int wrapS,int wrapT){
    mFrameTemp=new int[4];
    GLES20.glGenFramebuffers(1,mFrameTemp,0);
    GLES20.glGenTextures(1,mFrameTemp,1);
    GLES20.glBindTexture(texType,mFrameTemp[1]);
    GLES20.glTexImage2D(texType, 0,texFormat, width, height,
            0, texFormat, GLES20.GL_UNSIGNED_BYTE, null);
    //設置縮小過濾為使用紋理中坐標最接近的一個像素的顏色作為需要繪製的像素顏色
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_MIN_FILTER,minParams);
    //設置放大過濾為使用紋理中坐標最接近的若幹個顏色,通過加權平均算法得到需要繪製的像素顏色
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_MAG_FILTER,maxParams);
    //設置環繞方向S,截取紋理坐標到[1/2n,1-1/2n]。將導致永遠不會與border融合
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_WRAP_S,wrapS);
    //設置環繞方向T,截取紋理坐標到[1/2n,1-1/2n]。將導致永遠不會與border融合
    GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_WRAP_T,wrapT);

    GLES20.glGetIntegerv(GLES20.GL_FRAMEBUFFER_BINDING,mFrameTemp,3);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER,mFrameTemp[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
            texType, mFrameTemp[1], 0);
    if(hasRenderBuffer){
        GLES20.glGenRenderbuffers(1,mFrameTemp,2);
        GLES20.glBindRenderbuffer(GLES20.GL_RENDERBUFFER,mFrameTemp[2]);
        GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFER,GLES20.GL_DEPTH_COMPONENT16,width,height);
        GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER,GLES20.GL_DEPTH_ATTACHMENT,GLES20.GL_RENDERBUFFER,mFrameTemp[2]);
    }
    return GLES20.glGetError();
}
 
開發者ID:aiyaapp,項目名稱:AAVT,代碼行數:43,代碼來源:FrameBuffer.java

示例2: initFrameBuffer

import android.opengl.GLES20; //導入方法依賴的package包/類
public void initFrameBuffer(int width, int height) {
    mWidth = width;
    mHeight = height;

    deleteFrameBuffer();

    int[] frameBuffers = new int[1];
    GLES20.glGenFramebuffers(1, frameBuffers, 0);
    mFrameBuffer = frameBuffers[0];

    int[] frameBufferTextures = new int[1];
    GLES20.glGenTextures(1, frameBufferTextures, 0);
    mFrameBufferTexture = frameBufferTextures[0];
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFrameBufferTexture);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffer);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mFrameBufferTexture, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
}
 
開發者ID:vipycm,項目名稱:mao-android,代碼行數:26,代碼來源:CameraFilter.java

示例3: GlTextureFrameBuffer

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * Generate texture and framebuffer resources. An EGLContext must be bound on the current thread
 * when calling this function. The framebuffer is not complete until setSize() is called.
 */
public GlTextureFrameBuffer(int pixelFormat) {
  switch (pixelFormat) {
    case GLES20.GL_LUMINANCE:
    case GLES20.GL_RGB:
    case GLES20.GL_RGBA:
      this.pixelFormat = pixelFormat;
      break;
    default:
      throw new IllegalArgumentException("Invalid pixel format: " + pixelFormat);
  }

  // Create texture.
  textureId = GlUtil.generateTexture(GLES20.GL_TEXTURE_2D);
  this.width = 0;
  this.height = 0;

  // Create framebuffer object.
  final int frameBuffers[] = new int[1];
  GLES20.glGenFramebuffers(1, frameBuffers, 0);
  frameBufferId = frameBuffers[0];
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:26,代碼來源:GlTextureFrameBuffer.java

示例4: onOutputSizeChanged

import android.opengl.GLES20; //導入方法依賴的package包/類
public void onOutputSizeChanged(int paramInt1, int paramInt2)
{
    super.onOutputSizeChanged(paramInt1, paramInt2);
    if (this.bD != null) {
        I();
    }
    int i = H().size();
    for (int j = 0; j < i; j++) {
        ((GPUImageFilter)H().get(j)).onOutputSizeChanged(paramInt1, paramInt2);
    }
    if (null != this.bI) {
        this.bI.onOutputSizeChanged(paramInt1, paramInt2);
    }
    if ((H() != null) && (H().size() > 0))
    {
        this.bD = new int[2];
        this.bE = new int[2];
        for (int j = 0; j < this.bD.length; j++)
        {
            GLES20.glGenFramebuffers(1, this.bD, j);
            GLES20.glGenTextures(1, this.bE, j);
            OpenGlUtils.bindTextureToFrameBuffer(this.bD[j], this.bE[j], paramInt1, paramInt2);
        }
    }
}
 
開發者ID:zhangyaqiang,項目名稱:Fatigue-Detection,代碼行數:26,代碼來源:GPUImageFilterGroupBase.java

示例5: initFBO

import android.opengl.GLES20; //導入方法依賴的package包/類
private void initFBO(int width, int height)
{
    Log.d(LOGTAG, "initFBO("+width+"x"+height+")");

    deleteFBO();

    GLES20.glGenTextures(1, texDraw, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texDraw[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    GLES20.glGenTextures(1, texFBO, 0);
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texFBO[0]);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);

    //int hFBO;
    GLES20.glGenFramebuffers(1, FBO, 0);
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, FBO[0]);
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, texFBO[0], 0);
    Log.d(LOGTAG, "initFBO error status: " + GLES20.glGetError());

    int FBOstatus = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (FBOstatus != GLES20.GL_FRAMEBUFFER_COMPLETE)
        Log.e(LOGTAG, "initFBO failed, status: " + FBOstatus);

    mFBOWidth  = width;
    mFBOHeight = height;
}
 
開發者ID:vulovicv23,項目名稱:opencv-documentscanner-android,代碼行數:36,代碼來源:CameraGLRendererBase.java

示例6: createFbo

import android.opengl.GLES20; //導入方法依賴的package包/類
private int createFbo(int width, int height) {
    int[] texture = new int[1];
    int[] fbo = new int[1];
    GLES20.glGenFramebuffers(1, fbo, 0);
    GLES20.glGenTextures(1, texture, 0);
    mFbo = fbo[0];
    mDstTexture = texture[0];

    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mDstTexture);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);

    // Bind the framebuffer
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFbo);
    // Specify texture as color attachment
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mDstTexture, 0);

    // Check for framebuffer complete
    int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) {
        Log.e(LOG_TAG, "Failed to create framebuffer!!!");
    }

    return 0;
}
 
開發者ID:AgoraIO,項目名稱:Agora-Video-Source-Android,代碼行數:29,代碼來源:CustomizedCameraRenderer.java

示例7: onOutputSizeChanged

import android.opengl.GLES20; //導入方法依賴的package包/類
@Override
  public void onOutputSizeChanged(final int width, final int height) {
      super.onOutputSizeChanged(width, height);
      int size = mFilters.size();
      for (int i = 0; i < size; i++) {
          mFilters.get(i).onOutputSizeChanged(width, height);
      }
      if(mFrameBuffers != null && (mFrameWidth != width || mFrameHeight != height || mFrameBuffers.length != size-1)){
	destroyFramebuffers();
	mFrameWidth = width;
	mFrameHeight = height;
}
      if (mFrameBuffers == null) {
      	mFrameBuffers = new int[size-1];
          mFrameBufferTextures = new int[size-1];

          for (int i = 0; i < size-1; i++) {
              GLES20.glGenFramebuffers(1, mFrameBuffers, i);
              
              GLES20.glGenTextures(1, mFrameBufferTextures, i);
              GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFrameBufferTextures[i]);
              GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0,
                      GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
              GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                      GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
              GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                      GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
              GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                      GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
              GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,
                      GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

              GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBuffers[i]);
              GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
                      GLES20.GL_TEXTURE_2D, mFrameBufferTextures[i], 0);

              GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
              GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
          }
      }
  }
 
開發者ID:smartbeng,項目名稱:PaoMovie,代碼行數:42,代碼來源:MagicBaseGroupFilter.java

示例8: loadTexture

import android.opengl.GLES20; //導入方法依賴的package包/類
private void loadTexture(Bitmap bitmap) {
    renderBufferWidth = bitmap.getWidth();
    renderBufferHeight = bitmap.getHeight();
    float maxSize = AndroidUtilities.getPhotoSize();
    if (renderBufferWidth > maxSize || renderBufferHeight > maxSize || orientation % 360 != 0) {
        float scale = 1;
        if (renderBufferWidth > maxSize || renderBufferHeight > maxSize) {
            float scaleX = maxSize / bitmap.getWidth();
            float scaleY = maxSize / bitmap.getHeight();
            if (scaleX < scaleY) {
                renderBufferWidth = (int) maxSize;
                renderBufferHeight = (int) (bitmap.getHeight() * scaleX);
                scale = scaleX;
            } else {
                renderBufferHeight = (int) maxSize;
                renderBufferWidth = (int) (bitmap.getWidth() * scaleY);
                scale = scaleY;
            }
        }

        if (orientation % 360 == 90 || orientation % 360 == 270) {
            int temp = renderBufferWidth;
            renderBufferWidth = renderBufferHeight;
            renderBufferHeight = temp;
        }

        currentBitmap = createBitmap(bitmap, renderBufferWidth, renderBufferHeight, scale);
    }
    GLES20.glGenFramebuffers(3, renderFrameBuffer, 0);
    GLES20.glGenTextures(3, renderTexture, 0);

    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[0]);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, renderBufferWidth, renderBufferHeight, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);

    GLES20.glBindTexture(GL10.GL_TEXTURE_2D, renderTexture[1]);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, currentBitmap, 0);

    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, renderTexture[2]);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, renderBufferWidth, renderBufferHeight, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:53,代碼來源:PhotoFilterView.java

示例9: prepareFramebuffer

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * Prepares the off-screen framebuffer.
 */
private void prepareFramebuffer(int width, int height) {
    GlUtil.checkGlError("prepareFramebuffer start");

    int[] values = new int[1];

    // Create a texture object and bind it.  This will be the color buffer.
    GLES20.glGenTextures(1, values, 0);
    GlUtil.checkGlError("glGenTextures");
    mOffscreenTexture = values[0];   // expected > 0
    GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mOffscreenTexture);
    GlUtil.checkGlError("glBindTexture " + mOffscreenTexture);

    // Create texture storage.
    GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0,
            GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);

    // Set parameters.  We're probably using non-power-of-two dimensions, so
    // some values may not be available for use.
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
            GLES20.GL_NEAREST);
    GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,
            GLES20.GL_LINEAR);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,
            GLES20.GL_CLAMP_TO_EDGE);
    GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,
            GLES20.GL_CLAMP_TO_EDGE);
    GlUtil.checkGlError("glTexParameter");

    // Create framebuffer object and bind it.
    GLES20.glGenFramebuffers(1, values, 0);
    GlUtil.checkGlError("glGenFramebuffers");
    mFramebuffer = values[0];    // expected > 0
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFramebuffer);
    GlUtil.checkGlError("glBindFramebuffer " + mFramebuffer);

    // Create a depth buffer and bind it.
    GLES20.glGenRenderbuffers(1, values, 0);
    GlUtil.checkGlError("glGenRenderbuffers");
    mDepthBuffer = values[0];    // expected > 0
    GLES20.glBindRenderbuffer(GLES20.GL_RENDERBUFFER, mDepthBuffer);
    GlUtil.checkGlError("glBindRenderbuffer " + mDepthBuffer);

    // Allocate storage for the depth buffer.
    GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFER, GLES20.GL_DEPTH_COMPONENT16,
            width, height);
    GlUtil.checkGlError("glRenderbufferStorage");

    // Attach the depth buffer and the texture (color buffer) to the framebuffer object.
    GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER, GLES20.GL_DEPTH_ATTACHMENT,
            GLES20.GL_RENDERBUFFER, mDepthBuffer);
    GlUtil.checkGlError("glFramebufferRenderbuffer");
    GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
            GLES20.GL_TEXTURE_2D, mOffscreenTexture, 0);
    GlUtil.checkGlError("glFramebufferTexture2D");

    // See if GLES is happy with all this.
    int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
    if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) {
        throw new RuntimeException("Framebuffer not complete, status=" + status);
    }

    // Switch back to the default framebuffer.
    GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);

    GlUtil.checkGlError("prepareFramebuffer done");
}
 
開發者ID:AndyZhu1991,項目名稱:grafika,代碼行數:70,代碼來源:RecordFBOActivity.java


注:本文中的android.opengl.GLES20.glGenFramebuffers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。