Jump to content
  • Advertisement
Sign in to follow this  
indigox3

glPushAttrib bit for CURRENT_PROGRAM?

This topic is 2812 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

Hello all,

I need to bind a program and do some render to texture operations without disturbing the current gl state in my app. So I do a glPushAttrib for various gl settings that I need to change and a glPopAttrib when I'm done. However, I can't seem to find a bit for glPushAttrib that will save the current active program. I have to manually do a glGetIntegerv( GL_CURRENT_PROGRAM ), then a glUseProgram() to restore it.

Does anyone know if there is any parameter to glPushAttrib that will save the current program?

thanks!

Share this post


Link to post
Share on other sites
Advertisement
Nope. The whole state push/pop API is sort of a hold over from the past, anyway.

You can accomplish this manually by calling glGet(GL_CURRENT_PROGRAM) to retrieve the current program, and then call glUseProgram() to set it again.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!