Win32 DirectX Fastgraph/Light


int fg_vbdefine (void *buffer, int width, int height);

Function fg_vbdefine (buffer() As Any, ByVal width As Long, ByVal height As Long) As Long

function fg_vbdefine (buffer : pointer; width, height : integer) : integer;


The fg_vbdefine() function creates a virtual buffer with the specified dimensions from previously allocated memory. Virtual buffers are usually created in the WM_CREATE message handler. Use fg_vbsize() to determine the amount of memory needed for the virtual buffer. Refer to Chapter 10 of the Fastgraph 6.0 User's Guide for details about allocating blocks of memory suitable for virtual buffers.


buffer is the address of the virtual buffer.

width is the virtual buffer width in pixels. If necessary, the width is extended to a multiple of four bytes.

height is the virtual buffer height in pixels.

Return value

If successful, fg_vbdefine() returns a handle by which the virtual buffer is referenced (between 0 and 255). If unsuccessful, the function returns -1.


This function cannot be used to create virtual buffers when using Fastgraph's DirectX libraries (use fg_vballoc() instead).

See also

fg_vballoc(), fg_vbdepth(), fg_vbinit(), fg_vbopen(), fg_vbsize(), fg_vbundef()

Fastgraph Home Page


copyright 2001 Ted Gruber Software, Inc.