Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

aleks_1661

OpenGL OpenGL State Changes

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

redundant state changes can cost performance, would using a function such as the following improve performance by detecting redundant calls or does opengl do this anyway?
void fglEnable( int cap )
{
	if ( !glIsEnabled(cap) )
	{
		glEnable(cap);
	}
}
"Very funny, Scotty. Now beam down my clothes." [edited by - aleks_1661 on August 10, 2003 10:35:05 AM]

Share this post


Link to post
Share on other sites
Advertisement
Some implementations don't (or rather, you can't count on that being a guarantee). Another possibility is to store your own states as you modify them in OpenGL. Then you could just check your own value for redundancy in your routine that sets the state.

Again, I don't know how big of a deal that is.

The best way to avoid many state changes is to group your objects such that the state changes are kept to a minimum.

[edited by - Waverider on August 10, 2003 11:19:29 AM]

Share this post


Link to post
Share on other sites

  • 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!