Double Buffering

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
baallrog
Posts: 7
Joined: Wed Aug 16, 2006 9:30 am

Double Buffering

Post by baallrog »

Hi everyone,

My question is simple : how do you do double buffering??

i see that with sceDisplayWaitVblankStart() i can refresh the sreen or something like that ... if you have more informations on it !!

So if you have a simple example on how i can do double buffering it would be great !!!

i have search but i don't find a such example !!

thank you in advance
Aion
Posts: 40
Joined: Mon Jul 24, 2006 10:58 pm
Location: Montreal

Post by Aion »

Look at "cube.c" example that comes with the Sdk.
baallrog
Posts: 7
Joined: Wed Aug 16, 2006 9:30 am

Post by baallrog »

i see that, but it's in 3D, i hope this work in 2D mode .

The "sprites.c" use the double buffering ??

thank you !!
Aion
Posts: 40
Joined: Mon Jul 24, 2006 10:58 pm
Location: Montreal

Post by Aion »

It's always double-buffered, no matter that you're only doing 2d blitting, or 3d, so yes, sprites.c is double-buffered.

The only way I can see not having doublebuffer would be to point the display/draw at the same memory location.
baallrog
Posts: 7
Joined: Wed Aug 16, 2006 9:30 am

Post by baallrog »

i begin to code for the psp with this tutorials. And i think they're not double buffering ...
Even, they doesn't use the GU .

So now i have a project in mind (a little shoot game) i want more fcuntionnalities.

I have seen how i can do double duffering but there is always some thing obscur to me. Is there any tutorial about that? o some documentation who explain what function do thaht or that thing ??

thank you very much !!


ps : sceDisplayWaitVblankStart() is still very strange, what does this ???
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

baallrog wrote:i begin to code for the psp with this tutorials. And i think they're not double buffering ...
Even, they doesn't use the GU .
The sprite.c sdk sample uses both double buffering and the GU
I have seen how i can do double duffering but there is always some thing obscur to me. Is there any tutorial about that? o some documentation who explain what function do thaht or that thing ??

thank you very much !!
I think you don't have the right impression of what doublebuffering actually is yet.
Doublebuffering just means you draw/render to one buffer in the background, while another one is being displayed, then when the backbuffer is completed, you switch both buffers. There's nothing more to it.
ps : sceDisplayWaitVblankStart() is still very strange, what does this ???
It waits for the refresh of the LCD to happen before continuing execution. This is needed to avoid tearing artifacts when switching the buffers. Since the PSP LCD runs at 60Hz, it will at most delay 1/60s and make your program not run at more than 60fps.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Post Reply