Castor3D  ..
Classes | Public Member Functions | Friends | List of all members
Castor3D::TextureUnit Class Reference

Texture unit representation. More...

+ Inheritance diagram for Castor3D::TextureUnit:
+ Collaboration diagram for Castor3D::TextureUnit:

Classes

class  BinaryParser
 TextureUnit loader. More...
 
class  TextLoader
 TextureUnit loader. More...
 

Public Member Functions

C3D_API TextureUnit (Engine &p_engine)
 Constructor. More...
 
C3D_API ~TextureUnit ()
 Destructor. More...
 
C3D_API void Initialise ()
 Initialises the texture, id est : fills the image buffer, creates the texture in the render system. More...
 
C3D_API void Cleanup ()
 Cleans up the texture. More...
 
C3D_API void SetTexture (TextureSPtr p_texture)
 Sets the texture. More...
 
C3D_API void Bind () const
 Applies the texture unit. More...
 
C3D_API void Unbind () const
 Removes the texture unit from the stack, in order not to interfere with other ones. More...
 
C3D_API void UploadImage (bool p_bSync)
 Uploads current image to the GPU. More...
 
C3D_API void DownloadImage (bool p_bSync)
 Downloads the current image from the GPU. More...
 
C3D_API bool LoadTexture (Castor::Path const &p_pathFile)
 Loads the texture image from the given path. More...
 
C3D_API eTEXTURE_TYPE GetType () const
 Retrieves the texture dimension. More...
 
C3D_API eTEXTURE_MAP_MODE GetMappingMode () const
 Retrieves the texture mapping mode. More...
 
C3D_API void SetMappingMode (eTEXTURE_MAP_MODE p_mode)
 Defines the texture mapping mode. More...
 
C3D_API uint8_t const * GetImageBuffer () const
 Retrieves the texture image buffer. More...
 
C3D_API uint8_t * GetImageBuffer ()
 Retrieves the texture image buffer. More...
 
C3D_API Castor::PxBufferBaseSPtr const GetImagePixels () const
 Retrieves the texture image pixels. More...
 
C3D_API Castor::PxBufferBaseSPtr GetImagePixels ()
 Retrieves the texture image pixels. More...
 
C3D_API uint32_t GetImageSize () const
 Retrieves the texture image size (in bytes) More...
 
C3D_API uint32_t GetWidth () const
 Retrieves the texture image width. More...
 
C3D_API uint32_t GetHeight () const
 Retrieves the texture image height. More...
 
C3D_API Castor::ePIXEL_FORMAT GetPixelFormat () const
 Retrieves the texture image pixel format. More...
 
C3D_API bool IsTextureInitialised () const
 Retrieves the texture initalisation status. More...
 
const Castor::Path & GetTexturePath () const
 Retrieves the texture file path. More...
 
Castor3D::TextureSPtr GetTexture () const
 Retrieves the texture. More...
 
Castor3D::eALPHA_BLEND_FUNC GetAlpFunction () const
 Retrieves the alpha blending function. More...
 
void SetAlpFunction (Castor3D::eALPHA_BLEND_FUNC p_func)
 Sets the alpha blending function. More...
 
Castor3D::eRGB_BLEND_FUNC GetRgbFunction () const
 Retrieves RGB blending function. More...
 
void SetRgbFunction (Castor3D::eRGB_BLEND_FUNC p_func)
 Sets RGB blending function. More...
 
Castor3D::eALPHA_FUNC GetAlphaFunc () const
 Retrieves the alpha function. More...
 
void SetAlphaFunc (Castor3D::eALPHA_FUNC p_func)
 Sets the alpha function. More...
 
float GetAlphaValue () const
 Retrieves the alpha reference value. More...
 
void SetAlphaValue (float p_fAlpha)
 Sets the alpha reference value. More...
 
Castor3D::eTEXTURE_CHANNEL GetChannel () const
 Retrieves the texture channel. More...
 
void SetChannel (Castor3D::eTEXTURE_CHANNEL p_channel)
 Sets the texture channel. More...
 
