glUseProgramObjectARB strangeness

I’m just starting out using GLSL, and I’ve hit a seemingly strange error. The OpenGL spec says that if a program object is not complete (i.e. not compiled/linked), the glUseProgramObject (no ARB) function should set the current GL error to GL_INVALID_OPERAION.

However, I’m getting GL_INVALID_VALUE for the error when using glUseProgramObjectARB. If the error codes are supposed to be the same between the ARB and core versions of this function, then why am I getting an invalid value. Or, if they are different, how can I tell what is wrong with my program?

My program is about as simple as you can get - transform the position and set the color. It compiles/links just fine with no errors/warnings. How can I tell what I’m doing wrong?

vertex program:
void main( void )
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

fragment program:
void main( void )
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
}

Well, I’m officially an idiot. I was initializing the shaders without a valid rendering context bound. Works fine now.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.