Direct3D Z-Buffering

To use z-buffering in a Direct3D program, you must specify the FG_DX_ZBUFFER flag when calling fg_ddsetup(). This causes fg_vbinit() to create a Direct3D z-buffer and attach it to the Direct3D rendering surface (that is, the DirectDraw back buffer). The fg_zballoc() function returns without doing anything when a program is using Direct3D hardware acceleration or Direct3D software rendering because fg_vbinit() creates the z-buffer as part of Fastgraph's Direct3D initialization. Hence Direct3D programs cannot create additional z-buffers, so they can draw z-buffered objects only on the back buffer and not on any other virtual buffers created with fg_vballoc(). Of course, once we've rendered a scene of z-buffered objects on the back buffer, we can display it with fg_ddflip().

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.