View Full Version : glGetFloatv(GL_CURRENT_COLOR, color) doesn't work
wwuster
12-29-2009, 10:06 AM
I'm testING getting GL_CURRENT_COLOR. If I set it to 1,0,0,1 and then immediately get it, it returns 1,1,1,1 instead of 1,0,0,1. Why doesn't the call return 1,0,0,1?
float color[4];
glColor4f(1,0,0,1);
glGetFloatv(GL_CURRENT_COLOR, color);
thanks,
William
mark ds
12-29-2009, 10:49 AM
try...
float color[4];
glColor4f(1,0,0,1);
glGetFloatv(GL_CURRENT_COLOR, color);
GLenum err = glGetError();
What does err return?
Also, do you have a valid rendering context before you make this call?
wwuster
12-29-2009, 11:03 AM
the error returned is 0
William
BionicBytes
12-30-2009, 07:27 AM
float color[4];
glColor4f(1,0,0,1);
glGetFloatv(GL_CURRENT_COLOR, color);
but you havw not actually sent anything to GL for rendering yet since glColor4f is a pervertex attribute. Try sending some geometry with glVertex3f then you'll see the expected results
V-man
12-31-2009, 08:13 AM
???
Is this important?
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.