forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

display context doubt

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
everlasting



Joined: 19 Mar 2007
Posts: 41

PostPosted: Mon Jun 11, 2007 1:36 pm    Post subject: display context doubt Reply with quote

I have been working on the Text sample from the sdk, and i've take a look to other GU samples. One of the things i do not understand is that it seems to be two display contexts. By doing swapbuffers you print the screen and go back to the previous context which might be different from the last one.
This means that you have to print the same thing at least twice in order to have the same info in both contexts. At least this is what i have understood, but i can't see the usefulness of this.

I would like to get deeper into GU module, therefore if anyone could supply any info or links i'd be grateful.Thanks
Back to top
View user's profile Send private message
gambiting



Joined: 17 Aug 2006
Posts: 154

PostPosted: Mon Jun 11, 2007 4:23 pm    Post subject: Reply with quote

You write to only one buffer at once.You can't write to the currently displayed buffer.You draw on the second one,and then you swap them.Then,the display buffer becomes the second one(non-visible),and vice-versa.But that's true that you should draw everything again after every buffer swap.
Back to top
View user's profile Send private message
everlasting



Joined: 19 Mar 2007
Posts: 41

PostPosted: Mon Jun 11, 2007 11:11 pm    Post subject: Reply with quote

i knew you only write in only one buffer each time (i´m spanish so may be i didn't explain myself very well), but i didn`t know that is not possible to write to the displayed buffer. So you have to worry about 'copying' every modification you do in the non-visible buffer to the visible one after swapping haven't you?.
Thanks a lot your explanation was very usefull.
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Mon Jun 11, 2007 11:39 pm    Post subject: Reply with quote

Read here for info on doublebuffering: http://en.wikipedia.org/wiki/Double_buffering

Also, you CAN draw to the displaybuffer. However, normally you should avoid that, because when the drawing is slow (or you are drawing a lot), the single drawing steps can be seen. That's why double buffering is used.
Also, a swapbuffer call doesn't change the context. It merely swaps draw and display buffer (page flipping).

If you don't understand why you have to repeatedly draw things on the screen, then you should start researching how basic drawing loops work, since this is common approach around all computer graphic applications.
_________________
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Back to top
View user's profile Send private message Visit poster's website
everlasting



Joined: 19 Mar 2007
Posts: 41

PostPosted: Tue Jun 12, 2007 3:01 am    Post subject: Reply with quote

thanks raphael, good info.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group