Firstly:
I just watched LusikkaMage's Game Development tutorial and she said she usually creates two surfaces; the buffer and the screen. So if I did that, it would just be done like:
Code: Select all
//Blit everything to the buffer here...
SDL_Flip(buffer);
SDL_BlitSurface(buffer, NULL, screen, &offsets); //obviously I'd declare/initialize the SDL_Rect offset =p
SDL_Flip(screen);
My second question is whether to use this, or the Double Buffer flag when setting up the screen?
And can anyone offer some insight onto how the Double Buffer flag works exactly ?
Thanks for any help/input/advice. I tried Google but I didn't find anything relevant to what I was looking for.
EDIT: Now that I think about it, do I have to do both? Like create both the buffer and screen surfaces enabling the Double Buffer Flag, then use something along the lines of that bit of code I posted?
EDIT2: Actually now that I look at it, it seems the Double Buffer Flag is used when the screen is created as a hardware surface, and the first method I asked about, would be when it's created as a software surface?
If someone could post a small example it would be EXTREMELY helpful =)