Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XFcGLTexture Class Reference

Texture class. More...

Collaboration diagram for XFcGLTexture:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual XFCIMPORT ~XFcGLTexture ()
 Virtual destructor.

XFCIMPORT INT32 getSurfaceCount ()
 Returns surface count for this texture.

XFCIMPORT INT32 getSurfaceFormat ()
 Returns surface format for this texture.

XFCIMPORT XFcGLSurfacelock (INT32 aSurfaceIndex)
 Locks a specific surface in this texture.

XFCIMPORT INT unlock (INT32 aSurfaceIndex)
 Unlocks a specific surface in this texture.

XFCIMPORT INT32 getPrimarySurfaceWidth ()
 Returns the largest surface width.

XFCIMPORT INT32 getPrimarySurfaceHeight ()
 Returns the largest surface height.

XFCIMPORT INT32 getTexelFormat ()
 Returns the texel format for this texture.

XFCIMPORT void preload ()
 Preloads the texture for rendering.

XFCIMPORT INT32 getGLData ()
 Returns the graphics device data hook. [Internal].

XFCIMPORT void setGLData (INT32 aData)
 Sets the graphics device data hook. [Internal].

XFCIMPORT XFcGLTexture * getNext ()
 Returns the next texture in the linked list. [Internal].

XFCIMPORT XFcGLTextureBuildergetBuilder ()
 Returns the builder for this texture. [Internal].


Static Public Member Functions

XFCIMPORT XFcGLTexture * create (XFcGLTextureBuilder *aBuilder, INT32 aFlags=0)
 Static constructor.

XFCIMPORT void filterMapPointSample55X5 (XFcGLSurface *aSrc, void *aTgt)
 Calculates mipmap level data based on one level higher data.

XFCIMPORT void filterMapLinear55X5 (XFcGLSurface *aSrc, void *aTgt)
 Calculates mipmap level data based on one level higher data.

XFCIMPORT void filterMapPointSample5515 (XFcGLSurface *aSrc, void *aTgt)
 Calculates mipmap level data based on one level higher data.

XFCIMPORT void filterMapLinear5515 (XFcGLSurface *aSrc, void *aTgt)
 Calculates mipmap level data based on one level higher data.

XFCIMPORT void filterMapPointSamplePal55X5 (XFcGLSurface *aSrc, void *aTgt)
 Calculates mipmap level data based on one level higher data.


Protected Member Functions

 XFcGLTexture ()
 Protected constructor.


Protected Attributes

XFcGLTextureBuildermBuilder
 Texture builder object for this texture.

XFcGLComplexSurfaceResourcemSurface
 Resource that contains the surface data for all surfaces for this texture.

XFcGLTexture * mNext
 Internal linked list of all textures.

INT32 mWidth
 Largest surface width.

INT32 mHeight
 Largest surface height.

INT32 mFormat
 Texture surface format.

INT32 mGLData
 Intenal: graphics device data hook.


Detailed Description

Texture class.

Encapsulates a single texture. The texture may have multiple surfaces, which are used for mip mapping. Most often textures are created using the XFcGLTextureFromFile class.

See also:
XFcGLTextureFromFile


Constructor & Destructor Documentation

virtual XFCIMPORT XFcGLTexture::~XFcGLTexture   [virtual]
 

Virtual destructor.

XFcGLTexture::XFcGLTexture   [protected]
 

Protected constructor.


Member Function Documentation

XFCIMPORT XFcGLTexture* XFcGLTexture::create XFcGLTextureBuilder   aBuilder,
INT32    aFlags = 0
[static]
 

Static constructor.

In order to create a texture, you have to extend the XFcGLTextureBuilder class, create an object of said class and pass it as a parameter to this create-function. The texture builder object knows how to create the texture surfaces whenever they are needed, and since all texture surfaces are resources, the memory manager may discard them when the system is running low on memory. The flags are a combination of resource manager flags and the texture creation flags.

Parameters:
aBuilder texture builder to use.
aFlags combined flags, see XFCRESOURCEFLAGS and XFCTEXTURECREATE.
Returns:
new texture, or NULL if unsuccessful.
See also:
XFCRESOURCEFLAGS

XFCTEXTURECREATE

XFCIMPORT void XFcGLTexture::filterMapLinear5515 XFcGLSurface   aSrc,
void *    aTgt
[static]
 

