Will this cause an GL_INVALID_OPERATION??
Hi Gang,
I am trying to debug some code that seems like it''s giving me some problems. I am getting an GL_INVALID_OPERATION error when I stress out the system, and I can see it is happening around this block of code:
glBegin(GL_LINE_STRIP);
for (azListIter = arcVector_[index].listA_begin();, azListIter != arcVector_[index].listA_.end(); ++azListIter)
{
// create the XYZ point from the Az, El,
// and range from the azListIter
GlobeXYZ pt;
createArcPoint(azListIter->az_,
azListIter->el_,
arcVector_[index].range_,
pt);
double vec[3];
pt.xyzVector(vec);
glVertex3dv(vec);
}
glEnd();
Now, I have heard that nothing should go between a glBegin and a glEnd except for glVertex, glColor, glIndex, glNormal, glTexCoord, etc commands. Is this really true? Can I call regular C++ functions in between a glBegin and glEnd?
Thanks for your help. I am a novice at this stuff.
Roach
I THINK you can call regular Cpp functions but not other gl functions...
PM Times change...
Excuse my poor english!
Yes you can call C++ instructions.
The only forbidden commands are some GL commands.
Between glBegin and the corresponding glEnd, you can call glVertex, glColor etc, but you can also call a few other functions like glMaterial. To geta detailed list, go to www.opengl.org and download OpenGL 1.4 specifications and go to chapter 2.6.3 "GL Commands within Begin/End", page 19.
If you get an INVALID_OPERATION, that is not necessarily because of the last called GL command. Once an error occured, the GL remembers the error until the error flag is cleared when you call glGetError. That is, maybe the error returned by glGetError has been generated an hour ago !
The only forbidden commands are some GL commands.
Between glBegin and the corresponding glEnd, you can call glVertex, glColor etc, but you can also call a few other functions like glMaterial. To geta detailed list, go to www.opengl.org and download OpenGL 1.4 specifications and go to chapter 2.6.3 "GL Commands within Begin/End", page 19.
If you get an INVALID_OPERATION, that is not necessarily because of the last called GL command. Once an error occured, the GL remembers the error until the error flag is cleared when you call glGetError. That is, maybe the error returned by glGetError has been generated an hour ago !
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement