Microsoft Windows CE 3.0  

Using a Clipper with the System Cursor

This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

DirectDraw applications often need to provide a way for users to navigate using the mouse. For full-screen exclusive mode applications that use page-flipping, the only option is to implement a mouse cursor manually with a sprite, moving the sprite based on data retrieved from the device or by responding to Windows mouse messages. However, any application that doesn't use page-flipping can still use the system's mouse cursor support.

When you use the system mouse cursor, you will sometimes fall victim to graphic artifacts that occur when you blit to parts of the primary surface. These artifacts appear as portions of the mouse cursor seemingly left behind by the system.

A DirectDrawClipper object can prevent these artifacts from appearing by preventing the mouse cursor image from "being in the way" during a blit operation. It's a relatively simple matter to implement, as well. To do so, create a DirectDrawClipper object by calling the IDirectDraw4::CreateClippermethod. Then, assign your application's window handle to the clipper with the IDirectDrawClipper::SetHWndmethod. Once a clipper is attached, any subsequent blits you perform on the primary surface with the IDirectDrawSurface5::Bltmethod will not exhibit the artifact.

Note that the IDirectDrawSurface5::BltFastmethod, and its counterparts in the IDirectDrawSurface, IDirectDrawSurface2, and IDirectDrawSurface3interfaces, will not work on surfaces with attached clippers.

 Last updated on Tuesday, May 18, 2004

© 2004 Microsoft Corporation. All rights reserved.