Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I need to rebind element array buffer?

Name: Anonymous 2012-01-07 23:54

Ok, I'm at my wits end with OpenGL's VAOs.
What's happening is that I'm initializing 2 of these (A cube and an object made of spheres for now) in separate classes, and then intermittently calling them both. After a lot of work, I've discovered that it's because my GL_ELEMENT_ARRAY_BUFFER does not bind to my VAO.
So on each of my render functions, I have:
glBindVertexArray(VAO);
//glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
and then I call glDrawElements.
If I do not uncomment that line, only the object that was initialized last (and therefore had its element array bound last) renders correctly. I am of the understanding, though, that this shouldn't be necessary. What am I doing wrong?
Here's a pastebin with the relevant code. Hopefully that helps.
http://pastebin.com/TtQaLiqY

Please tell me that at least one of you guys knows enough OpenGL to know what I'm talking about.

Even the relevant example from the OpenGL programming guide doesn't display correctly.
I don't understand what I'm doing wrong.

Name: Anonymous 2012-01-08 0:09

Stop using braindamaging C and C derivatives.

Name: OP 2012-01-08 0:15

Sorry, bro.
I can't program OpenGL applications in lisp.

Name: Anonymous 2012-01-08 1:01

why not?

Name: Anonymous 2012-01-08 3:06

Name: Anonymous 2012-01-08 8:00

>>3
I found using OenGL much nicer in CL than in C.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List