uint32_t GetIndex () const
 Retrieves the unit index. More...
 
void SetIndex (uint32_t p_index)
 Sets the unit index. More...
 
const Castor::Colour & GetBlendColour () const
 Retrieves the blend colour. More...
 
void SetBlendColour (const Castor::Colour &p_clrBlend)
 Sets the blend colour. More...
 
void SetRenderTarget (RenderTargetSPtr p_pTarget)
 Sets the target holding the texture. More...
 
void SetSampler (SamplerSPtr p_pSampler)
 Defines the texture sampler. More...
 
SamplerSPtr GetSampler () const
 Retrieves the texture sampler. More...
 
eBLEND_SOURCE GetRgbArgument (eBLEND_SRC_INDEX p_index) const
 Retrieves the RGB blend parameter. More...
 
void SetRgbArgument (eBLEND_SRC_INDEX p_index, eBLEND_SOURCE p_value)
 Sets the RGB blend parameter. More...
 
eBLEND_SOURCE GetAlpArgument (eBLEND_SRC_INDEX p_index) const
 Retrieves the Alpha blend parameter. More...
 
void SetAlpArgument (eBLEND_SRC_INDEX p_index, eBLEND_SOURCE p_value)
 Sets the Alpha blend parameter. More...
 
bool IsTextured () const
 Tells if the unit has a texture. More...
 
void SetAutoMipmaps (bool p_value)
 Sets the auto mipmaps generation status. More...
 
bool GetAutoMipmaps () const
 Retrieves the auto mipmaps generation status. More...
 
RenderTargetSPtr GetRenderTarget () const
 Retrieves the render target. More...
 

Friends

class TextureRenderer
 

Detailed Description

Texture unit representation.

Author
Sylvain DOREMUS
Version
0.1
Date
09/02/2010
Remarks
A texture unit is a texture with few options, like channel, blend modes, transformations.

Constructor & Destructor Documentation

◆ TextureUnit()

C3D_API Castor3D::TextureUnit::TextureUnit ( Engine p_engine)

Constructor.

Parameters
p_engineThe Engine

◆ ~TextureUnit()

C3D_API Castor3D::TextureUnit::~TextureUnit ( )

Destructor.

Member Function Documentation

◆ Bind()

C3D_API void Castor3D::TextureUnit::Bind ( ) const

Applies the texture unit.

◆ Cleanup()

C3D_API void Castor3D::TextureUnit::Cleanup ( )

Cleans up the texture.

◆ DownloadImage()

C3D_API void Castor3D::TextureUnit::DownloadImage ( bool  p_bSync)

Downloads the current image from the GPU.

Parameters
[in]p_bSyncTells if the download must be synchronous or not

◆ GetAlpArgument()

eBLEND_SOURCE Castor3D::TextureUnit::GetAlpArgument ( eBLEND_SRC_INDEX  p_index) const
inline

Retrieves the Alpha blend parameter.

Parameters
[in]p_indexThe parameter index
Returns
The value

◆ GetAlpFunction()

Castor3D::eALPHA_BLEND_FUNC Castor3D::TextureUnit::GetAlpFunction ( ) const
inline

Retrieves the alpha blending function.

Returns
The value

◆ GetAlphaFunc()

Castor3D::eALPHA_FUNC Castor3D::TextureUnit::GetAlphaFunc ( ) const
inline

Retrieves the alpha function.

Returns
The value

◆ GetAlphaValue()

float Castor3D::TextureUnit::GetAlphaValue ( ) const
inline

Retrieves the alpha reference value.

Returns
The value

◆ GetAutoMipmaps()

bool Castor3D::TextureUnit::GetAutoMipmaps ( ) const
inline

Retrieves the auto mipmaps generation status.

Returns
The value

◆ GetBlendColour()

const Castor::Colour& Castor3D::TextureUnit::GetBlendColour ( ) const
inline

Retrieves the blend colour.

Returns
The value

◆ GetChannel()

