I'm trying to port my Java OpenGL code on Android to the Native SDK and I need an IntBuffer implementation.
Basically what I do in Java to load up an arbitrary integer RGBA pixel color array into a texture is:
// pixel array
pixelIntArray = new int[width * height];
bb = ByteBuffer.allocateDirect(pixelIntArray.length * 4);
bb.order(ByteOrder.nativeOrder());
// native buffer
pixelBuffer = bb.asIntBuffer();
// push integer array of pixels into buffer
pixelBuffer.put(pixelIntArray);
pixelBuffer.position(0);
// bind buffer to texture
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, width, height, 0,
GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixelBuffer);
in C so that I can push a texture to a quad using a buffer.
Currently I'm just binding it to my pixelIntArray in C and the texture comes out distorted.
Basically I need to be able to bind a series of colors in an integer pixel array to a texture through a buffer similar to Java's NIO class.