Z-Buffer ManagementFastgraph implements z-buffers much like virtual buffers. That is, you create z-buffers with fg_zballoc(), which returns a handle that you pass to fg_zbopen() to activate the z-buffer. This process, which would most likely appear in a program's WM_CREATE handler, is shown here:
C/C++:
Delphi:
Visual Basic:
Before your program exits, you pass the handle to fg_zbfree() to release the z-buffer memory:
C/C++ and Delphi:
Visual Basic:
The fg_zbfree() call will usually be in a program's WM_DESTROY handler. Before rendering all 3D objects in a scene, we'll probably clear the active virtual buffer to erase the contents of the previous frame. When we do this, we must also call fg_zbframe() to prepare the z-buffer for the next frame. The fg_zbframe() function has no parameters and no return value.
|
 
copyright 2001 Ted Gruber Software, Inc.