glGetFloatv(GL_CURRENT_COLOR, color) doesn't work

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

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?

the error returned is 0

William

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

???
Is this important?