String Display in DirectX Programs

In DirectX programs, the fg_ddgetdc() and fg_ddfreedc() functions manage device contexts for virtual buffers. You'll need to use these functions if you want to use fg_print() to display strings in a virtual buffer in DirectX applications. To do this, use fg_ddgetdc() to create a device context (DC) for the active virtual buffer. Then pass the DC handle to fg_fontdc(). When done, use fg_ddfreedc() to release the device context. The following code illustrates this sequence:

C/C++:

hDC = fg_ddgetdc();
fg_fontdc(hDC);
fg_print(...);
fg_ddfreedc(hDC);

Delphi:

hDC := fg_ddgetdc;
fg_fontdc(hDC);
fg_print(...);
fg_ddfreedc(hDC);

Visual Basic:

hDC = fg_ddgetdc()
Call fg_fontdc(hDC)
Call fg_print(...)
Call fg_ddfreedc(hDC)

The virtual buffer is automatically locked between the fg_ddgetdc() and fg_ddfreedc() calls.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.