Dirty Rectangles / SDL

Member
Posts: 156
Joined: 2002.10
Post: #1
I'm wanting to clarify a point about implementing dirty rectangle drawing in SDL.

When I draw to the back buffer of the screen, i keep track of all the rects that I have modified. Now when I want to actually update the screen is it best to call SDL_UpdateRects() with an array of the rects, or should I combine them all into one rect and call SDL_UpdateRect() with it?

Also, if I am using hardware double-buffering and calling SDL_Flip() to update the screen this basically takes away to whole reason to use dirty-rectangles, since page flipping in VRAM is much faster anyway. Am I right?

I plan to give the user the option to use hardware or software buffering.

- Iain
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
* SDL's 2D isn't h/w accelerated on the Mac
* SDL can't page flip (except using OpenGL in full-screen mode) on the Mac
Quote this message in a reply
Member
Posts: 156
Joined: 2002.10
Post: #3
Ummm. So passing SDL_HWSURFACE and SDL_DOUBLEBUF to SDL_SetVideoMode() has no effect then, and I may as well use SDL_SWSURFACE?

Anyhow, if I can't used page flipping, a dirty rectangle system is even more important, so can someone answer my previous question?

- Iain
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #4
Much of what you want to know is answered in SDL Mac OS X faq...

It doesn't say anything about hardware mode, but I saw something with google in their mailing list that mentioned it didn't work. Probably figure it out by looking at the code I suppose for sure... can't second guess that.

-Jon
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to do a Quick, Dirty bloom effect FAST! Oddity007 12 7,539 May 9, 2009 09:42 AM
Last Post: aardvarc