Sign in to follow this  

SDL_Flip or SDL_SDL_UpdateRec???

This topic is 4659 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 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+++

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4659 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this