Am Samstag 29 Juli 2006 11:17 schrieb Andrew Riedi:
Well, here is my first patch, feel free to tell me what all is wrong with it. I noticed a problem in WoW d3d, so I tracked it down and checked out msdn. It seems that implementing ShowCursor() over GDI is acceptable, at least according to msdn, and it seems to work great. Anyhow, this patch fixes the two mouse cursor problem in WoW, and makes wined3d more compatible with windows, at least msdn. Here goes nothing.
MSDN says that the cursor image set with SetCursorProperties can be shown as a user cursor if it has a size of 32x32 pixels. Otherwise the cursor is emulated like we do it at already in swapchain.c, IDirect3DSwapChain9::Present.
So if the cursor image is 32x32 pixels, upload it to a gdi cursor, and do not upload it to a gl texture(doine in SetCusorProperties with the preload call), and do not draw it in present. Activate the user cursor in ShowCursor.
If the cursor is not 32x32 pixels then disable the gdi cursor, and draw the cursor as it is done now(upload to a gl texture, call Blt in present.
I don't know how to set a gdi cursor, but you can find the image in the d3d surface at surface->resource.allocatedMemory. Be aware that allocatedMemory may be NULL if the image is just stored in a gl texture, so the cleaner way is to call IWineD3DSurface::LockRect to retrieve the image.