I am trying to display a byte array in an OpenGL GLSurfaceView.
So I have a GLRendererclass implementing Renderer and a method onSurfaceCreated
byte[] data = new byte[512*512];
for (int i = 0; i < 512*512; i++) {
data[i] = 100;
}
ByteBuffer buffer = ByteBuffer.allocateDirect(512*512);
buffer.put(data);
buffer.position(0);
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, 512, 512, 0,
GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, buffer);
But nothing is displayed on the screen. FYI, there is no special code in onSurfaceChanged and onDrawFrame method.
onDrawFrame? How do you bind the texture?