Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 10th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Updating texture using glTexImage2D(..) in OpenglES2 [Android]
  2. GLES20.glGenTextures ( 1, textureId, 0 );
  3. GLES20.glBindTexture ( GLES20.GL_TEXTURE_2D, textureId[0] );
  4. GLES20.glTexImage2D ( GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, bitmap.getWidth(), bitmap.getHeight(), 0,GLES20.GL_RGB, GLES20.GL_UNSIGNED_BYTE, byteBuffer );|
  5. GLES20.glBindTexture ( GLES20.GL_TEXTURE_2D, 0 );
  6.        
  7. GLES20.glBindTexture ( GLES20.GL_TEXTURE_2D, textureId[0] );
  8. GLES20.glTexImage2D ( GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, bitmap.getWidth(), bitmap.getHeight(), 0,GLES20.GL_RGB, GLES20.GL_UNSIGNED_BYTE, byteBuffer );|
  9. GLES20.glBindTexture ( GLES20.GL_TEXTURE_2D, 0 );