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
display context doubt
-
- Posts: 41
- Joined: Mon Mar 19, 2007 6:27 pm
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.
Thanks a lot your explanation was very usefull.
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.
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
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl