Sign in to follow this  

Matrix inside glBegin()?

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

This topic is 4343 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this