DemoGL::Reference::Functions::DEMOGL_TextureGetData

DEMOGL_TextureGetData

DEMOGL_TextureGetData retrieves several types of information of the texture with the given TextureID, among them a pointer to the RGBA colorfragment buffer with the texture data.

byte
* DEMOGL_TextureGetData(
	const GLuint iTextureID, 
	int * const iWidth, 
	int * const iHeight, 
	int * const iDepth, 
	int * const iBitsPerPixel, 
	int * const iDimensions, 
	bool * const bHasAlpha
);
	
Parameters.
iTextureID
Specifies the TextureID of the texture which information should be retrieved.
iWidth
Pointer to an int variable which will be filled with the width in pixels of the texture with TextureID iTextureID.
iHeight
Pointer to an int variable which will be filled with the height in pixels of the texture with TextureID iTextureID.
iDepth
Pointer to an int variable which will be filled with the depth in pixels of the texture with TextureID iTextureID. Please note that 3D textures are not fully implemented in DemoGL.
iBitsPerPixel
Pointer to an int variable which will be filled with the amount of bits per pixel of the texture with TextureID iTextureID.
iDimensions
Pointer to an int variable which will be filled with the dimensions of the texture with TextureID iTextureID. Can be one of the following values: DGL_TEXTUREDIMENSION_1D for 1D textures, DGL_TEXTUREDIMENSION_2D for 2D textures or DGL_TEXTUREDIMENSION_3D for 3D textures, which are currently not implemented in full in DemoGL.
bHasAlpha
Pointer to a boolean variable which will be filled with the flag if this texture had an alpha channel stored in the texturedata or not.

Return values.
If the function succeeds, it returns a pointer to the RGBA color fragments of the texture.
If the function failes, NULL is returned.

Remarks.
Support for 3D textures is not fully implemented in DemoGL due to the lack of OpenGL 1.2 support in the Windows OpenGL implementation. The pointer returned by DEMOGL_TextureGetData points to a buffer with 32bpp color fragments with 1 byte per color fragment R, G B and A, in that order. When a pointer to a variable passed is NULL, the texture with TextureID is not found or the texture referenced is created using DEMOGL_TextureCreateFromFBRegion, DEMOGL_TextureGetData will fail and thus return NULL.

CubeMap textures will return NULL, and are not supported by this routine.

Example.

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_TextureDelete, DEMOGL_TextureLoad, DEMOGL_TextureUnUpload, DEMOGL_TextureUpload

Last changed on 20-jan-2001

©1999-2001 Solutions Design