Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


vertex_array disabled after glBegin when generating displaylist

This topic is 5896 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I have a lot of 2D static triangles to draw in VB (VB sucks, I know, but I didn''t choose it). Now I''m using a displaylist to draw them, but I''m triying to optimize rendering speed by using vertex array. After enabling vertex (2D) an color (RGBA) arrays, I start the displaylist generation. I have noticed that calling glBegin GL_TRIANGLE disables automatically both arrays. Is that usual? What can be wrong? Is it possible to use Vertex Array inside a DisplayList? Thanks! Breaking up is hard to do

Share this post

Link to post
Share on other sites
you don''t use glBegin/glEnd to draw from a VA. you use glDrawElements to draw them all in 1 line of code.
by enabling the arrays, I assume you mean glEnableClientState(GL_VERTEX_ARRAY) (or whatever it is) - which is what its'' meant to be.

Share this post

Link to post
Share on other sites
Mmmm... I have been using as guide this example from the Red Book, v1.2.

Example 2-10 Using glArrayElement() to Define Colors and Vertices

GLint vertices [] = {25, 25, 100, 325, 175, 25, 175, 325, 250, 25, 325, 325};
GLfloat colors [] = {1.0, 0.2, 0.2, 0.2, 0.2, 1.0, 0.8, 1.0, 0.2, 0.75, 0.75, 0.75, 0.35, 0.35, 0.35, 0.5, 0.5, 0.5};

glColorPointer(3, GL_FLOAT, 0, colors);
glVertexPointer(2, GL_INT, 0, vertices);


So it seems that it is possible to use glArrayElement with gl*Pointer and glEnableClientState (what other use can be given to it?)

Major changes to my data structure has to be made in order to use glDrawElements...

What can be happening?

I''m not ugly, just bad rendered

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!