Sporadic behavoir with glGetString()


Having a few problems with glGetString(), was wondering if anyone else has had this, as I don’t know how to fix it…

Basically I can call glGetString() and it either works, or it doesn’t (lol), but its unknown why it doesn’t work returning 1282 ( GL_INVALID_OPERATION ) mid operation ( and not between glBegin() - glEnd() ), GL is ready and being drawn too. Its to check for multi-texturing, I could brute force check every cycle until its found that its supported, but this is messy when running on a system with gl version <1.3 ( not to mention performance hinderence ), and it also means multi-texturing could be disabled and then suddenly start working mid-flow…

PC isCore2 Quad Q6700 @ 2.66 with GeForce 7300 SE/7200 GS/PCI/SSE2.

Any help would be appreciated,
Many thanks…

First thing, check to see whether you still get errors without the glGetString call. If you do, correct these first. Second, openGL simply ignores a command that causes an error so it’s no wonder you still have a working program. Third, do not modify any string obtained via glGetString(Unless you copy it first and edit the copy, of course!)

And at last, make sure that you have active context before any GL call including glGetString.

that is, wglGetCurrentContext() != NULL. who knows where it can get lost even if you do rendering already.