Idear for OpenGL overdraw child windows Bug

Florian Köberle FloriansKarten at web.de
Mon Jul 24 15:01:16 CDT 2006


When OpenGL draws, child windows get overdrawn.

The suggestions to solve these problem where all based on the idear of
clipping that what OpenGL render so that OpenGL doesn't overdraw them.

What do you think of the idear of letting OpenGL overdrawing the child
windows, but then after this we redraw all the child windows?

There are two things who have to be done:
1.) find out when OpenGL finished his drawing
2.) find a way to draw the child windows.

possible solutions for 2.)
The easiest (but slowest) way of doing this could be a broadcast of the
window message WM_PAINT to all child windows.

A fast version could save the drawn child windows in a buffer with a
additional 1 bit alpha channel. The alpha channel remember where the
child windows are. This is done only when the child windows change.
Every time OpenGL finished his drawing, the buffer content is drawn over
the OpenGL output.

idears for 1.)

When doublebuffering is used (which is usually the case), every drawing
is finished with a swapbuffer call wich takes as argument a DC. A test
if the pixelformat of the DC is supporting OpenGL may avoid side effects.
Have a look at the attached source code of a OpenGL program with a grey
child window in the top middle(not visible in wine because of the bug).
There you can see a how a pixelformat with OpenGL support is choosen for
the DC.

Old OpenGL programs without doublebuffer support call glFlush to make
sure that all drawings are done and not unfinished. So we simply have to
change glFlush that it redraw the child windows when no doublebuffering
is used.

What do you think about that idear?

Bug Report about that topic:
http://bugs.winehq.org/show_bug.cgi?id=2398
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenGL01.cpp
Type: text/x-c++src
Size: 5793 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060724/1c2fe8f1/OpenGL01-0001.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenGL01.exe
Type: application/x-msdos-program
Size: 27988 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060724/1c2fe8f1/OpenGL01-0001.exe


More information about the wine-devel mailing list