LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   SDL_Flip() Vs SDL_UpdateRects() (https://www.linuxquestions.org/questions/programming-9/sdl_flip-vs-sdl_updaterects-240984/)

MadCactus 10-10-2004 11:14 AM

SDL_Flip() Vs SDL_UpdateRects()
 
Hi,

I thought that with SDL double-buffering was only available with a HW surface, which is only available full-screen (right?).

I'm using a SW (presumably single-buffered since I haven't requested double-buffering) screen surface, and SDL_UpdateRects() does not seem to work like I expected.

With SDL_UpdateRects() the areas requested are updated, but not drawn unless the window receives a VIDEOEXPOSE event... Spooky. However SDL_Flip(screen) (which should just act like SDL_UpdateRect(screen, 0, 0, 0, 0)) updates and draws everything ok. This however is a bit more expensive than i'd like.

The only thing I can think of is that SDL_Flip() creates and handles its own VIDEOEXPOSE event, while SDL_UpdateRects() doesn't.

So should I send a VIDEOEXPOSE event after calling SDL_UpdateRects(), or am I going wrong somewhere?

Hko 10-10-2004 04:26 PM

I read somewhere (I don't remember exactly where) that:

- HW surface isn't necessarily faster then SW surface. (except for 3D I assume)

- SDL_UpdateRects() works on SW surface(?) (I'm not very sure about this one)


All times are GMT -5. The time now is 05:13 PM.