Castor3D::eTEXTURE_CHANNEL Castor3D::TextureUnit::GetChannel ( ) const
inline

Retrieves the texture channel.

Returns
The value

◆ GetHeight()

C3D_API uint32_t Castor3D::TextureUnit::GetHeight ( ) const

Retrieves the texture image height.

Returns
The height

◆ GetImageBuffer() [1/2]

C3D_API uint8_t const* Castor3D::TextureUnit::GetImageBuffer ( ) const

Retrieves the texture image buffer.

Returns
The buffer

◆ GetImageBuffer() [2/2]

C3D_API uint8_t* Castor3D::TextureUnit::GetImageBuffer ( )

Retrieves the texture image buffer.

Returns
The buffer

◆ GetImagePixels() [1/2]

C3D_API Castor::PxBufferBaseSPtr const Castor3D::TextureUnit::GetImagePixels ( ) const

Retrieves the texture image pixels.

Returns
The pixels

◆ GetImagePixels() [2/2]

C3D_API Castor::PxBufferBaseSPtr Castor3D::TextureUnit::GetImagePixels ( )

Retrieves the texture image pixels.

Returns
The pixels

◆ GetImageSize()

C3D_API uint32_t Castor3D::TextureUnit::GetImageSize ( ) const

Retrieves the texture image size (in bytes)

Returns
The size

◆ GetIndex()

uint32_t Castor3D::TextureUnit::GetIndex ( ) const
inline

Retrieves the unit index.

Returns
The value

◆ GetMappingMode()

C3D_API eTEXTURE_MAP_MODE Castor3D::TextureUnit::GetMappingMode ( ) const

Retrieves the texture mapping mode.

Returns
The texture mapping mode

◆ GetPixelFormat()

C3D_API Castor::ePIXEL_FORMAT Castor3D::TextureUnit::GetPixelFormat ( ) const

Retrieves the texture image pixel format.

Returns
The pixel format

◆ GetRenderTarget()

RenderTargetSPtr Castor3D::TextureUnit::GetRenderTarget ( ) const
inline

Retrieves the render target.

Returns
The value

◆ GetRgbArgument()

eBLEND_SOURCE Castor3D::TextureUnit::GetRgbArgument ( eBLEND_SRC_INDEX  p_index) const
inline

Retrieves the RGB blend parameter.

Parameters
[in]p_indexThe parameter index
Returns
The value

◆ GetRgbFunction()

Castor3D::eRGB_BLEND_FUNC Castor3D::TextureUnit::GetRgbFunction ( ) const
inline

Retrieves RGB blending function.

Returns
The value

◆ GetSampler()

SamplerSPtr Castor3D::TextureUnit::GetSampler ( ) const
inline

Retrieves the texture sampler.

Returns
The sampler

◆ GetTexture()

Castor3D::TextureSPtr Castor3D::TextureUnit::GetTexture ( ) const
inline

Retrieves the texture.

Returns
The value

◆ GetTexturePath()

const Castor::Path& Castor3D::TextureUnit::GetTexturePath ( ) const
inline

Retrieves the texture file path.

Returns
The value

◆ GetType()

C3D_API eTEXTURE_TYPE Castor3D::TextureUnit::GetType ( ) const

Retrieves the texture dimension.

Returns
The texture dimension

◆ GetWidth()

C3D_API uint32_t Castor3D::TextureUnit::GetWidth ( ) const

Retrieves the texture image width.

Returns
The width

◆ Initialise()

C3D_API void Castor3D::TextureUnit::Initialise ( )

Initialises the texture, id est : fills the image buffer, creates the texture in the render system.

◆ IsTextured()

bool Castor3D::TextureUnit::IsTextured ( ) const
inline

Tells if the unit has a texture.

Returns
false if the texture is null

◆ IsTextureInitialised()

C3D_API bool Castor3D::TextureUnit::IsTextureInitialised ( ) const

Retrieves the texture initalisation status.

Returns
false if the texture is null or uninitialised

◆ LoadTexture()

