Jump to content
  • Advertisement
Sign in to follow this  
CuppoJava

OpenGL OpenGL: Help understanding how the GPU relates to anything.

This topic is 3768 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, I'm in the midst of programming my game right now and there's one thing that I don't really understand. in OpenGL you have to bind a texture a first before you can draw it. ie. bind( texture123 ) drawquad(); Would it be a good idea to keep track of the currently bound texture, if I wanted to make a simple-to-use drawing engine? ie. drawTexture( Texture tex ) { if( currentlyBoundTexture != tex) bind(tex); drawquad(); } This way, I'm still avoiding redundant calls to glBindTexture. Thanks a lot -Cuppo

Share this post


Link to post
Share on other sites
Advertisement
Checks for redundandany are normally quite useful to remove unnecessary state changes. Do it! I am not sure whether OpenGL will check for redundancy internally, but it is good software design to not trust a third-party library or interface by assuming it will do something that is not officially specified ;)

If I had to use your library I would not want to check for redundancy myself. It would expect you libary to do this for me ;)

Best regards,
Porthos

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!