your suggestions solved the problem. Thanks!
Mario Zechner wrote:
Oh and one more thing
final int siz = testBuffer.capacity() * Integer.SIZE;
should really be
final int siz = testBuffer.capacity() * Integer.SIZE / 8;
as Integer.SIZE gives you the number of bits an integer occupies.
On 17 Mrz., 01:23, ac <[email protected]> wrote:
Hello,
I have experienced some trouble using VBOs, since the method
glBufferData crashes when I try to copy data to the vertex buffer.
Below is the smallest snippet of code that I found to generate the
crash:
int numVert = 32;
GL11 gl11 = (GL11)gl;
testArray = new int[numVert * 3];
testBuffer = IntBuffer.wrap(testArray);
gl11.glGenBuffers(1, testID, 0);
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, testID[0]);
final int siz = testBuffer.capacity() * Integer.SIZE;
gl11.glBufferData(GL11.GL_ARRAY_BUFFER, siz, testBuffer,
GL11.GL_STATIC_DRAW);
gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
testArray, testBuffer and testID are members of the class containing
this code, declared as follows:
int[] testArray;
IntBuffer testBuffer;
int[] testID = {0};
I tried this code in several OpenGL applications which don't show any
problem otherwise.
The crash occurs specifically at the glBufferData() method call. If
numVert is set to zero, then the crash doesn't occur.
Any comments will be greatly appreciated.
Thanks,
ac
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en