How do you know which OpenGL functions need to be called every frame, and which can only be called once? -
The best example of this as a question is that I now have the function glSelectBuffer. I would like to know whether I have it in my init function I can call only once or if I have to call every time before Glorendermod (GL_SEST). But in general, many times when I thought whether I can call a function at the beginning of my program or call me every frame.
I know that OpenGL is a state engine, but I feel that some things are kept in the state and others are not. And yes, I know, when I modify something later in my program, due to OpenGL being a State Engine I have to reset it back to the first value at the beginning of my loop; This is not the answer I'm looking for.
If nothing else, if you find me very confused and you have not had any such problem, please answer my sub-question whether glSelectBuffer can be called once or every Bar calls are required.
Only direct rendering calls should be called each. Modified calls to the state (GlClear, glBegin - glVertex - glend, etc.) should sometimes be called every frame because you want to set them in different states at different points of the frame rendering process.
This is also the case of GlRenderMode - you want to toggle between GL_SELECT and other modes continuously.
Edit: Sorry, this also appears to be a case for glSelectBuffer - the manual page automatically resets the buffer pointer as out of GL_SELECT mode.
Comments
Post a Comment