Mosquito: DirectDraw Overlays Sample

Click to open or copy the files for the Mosquito sample.

Mosquito is a simple application to demonstrate the use of overlays in DirectDraw.  To run the application, you must have a display adapter and driver which support overlays.

On a machine with overlay support, the application creates a big flapping mosquito which flies around the screen.   If your card doesn't support "Source Color Keying" of overlays, you'll see an ugly black rectangular background around the mosquito.

Some cards have better overlay support in certain resolutions that others. If you know your card has overlay support through DirectDraw, but Mosquito is having problems creating or displaying the overlay, try running the application in a lower screen resolution or color depth.

Building SDK Samples

This sample uses the following keywords:

areoverlayssupported; bitblt; copybitmaptoyuvsurface; createcompatibledc; createoverlay; createprimarysurface; createsurface; deletedc; deleteobject; destroyoverlay; dialogbox; directdrawcreate; displayerror; displayoverlay; enddialog; enumattachedcallback; enumattachedsurfaces; failed; flip; freedirectdraw; getbvalue; getcaps; getdc; getgvalue; getmodulehandle; getpixel; getrvalue; getsurfacedesc; getsystemmetrics; init_directdraw_struct; initdirectdraw; killtimer; loadimage; loadimageontosurface; lock; maindialogproc; makefourcc; makeintresource; messageboxindirect; moveoverlaytimercallback; queryinterface; rand; rand_int; random_velocity; release; releasedc; restore; restoreallsurfaces; selectobject; setcooperativelevel; setoverlayposition; settimer; unlock; updateoverlay; winmain; zeromemory