PDA

View Full Version : glGetFloatv??



05-28-2001, 10:49 AM
I'm trying to use glGetFloatv to get the modelview matrix. For some WIERD reason, it doesn't work. Is there some way to get around this? Can I somehow get at the gobal that stores the modelview matrix?

hoshi55
05-28-2001, 02:58 PM
iīve had the same problem, it seems as if it matters WHERE you put the glGetFloat in your code (perhaps in a separate function).. unfortunately, i donīt know where to put the command to make it work safely, i just tried a few locations until i found a working configuration and did not change anything about it (never touch a running system http://www.opengl.org/discussion_boards/ubb/wink.gif
maybe i (and you) am producing a GLerror in your code that causes this strange behaviour - i know that i do so, but havenīt located it yet, neither am i sure that it is the reason for this bug

Deiussum
05-29-2001, 06:12 AM
Can you be more specific on WHAT doesn't work about it? Do you get back nothing? Do you get exception errors?

hoshi55,
I don't know of any restrictions on where you place the call except for the following.
1) It has to be done AFTER the window has been created and the pixelformat setup to use OpenGL.
2) It can't be used between glBegin/glEnd.

hoshi55
05-30-2001, 12:46 AM
usually if getFloatfv does not work, you get an array of very small negative numbers.

yes, i know there are NO rstrictions about where to put that command, but if you produce a GLerror in your code somewhere, this sometimes causes unpredictable results. i cleaned up my own code now, removing GLerrors and the glGetFloat call seems to work now no matter where i put it. This might be different across various openGL-implementaions (again) but itīs the case with 3dfx drivers.