Jump to content
  • Advertisement
Sign in to follow this  
MattHughes

OpenGL glUseProgram - how to "un-use"? [resolved]

This topic is 3683 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Is there a way to tell OpenGL to not use any custom shader program after glUseProgram has been called? My scene graph activates shaders for certain objects, but not all objects require the use of a shader. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
For some reason, I get an INVALID_OPERATION error when I make that call. According to the spec, the function call will generate an error in the following cases:

GL_INVALID_VALUE is generated if
program is neither 0 nor a value
generated by OpenGL.

GL_INVALID_OPERATION is generated if
program is not a program object.

GL_INVALID_OPERATION is generated if
program could not be made part of current
state.

GL_INVALID_OPERATION is generated if
glUseProgram is executed between the
execution of
glBegin
and the corresponding execution of
glEnd.

There are no glBegin/glEnd calls in my program at all (using glDrawElements), and the first 2 don't seem like they apply so all I am left with is case 3 -- "Program could not be made part of the current state". Anyone have any idea what could cause that?

Share this post


Link to post
Share on other sites
Either there is no context or some other GL call generated the error and it only appears when you call glUseProgram. I can't think of anything else. Break down the problem to a small reproduceable case and upload it for people to test.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!