SDL_Flip or SDL_SDL_UpdateRec???

Started by
4 comments, last by elekis 19 years, 2 months ago
hi, I try to make a simple tetris (my first game), but I have a dilemme. first, it's a simple tetris (no 3D , no AI, no network etc..etc..) and my first question is ... is it better to work with DOUBLEBUF or not (for that simple game, but generally too)?? and second questions :->SDL_Flip or SDL_SDL_UpdateRec??? I mean, is it alawys better to call SDl_flip(screen) even if threre no DOUBLEBUF (and so it's the same that, SDL_UpdateRec(Screen,0,0,0); or it's better (because it's more rapidly for exemple , but I m' not sure because it's hardware), or not, and call a simple rect of screen (even in doublebuff) is fastest??? is it clear??? thanks a+++
Advertisement
Well simply speaking, yes, go ahead and work with double buffering. There is nothing that I think is *too simple* to not use double buffering. It sure will make your life easier.

You can use SDL_Flip in any circumstance. The beauty of it is that if you are not using double buffering it will just call SDL_UpdateRect.

I say just get something up and running first with double buffering and SDL_Flip. If you are not sastified with the speed, I'm sure you could spend the time to make something a little bit faster, if you really wanted to.

- Drew
Well, I don't think you can use SDL_Flip without SDL_DOUBLEBUF. I suggest keeping SDL_DOUBLEBUF and calling SDL_Flip because even for a simple game you don't want ugly flicker.
-----------------------------Play Stompy's Revenge! Now!
Quote:Original post by Stompy9999
Well, I don't think you can use SDL_Flip without SDL_DOUBLEBUF. I suggest keeping SDL_DOUBLEBUF and calling SDL_Flip because even for a simple game you don't want ugly flicker.


I'll go ahead and paste my link:
Quote:
On hardware that supports double-buffering, this function sets up a flip and returns. The hardware will wait for vertical retrace, and then swap video buffers before the next video surface blit or lock will return. On hardware that doesn't support double-buffering, this is equivalent to calling SDL_UpdateRect(screen, 0, 0, 0, 0)


It's just a lazy man's function [smile].

- Drew
In either case, SDL seems to have easy enough double buffer support.
-----------------------------Play Stompy's Revenge! Now!
thanks a lot

This topic is closed to new replies.

Advertisement