Java Code Examples for android.opengl.GLES20#GL_RGB

The following examples show how to use android.opengl.GLES20#GL_RGB . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GlTextureFrameBuffer.java    From sealrtc-android with MIT License 6 votes vote down vote up
/**
 * 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];
}
 
Example 2
Source File: GlTextureFrameBuffer.java    From VideoCRE with MIT License 6 votes vote down vote up
/**
 * 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];
}
 
Example 3
Source File: GlTextureFrameBuffer.java    From webrtc_android with MIT License 5 votes vote down vote up
/**
 * 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);
  }
  this.width = 0;
  this.height = 0;
}