[GameArch HW6] GL_QUADS causing draw error.

[GameArch HW6] GL_QUADS causing draw error.

Postby rengaj » Sun Mar 25, 2012 3:16 am

So, I am using the Quads version of the bendy-bar geometry egg, and I am running into a very odd error. When I attempt to render the bar using the GL_QUADS tag, I get a draw error, and the program does not draw anything (except for an annoying message to my terminal). However, when I change GL_QUADS to something like GL_LINES or even GL_TRIANGLES, it happens to render just fine. I don't really know what to think about this, and any help would be appreciated. The line of code that I am using looks like this:

Code: Select all
   glDrawElements(GL_QUADS, mesh.poly_index_count(), GL_UNSIGNED_INT, (GLvoid*)0);
   GL_CHECK("DRAW: Could not draw the mesh.");

Please note that mesh.poly_index_count() is the number of indices in my polygon vector inside of my mesh object (which is of type Mesh). Also, GL_CHECK() is a macro that checks for OpenGL errors, and spits the message provided onto the terminal window.

I was hoping to be farther along in the HW at this point, but due to somebody at RedHat failing to label the Software Update button correctly as Break Operating System, I've been fixing my OS for the past 3 days. So, any help that could be provided would be fantastic!
Posts: 2
Joined: Sun Feb 12, 2012 4:11 pm

Re: [GameArch HW6] GL_QUADS causing draw error.

Postby BenChang » Mon Mar 26, 2012 2:42 am

I'm sure you'll get a better answer from someone who's in the class and knows the context ...

but here 's a naive question - if you're passing the same data array to glDrawElements each way - doesn't it need to be structured differently for different primitve types?
User avatar
Posts: 176
Joined: Mon Jan 17, 2011 4:48 pm

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest