Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

Matrix inside glBegin()?

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

I have a list of object that needs to be draw and a function to do so in: glBegin(GL_LINES); for (start of list ; end of list ; i++) { List.GetObject(i)->Draw(); } glEnd(); but within the Draw() sometimes i need to change the Matrix such as rotation and/or translating... but nothing's changing.. can i NOT change the matrix while Begin is called? should i just get rid of that and have the begin and end called in the Draw() function and have the matrix manipulation before calling begin?

Share this post


Link to post
Share on other sites
Advertisement
Correct. From the OpenGL Ref manual for glBegin...

Quote:

Only a subset of GL commands can be used between glBegin and glEnd. The commands are glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, and glEdgeFlag. Also, it is acceptable to use glCallList or glCallLists to execute display lists that include only the preceding commands. If any other GL command is called between glBegin and glEnd, the error flag is set and the command is ignored.


hth
F451

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!