Skip to main content
GameDev.net gamedev.net
🔒 Locked

Matrix inside glBegin()?

Started by BloodLust666 Jan 26, 2006 at 11:11 PM 0 replies 700+ views
Original Post
BloodLust666
BloodLust666
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?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Fahrenheit451
Fahrenheit451
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.