On 31 October 2011 20:38, Stefan Dösinger stefandoesinger@gmx.at wrote:
You would get the same effect by calling GetDC and ReleaseDC from ddraw or ddrawex without another usage flag.
Yes, but I don't think that would be an improvement.
- /* Similar to lockable rendertargets above, creating the DIB section
- * during surface initialization prevents the sysmem pointer from
changing + * after a wined3d_surface_getdc() call. */
Is this a property of DDSCAPS_OWNDC, or sysmem surfaces in general? I'd expect that this applies to sysmem surfaces in general.
Probably in general. The way GetDC is supposed to work is probably by asking the graphics driver to create a DC on top of the existing memory or texture, instead of the DIB section hacks we do in wined3d. However, without much more invasive changes to the way wined3d interacts with winex11 that's just not going to happen, and since OWNDC implies the application wants to keep the DC around anyway, we might as well set it up at surface initialization.