fg_tmdefine()

Win32 DirectX Fastgraph/Light

Prototype

int fg_tmdefine (void *texture, int width, int height);

Function fg_tmdefine (texture As Any, ByVal width As Long, ByVal height As Long) As Long

function fg_tmdefine (var texture; width, height : integer) : integer;

Description

The fg_tmdefine() function assigns a handle to a texture map, and if using Direct3D, loads the texture map into a DirectDraw texture surface.

Parameters

texture is an array containing the texture map. For 256-color virtual buffers, texture is a 256-color bitmap, but stored top-down. For direct color virtual buffers, it is a direct color bitmap, but again stored top-down.

width is the texture array width in pixels.

height is the texture array height in pixels.

Return value

If successful, fg_tmdefine() returns a handle by which the texture map is referenced (greater than or equal to 0). If unsuccessful, possible return codes are -1 (maximum number of textures exceeded) or -2 (cannot make texture available to Direct3D).

Restrictions

If using Direct3D, the texture map width and height must be powers of two.

See also

fg_3Dtexturemap(), fg_3Dtexturemapobject(), fg_tmfree(), fg_tminit(), fg_tmselect()

Examples

TMcube, TMcubeX

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.