Trying to set VBO:s in C# using TAO / OpenGL TK framework

Started by
13 comments, last by JulianAssange 13 years, 5 months ago
You are passing GL_UNSIGNED_BYTE to your glDrawElements call but your index buffer is byte. Maybe that's causing the problem?

EDIT: I missed the part where you used DrawArrays. So unsigned/signed cannot be your problem completely.
Advertisement
Quote:Original post by Gorg
You are passing GL_UNSIGNED_BYTE to your glDrawElements call but your index buffer is byte. Maybe that's causing the problem?

EDIT: I missed the part where you used DrawArrays. So unsigned/signed cannot be your problem completely.


Thanks for posting, will try to change to GL_BYTE later today.

Any other ideas?

Nope, the change to GL_BYTE didn't solve it....

There must be something strange in all this...
I haven't used glVertexPointer in a long time, but that looks odd

gl.glVertexPointer(3, GL.GL_FLOAT, 0, mVertexBuffer);

Shouldn't that be gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0)

As far as I remember since you bind buffers the last parameter should be the start index inside the bound buffer. Since your are passing mVertexBuffer, the offset will be off by whatever number your buffer is.

The same thing applies to your glTexCoordPointer call and glDrawElements.
Quote:Original post by Gorg
I haven't used glVertexPointer in a long time, but that looks odd

gl.glVertexPointer(3, GL.GL_FLOAT, 0, mVertexBuffer);

Shouldn't that be gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0)

As far as I remember since you bind buffers the last parameter should be the start index inside the bound buffer. Since your are passing mVertexBuffer, the offset will be off by whatever number your buffer is.

The same thing applies to your glTexCoordPointer call and glDrawElements.


Thanks, will test this soon...

This topic is closed to new replies.

Advertisement