doublebuffered window

20 views
Skip to first unread message

zlatko vidlanović

unread,
Mar 17, 2012, 4:58:33 AM3/17/12
to xbl...@googlegroups.com
I see that someone say that xblite example contain double buffering.
I am interested how create double buffered window ?
Is there any example just for window?
In this window will be possible to draw primitive graphics like dots,lines,rectangles,elipses
by api,right?
And that this graphics stay stable when we move or resize our window.
Of course without any kind of flickering.
Any ideas are welcome...!

David Szafranski

unread,
Mar 18, 2012, 3:35:34 AM3/18/12
to xbl...@googlegroups.com
There are many xblite GUI demos which utilize double buffering. The first one
I can think of is called moire.x and can be found in the \xblite\demo\gui\moire\ folder.

A more complicated example would be maze.x which does some drawing of lines.

The important code to look at is the CreateScreenBuffer() function. This is where a memory
buffer is created and upon which all drawing occurs. Then the contents of the buffer are copied to the screen using BitBlt() when needed or when the screen needs to be refreshed.

This is accomplished by calling InvalidateRect() which sends a WM_PAINT message to the window procedure WndProc().

Hope this helps.

D.

--
You received this message because you are subscribed to the Google Groups "xblite" group.
To view this discussion on the web visit https://groups.google.com/d/msg/xblite/-/MpPd4JogZoMJ.
To post to this group, send email to xbl...@googlegroups.com.
To unsubscribe from this group, send email to xblite+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xblite?hl=en.

zlatko vidlanović

unread,
Mar 18, 2012, 7:14:50 PM3/18/12
to xbl...@googlegroups.com
Thank you very much! 
Reply all
Reply to author
Forward
0 new messages