Jump to content
  • Advertisement
Sign in to follow this  
i eat babies

glEnableClientState() Required on each render?

This topic is 3790 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

From the nehe tutorials i've noticed that on the vertex buffer object tutorial (which can be found at http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45) the code calls glEnableClientState(GL_VERTEX_ARRAY) before each render and glDisableClientState(GL_VERTEX_ARRAY) after each render. Is this really necessary? My program works if you just call glEnableClientState() at initialisation and glDisableClientState() at exit. I'm tempted to just carry on this way but from experience i know thateven if it works there may be some hidden or unobvious disadvantage to doing this.

Share this post


Link to post
Share on other sites
Advertisement
You don't have to enable disable all the time. It will stay enabled forever until you disable it. But when you let vertex arrays enabled and a later draw call does not need all of the vertex arrays they will still be referenced since you didn't disable them. This means it can result in a crash or other not wanted behaviour.

The NeHe tutorials are not very good as a learing resource and teach bad habits. A book like the OpenGL Redbook is way better for learning.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!