Using Direct3D Externally

The fg_ddgetobj(), fg_ddsetobj(), and fg_ddapply() functions let you initialize and manage Direct3D outside of Fastgraph, yet still use Fastgraph functions for other tasks. The complete list of DirectX objects recognized by fg_ddgetobj() and fg_ddsetobj() is presented here:

Code

DirectX object

0

DirectDraw2, DirectDraw4, or DirectDraw7

1

DirectDrawSurface2, DirectDrawSurface4, or DirectDrawSurface7 for primary surface

2

DirectDrawClipper

3

DirectDrawPalette

4

Direct3D2, Direct3D3, or Direct3D7

5

Direct3DDevice2, Direct3DDevice3, or Direct3DDevice7 (hardware acceleration)

6

Direct3DDevice2, Direct3DDevice3, or Direct3DDevice7 (software rendering)

7

Direct3DViewport2 or Direct3DViewport3 (not used for DirectX 7)

8

DirectDrawSurface2, DirectDrawSurface4, or DirectDrawSurface7 for Direct3D z-buffer

Any DirectDraw objects (codes 0 through 3 in the above table) defined through fg_ddsetobj() must be defined before you call fg_vbinit(). Direct3D objects (codes 4 through 8) may be defined either before or after calling fg_vbinit(). Once you have created all the required DirectX objects and used fg_ddsetobj() to tell Fastgraph about them, use fg_ddapply() to activate these objects. This must be done after calling fg_vbinit(), but before you create any virtual buffers.

The SetupD3D example shows how to externally manage DirectX for full screen Direct3D programs. Source code for SetupD3D will not be presented here but is installed along with Fastgraph's other C/C++ examples (SetupD3D is available only for C/C++).

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.