WineD3D: move fake context code over to WGL
k04jg02 at kzoo.edu
Wed Aug 8 00:43:42 CDT 2007
Alexandre Julliard wrote:
> Roderick Colenbrander <thunderbird2k at gmx.net> writes:
>> Subject: [PATCH] Move WineD3D_CreateFakeGLContext and friends over
>> to WGL. For this we need a HDC and one received from lets say
>> GetDC(0) won't do. Further this HDC needs CS_OWNDC set. For this
>> reason we need our own window class.
> Why does it need CS_OWNDC? That sounds like a bug.
I came across this today in the wxWidgets library. Although it's not
clear it affects newer windows versions, this comment tries to explain,
From Angel Popov <jumpo at bitex.com>
Here are two snips from a dicussion in the OpenGL Gamedev list that
how this problem can be fixed:
"There are 5 common DCs available in Win95. These are aquired when you
GetDC or GetDCEx from a window that does _not_ have the OWNDC flag.
OWNDC flagged windows do not get their DC from the common DC pool, the
is they require 800 bytes each from the limited 64Kb local heap for GDI."
"The deal is, if you hold onto one of the 5 shared DC's too long (as
do), Win95 will actually "steal" it from you. MakeCurrent fails,
apparently, because Windows re-assigns the HDC to a different window.
only way to prevent this, the only reliable means, is to set CS_OWNDC."
More information about the wine-devel