Detailed Description

Class which includes texture data.

Examples:

hwPhongShader.cpp.

#include <MTextureManager.h>

List of all members.

Public Member Functions

void * resourceHandle () const
 This method allows access to the draw API dependent handle for a texture.
const MStringname () const
 Get the name of the texture.
void textureDescription (MTextureDescription &desc) const
 Get texture description.
bool hasAlpha () const
 Get whether the texture has an alpha channel.
MStatus setHasAlpha (bool value)
 Specify that the texture has an alpha channel.
bool hasZeroAlpha () const
 Get whether the texture has any texels with an alpha value of 0.0.
MStatus setHasZeroAlpha (bool value)
 Specify that the texture has texels with an alpha value of 0.0.
bool hasTransparentAlpha () const
 Get whether the texture has semi-transparent texels.
MStatus setHasTransparentAlpha (bool value)
 Specify that the texture has texels with an alpha value greater than or equal to 0.0 and less than 1.0.
void * rawData (int &rowPitch, int &slicePitch) const
 Get a copy of the raw data mapped to the texture.

Static Public Member Functions

static const char * className ()
 Returns the name of this class.

Member Function Documentation

void * resourceHandle ( ) const

This method allows access to the draw API dependent handle for a texture.

This handle is owned by the renderer and is provided to allow access to use a texture as a read-only object.

Modifications should never be performed on this texture.

Any modifications to the texture may result in unpredictable stability as the renderer no longer has knowledge of the texture contents.

For OpenGL, a pointer to an OpenGL texture identifier is returned.

For DirectX 10 and higher a pointer to a shader resource view is returned.

Returns:
A pointer (handle) to the texture if successful, otherwise NULL.
const MString & name ( ) const

Get the name of the texture.

Returns:
The name of the texture
void textureDescription ( MTextureDescription desc) const

Get texture description.

Parameters:
[out]descThe texture description
bool hasAlpha ( ) const

Get whether the texture has an alpha channel.

Returns:
true if the channel exists
MStatus setHasAlpha ( bool  value)

Specify that the texture has an alpha channel.

This will only set a flag indicating this property but will not change the contents of the texture.

Care should be taken as the texture is only tested for this property when it is first loaded in and will not be checked again after this method is called.

Parameters:
[in]valueValue to set property to
Returns:
Status code
Status Codes:
bool hasZeroAlpha ( ) const

Get whether the texture has any texels with an alpha value of 0.0.

Returns:
true if such texels exist
MStatus setHasZeroAlpha ( bool  value)

Specify that the texture has texels with an alpha value of 0.0.

This will only set a flag indicating this property but will not change the contents of the texture.

Care should be taken as the texture is only tested for this property when it is first loaded in and will not be checked again after this method is called.

Parameters:
[in]valueValue to set property to
Returns:
Status code
Status Codes:
bool hasTransparentAlpha ( ) const

Get whether the texture has semi-transparent texels.

Such texels have an alpha value less than 1.0 and greater than or equal to 0.0.

Returns:
true if such texels exist
MStatus setHasTransparentAlpha ( bool  value)

Specify that the texture has texels with an alpha value greater than or equal to 0.0 and less than 1.0.

This will only set a flag indicating this property but will not change the contents of the texture.

Care should be taken as the texture is only tested for this property when it is first loaded in and will not be checked again after this method is called.

Parameters:
[in]valueValue to set property to
Returns:
Status code
Status Codes:
void * rawData ( int &  rowPitch,
int &  slicePitch 
) const

Get a copy of the raw data mapped to the texture.

The caller must deallocate the system memory as the texture itself does not keep any references to it.

Parameters:
[out]rowPitchThe row pitch of the data. It represents the number of bytes of one line of the texture data.
[out]slicePitchThe slice pitch of the data. It represents the number of bytes of the whole texture data.
Returns:
A pointer to the data, or NULL on failure
const char * className ( ) [static]

Returns the name of this class.

Returns:
Name of this class.

MTexture MTexture MTexture MTexture MTexture MTexture MTexture MTexture MTexture MTexture
MTexture MTexture MTexture MTexture MTexture MTexture MTexture MTexture MTexture MTexture