Mouse Pointer OpenGL Killer

Incase you don’t already know, in the new Windows 2000, you get a small shadow beneath the mouse pointer (the shadow is enabled by default.)

All harmless enough you might think, until I started testing the frame rate of an MFC based OpenGL programme that I wrote, and noticed the following information:

Frame rates for OpenGL window, mouse pointer shadow enabled (as default):

Stationary mouse pointer over OpenGL window: 12.5 fps

Moving mouse pointer over OpenGL window: 9.1 fps

Stationary mouse pointer NOT over OpenGL window: 14.3 fps

Moving mouse pointer NOT over OpenGL window: 9.1 fps

If on the other hand, I turn the pointer shadow off (from the control panel), then my frame rate stays at 14.3 fps no matter what.

Nice eh? That ‘little’ shadow can nearly halve the frame rate of an OpenGL programme in a window!!!

Anybody got any clues as to why this happens, or can verify my findings?

Well, you are absolutly right

I found the same behavior in the beta versions of W2K and reported them, but got no response.

The GDI+ diffuse mouse cursor shadow does not only affect OpenGL, it is affecting DirectX (i.e.Direct3D) and the GDI in general).

The first preperation to GDI+ can be found in W98, where a AlphaBlt function is available (it supports MMX, :cool

In W2K there changed it, so it is also capable of using a 3d accelerator (through D3D, of course).

And that’s why your framerate is dropping.

I hope I made thinks clear (sorry I’m not an native english speaker)

With Regards,


Thanks lgrosshennig - that’s made things a bit clearer.

I wonder if there’s a way of altering someones system settings from within an application, to turn the pointer shadow off…

I’d just like to add that this nothing specific to Windows 2000; exactly the same append with win 95/98/NT4 and any animated pointers (at least on a 3DLabs board. ICDs & display drivers from other vendor might handle that a bit better).
I don’t use Win 2000 so I don’t really know if the shadow you’re speaking about simply is a standard win32 pointer (hCursor) but if it is the case you probably can use SetCursor()to revert to a standard pointer when the mouse is on your windows.

The problem though, is that the cursor will reduce the OpenGL windows frame rate even if the cursor’s not over the OpenGL window.