Example: Full Screen DirectDraw Program

The FullScr example is a full screen DirectDraw version of the first Fastgraph example. Like the First example, FullScr creates a 640x480 virtual buffer, fills it with blue pixels, and then displays it. FullScr also sets the DirectDraw full screen display mode to 640x480x256 and performs the additional tasks in WM_CREATE required for DirectDraw programs. Because this is a full screen program, we also set up a keyboard event handler so we can exit the program by pressing Esc or F12. Further, we know the screen resolution will always be the same as the virtual buffer dimensions, so the WM_PAINT handler can use fg_vbpaste() instead of fg_vbscale(), and we don't need a WM_SIZE handler to keep track of the client size.

FullScr also shows one other change that is often desirable in full screen DirectDraw programs: turning off the mouse cursor. The easiest way to do this is to call fg_mouseini() and fg_mousevis(0) after you call fg_vbinit(). If you hide the mouse cursor, don't forget to call fg_mousevis(1) before the program exits.

C/C++ version

C++Builder version

Delphi version

Visual Basic version

<< Prev

Next >>

Fastgraph Home Page


copyright 2001 Ted Gruber Software, Inc.