Calculates mipmap level data based on one level higher data.

Note:
Performs 2x2 box filtering.
Parameters:
aSrc source surface to calculate mipmap data for.
aTgt destination memory to write the scaled down image.

XFCIMPORT void XFcGLTexture::filterMapLinear55X5 XFcGLSurface   aSrc,
void *    aTgt
[static]
 

Calculates mipmap level data based on one level higher data.

Note:
Performs 2x2 box filtering.
Parameters:
aSrc source surface to calculate mipmap data for.
aTgt destination memory to write the scaled down image.

XFCIMPORT void XFcGLTexture::filterMapPointSample5515 XFcGLSurface   aSrc,
void *    aTgt
[static]
 

Calculates mipmap level data based on one level higher data.

Note:
Performs point sample scaling.
Parameters:
aSrc source surface to calculate mipmap data for.
aTgt destination memory to write the scaled down image.

XFCIMPORT void XFcGLTexture::filterMapPointSample55X5 XFcGLSurface   aSrc,
void *    aTgt
[static]
 

Calculates mipmap level data based on one level higher data.

Note:
Performs point sample scaling.
Parameters:
aSrc source surface to calculate mipmap data for.
aTgt destination memory to write the scaled down image.

XFCIMPORT void XFcGLTexture::filterMapPointSamplePal55X5 XFcGLSurface   aSrc,
void *    aTgt
[static]
 

Calculates mipmap level data based on one level higher data.

Note:
Performs point sample scaling.
Parameters:
aSrc source surface to calculate mipmap data for.
aTgt destination memory to write the scaled down image.

XFCIMPORT XFcGLTextureBuilder* XFcGLTexture::getBuilder  
 

Returns the builder for this texture. [Internal].

XFCIMPORT INT32 XFcGLTexture::getGLData  
 

Returns the graphics device data hook. [Internal].

XFCIMPORT XFcGLTexture* XFcGLTexture::getNext  
 

Returns the next texture in the linked list. [Internal].

XFCIMPORT INT32 XFcGLTexture::getPrimarySurfaceHeight  
 

Returns the largest surface height.

XFCIMPORT INT32 XFcGLTexture::getPrimarySurfaceWidth  
 

Returns the largest surface width.

XFCIMPORT INT32 XFcGLTexture::getSurfaceCount  
 

Returns surface count for this texture.

XFCIMPORT INT32 XFcGLTexture::getSurfaceFormat  
 

Returns surface format for this texture.

See also:
XFCGFXFORMAT

XFCIMPORT INT32 XFcGLTexture::getTexelFormat  
 

Returns the texel format for this texture.

See also:
XFCGFXFORMAT

XFCIMPORT XFcGLSurface* XFcGLTexture::lock INT32    aSurfaceIndex
 

Locks a specific surface in this texture.

Parameters:
aSurfaceIndex index of the surface to lock.
Returns:
pointer to the locked surface, or NULL if unsuccessful.

XFCIMPORT void XFcGLTexture::preload  
 

Preloads the texture for rendering.

This call is completely voluntary; the system will load the texture when it's needed next.

XFCIMPORT void XFcGLTexture::setGLData INT32    aData
 

Sets the graphics device data hook. [Internal].

XFCIMPORT INT XFcGLTexture::unlock INT32    aSurfaceIndex
 

Unlocks a specific surface in this texture.

Parameters:
aSurfaceIndex index of the surface to unlock.


Member Data Documentation

XFcGLTextureBuilder* XFcGLTexture::mBuilder [protected]
 

Texture builder object for this texture.

INT32 XFcGLTexture::mFormat [protected]
 

Texture surface format.

INT32 XFcGLTexture::mGLData [protected]
 

Intenal: graphics device data hook.

INT32 XFcGLTexture::mHeight [protected]
 

Largest surface height.

XFcGLTexture* XFcGLTexture::mNext [protected]
 

Internal linked list of all textures.

XFcGLComplexSurfaceResource* XFcGLTexture::mSurface [protected]
 

Resource that contains the surface data for all surfaces for this texture.

INT32 XFcGLTexture::mWidth [protected]
 

Largest surface width.


   
X-Forge Documentation
Confidential
Copyright © 2002-2003 Fathammer
   
Documentation generated
with doxygen
by Dimitri van Heesch