PDA

View Full Version : glUseProgramObjectARB strangeness



Hobbiticus
02-04-2005, 01:22 PM
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);
}

Hobbiticus
02-06-2005, 11:14 AM
Well, I'm officially an idiot. I was initializing the shaders without a valid rendering context bound. Works fine now.