C3D_API bool Castor3D::TextureUnit::LoadTexture ( Castor::Path const &  p_pathFile)

Loads the texture image from the given path.

Parameters
[in]p_pathFileThe image file path
Returns
false if any problem occured

◆ SetAlpArgument()

void Castor3D::TextureUnit::SetAlpArgument ( eBLEND_SRC_INDEX  p_index,
eBLEND_SOURCE  p_value 
)
inline

Sets the Alpha blend parameter.

Parameters
[in]p_indexThe parameter index
[in]p_valueThe new value

◆ SetAlpFunction()

void Castor3D::TextureUnit::SetAlpFunction ( Castor3D::eALPHA_BLEND_FUNC  p_func)
inline

Sets the alpha blending function.

Parameters
[in]p_funcThe new value

◆ SetAlphaFunc()

void Castor3D::TextureUnit::SetAlphaFunc ( Castor3D::eALPHA_FUNC  p_func)
inline

Sets the alpha function.

Parameters
[in]p_funcThe new value

◆ SetAlphaValue()

void Castor3D::TextureUnit::SetAlphaValue ( float  p_fAlpha)
inline

Sets the alpha reference value.

Parameters
[in]p_fAlphaThe new value

◆ SetAutoMipmaps()

void Castor3D::TextureUnit::SetAutoMipmaps ( bool  p_value)
inline

Sets the auto mipmaps generation status.

Parameters
[in]p_valueThe new value

◆ SetBlendColour()

void Castor3D::TextureUnit::SetBlendColour ( const Castor::Colour &  p_clrBlend)
inline

Sets the blend colour.

Parameters
[in]p_clrBlendThe new value

◆ SetChannel()

void Castor3D::TextureUnit::SetChannel ( Castor3D::eTEXTURE_CHANNEL  p_channel)
inline

Sets the texture channel.

Parameters
[in]p_channelThe new value

◆ SetIndex()

void Castor3D::TextureUnit::SetIndex ( uint32_t  p_index)
inline

Sets the unit index.

Parameters
[in]p_indexThe new value

◆ SetMappingMode()

C3D_API void Castor3D::TextureUnit::SetMappingMode ( eTEXTURE_MAP_MODE  p_mode)

Defines the texture mapping mode.

Parameters
[in]p_modeThe texture mapping mode

◆ SetRenderTarget()

void Castor3D::TextureUnit::SetRenderTarget ( RenderTargetSPtr  p_pTarget)
inline

Sets the target holding the texture.

Parameters
[in]p_pTargetThe new value

◆ SetRgbArgument()

void Castor3D::TextureUnit::SetRgbArgument ( eBLEND_SRC_INDEX  p_index,
eBLEND_SOURCE  p_value 
)
inline

Sets the RGB blend parameter.

Parameters
[in]p_indexThe parameter index
[in]p_valueThe new value

◆ SetRgbFunction()

void Castor3D::TextureUnit::SetRgbFunction ( Castor3D::eRGB_BLEND_FUNC  p_func)
inline

Sets RGB blending function.

Parameters
[in]p_funcThe new value

◆ SetSampler()

void Castor3D::TextureUnit::SetSampler ( SamplerSPtr  p_pSampler)
inline

Defines the texture sampler.

Parameters
[in]p_pSamplerThe sampler

◆ SetTexture()

C3D_API void Castor3D::TextureUnit::SetTexture ( TextureSPtr  p_texture)

Sets the texture.

Parameters
[in]p_textureThe texture

◆ Unbind()

C3D_API void Castor3D::TextureUnit::Unbind ( ) const

Removes the texture unit from the stack, in order not to interfere with other ones.

◆ UploadImage()

C3D_API void Castor3D::TextureUnit::UploadImage ( bool  p_bSync)

Uploads current image to the GPU.

Parameters
[in]p_bSyncTells if the upload must be synchronous or not

Friends And Related Function Documentation

◆ TextureRenderer

friend class TextureRenderer
friend

The documentation for this class was generated from the following file: