First, my system:
Dual 700 PIII
1024 MBs of ram
nVidia GeForce 2 GTS(Elsa Gladiac)
Detonator 29.42 drivers
(23.11 Stereo driver w/ Elsa Revelator glasses)
OK, strange bug…
I am rendering my scenegraph in a series of glDrawElements calls, and then rendering some text using:
glBegin(GL_QUADS);
glTexCoord2f(…);
glVertex3f(…);
glTexCoord2f(…);
glVertex3f(…);
glTexCoord2f(…);
glVertex3f(…);
glEnd();
So far so good, right?
Except, my app locks up when stereo mode is turned on.(Num-lock don’t work, mouse is dead, music stops playing, etc…)
So, I started turn off components and trying to figure out what is causing it to freeze. Well, eventually, it turns out that when I comment out the text rendering, it works fine in stereo. OK, so I decide to use glGetError and log all the errors. I make the following macro:
#define RunGL(x) {
x;
GLenum gle;
gle=glGetError();
if(gle!=GL_NO_ERROR)
Log.Post("OpenGL error "%s" on line %i
",gluErrorString(gle),LINE);
}
And replace all GL commands with:
RunGL(glCommand2f(stuff))
Then, I run my app normally(stereo mode off), and check my log.
To my horror, I find that the glEnd() command in the text rendering code is giving an “Invalid Operation” error every time it is called. So I figure I’m calling the glBegin, glEnd combo above in between some other glBegin/glEnd block. So, I replace the above code with this:
glEnd(); //added this
glBegin(GL_QUADS);
glTexCoord2f(…);
glVertex3f(…);
glTexCoord2f(…);
glVertex3f(…);
glTexCoord2f(…);
glVertex3f(…);
glEnd();
This should handle times where I’m accidentally calling this during a rendering operation. I run it, but instead of getting the expected invalid operation JUST on the first glEnd() and not on the last one, I get it on both of them!
I’ve been trying to track this down for a while, so any help is much appreciated.
Thanks,
-Shard
[This message has been edited by Shard (edited 07-09-2002).]