Jump to content
  • Advertisement
Sign in to follow this  
NighTiger

how to use SDL_UpdateRects

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

Advertisement
Have you read this?:

http://sdldoc.csn.ul.ie/sdlupdaterects.php

Basically, you pass the function your screen surface pointer, the number of rects you want to update, and the array of rects you want updated.


Ryan

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you aren't using SDL_DOUBLEBUF, then SDL_Flip() just calls SDL_UpdateRect()

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
If you aren't using SDL_DOUBLEBUF, then SDL_Flip() just calls SDL_UpdateRect()


SDL_UpdateRects is not the same as SDL_UpdateRect, and even with SDL_UpdateRect, you are not forced to update the entire screen. SDL_UpdateRects is good to use if you can accurately calculate which parts of the screen have changed, without too much waste. Sometimes the amount of extra code (and potential bugs) outweighs the benefits though. I'd classify this as an optimization, and put it off until I get the rest of the code working, and use SDL_Flip in the meantime.

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!