PDA

View Full Version : Sporadic behavoir with glGetString()



spiroyster
01-13-2009, 04:50 AM
Greetings,

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...

Y-tension
01-13-2009, 06:57 AM
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!)

yooyo
01-13-2009, 06:21 PM
And at last, make sure that you have active context before any GL call including glGetString.

_NK47
01-14-2009, 02:53 AM
that is, wglGetCurrentContext() != NULL. who knows where it can get lost even if you do rendering already.