Castor3D  ..
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::Texture Class Referenceabstract

Texture base class. More...

+ Inheritance diagram for Castor3D::Texture:
+ Collaboration diagram for Castor3D::Texture:

Public Member Functions

C3D_API Texture (eTEXTURE_BASE_TYPE p_type, RenderSystem &p_renderSystem, uint8_t p_cpuAccess, uint8_t p_gpuAccess)
 Constructor. More...
 
virtual C3D_API ~Texture ()
 Destructor. More...
 
C3D_API void SetImage (Castor::PxBufferBaseSPtr p_buffer)
 Defines the texture buffer. More...
 
C3D_API bool Bind (uint32_t p_index) const
 Activation function, to tell the GPU it is active. More...
 
C3D_API void Unbind (uint32_t p_index) const
 Deactivation function, to tell the GPU it is inactive. More...
 
virtual C3D_API bool Create ()=0
 Creation function. More...
 
virtual C3D_API void Destroy ()=0
 Destruction function. More...
 
virtual C3D_API bool Initialise ()=0
 Initialisation function. More...
 
virtual C3D_API void Cleanup ()=0
 Cleanup function. More...
 
virtual C3D_API uint8_t * Lock (uint32_t p_lock)=0
 Locks image buffer from GPU, allowing modifications into it. More...
 
virtual C3D_API void Unlock (bool p_modified)=0
 Unlocks image buffer from GPU. More...
 
virtual C3D_API void GenerateMipmaps () const =0
 Generate texture mipmaps. More...
 
bool IsInitialised () const
 Retrieves the initialisation status. More...
 
eTEXTURE_BASE_TYPE GetBaseType () const
 Retrieves the texture type. More...
 
eTEXTURE_TYPE GetType () const
 Retrieves the texture dimension. More...
 
void SetType (eTEXTURE_TYPE p_dimension)
 Defines the texture dimension. More...
 
eTEXTURE_MAP_MODE GetMappingMode () const
 Retrieves the texture mapping mode. More...
 
void SetMappingMode (eTEXTURE_MAP_MODE p_eMapMode)
 Defines the texture mapping mode. More...
 
Castor::Size GetDimensions () const
 Retrieves the texture image dimensions. More...
 
uint32_t GetDepth () const
 Retrieves the texture depth. More...
 
Castor::ePIXEL_FORMAT GetPixelFormat () const
 Retrieves the texture pixel format. More...
 
uint32_t GetWidth () const
 Retrieves the texture image width. More...
 
uint32_t GetHeight () const
 Retrieves the texture image height. More...
 
Castor::PxBufferBaseSPtr GetBuffer () const
 Retrieves the texture buffer. More...
 

Protected Member Functions

virtual C3D_API bool DoInitialise ()=0
 API specific initialisation function. More...
 
virtual C3D_API bool DoBind (uint32_t p_index) const =0
 API specific binding function. More...
 
virtual C3D_API void DoUnbind (uint32_t p_index) const =0
 API specific unbinding function. More...
 
 DECLARE_VECTOR (Castor::PxBufferBaseSPtr, PxBuffer)
 

Protected Attributes

bool m_initialised
 Initialisation status. More...
 
eTEXTURE_BASE_TYPE m_baseType
 Texture base type. More...
 
eTEXTURE_TYPE m_type
 Texture type. More...
 
eTEXTURE_MAP_MODE m_mapMode
 Texture mapping modes. More...
 
uint32_t m_depth
 3D Texture depth More...
 
Castor::PxBufferBaseSPtr m_pixelBuffer
 Texture pixels, at least at initialisation. More...
 
Castor::ePIXEL_FORMAT m_pixelFormat
 The pixel buffer format. More...
 
Castor::Size m_size
 The pixel buffer dimensions. More...
 
uint8_t m_cpuAccess
 The required CPU access (combination of eACCESS_TYPE). More...
 
uint8_t m_gpuAccess
 The required GPU access (combination of eACCESS_TYPE). More...
 

Detailed Description

Texture base class.

Author
Sylvain DOREMUS
Date
14/02/2010

Constructor & Destructor Documentation

◆ Texture()

C3D_API Castor3D::Texture::Texture ( eTEXTURE_BASE_TYPE  p_type,
RenderSystem p_renderSystem,
uint8_t  p_cpuAccess,
uint8_t  p_gpuAccess 
)

Constructor.

Parameters
[in]p_typeThe texture type.
[in]p_renderSystemThe render system.
[in]p_cpuAccessThe required CPU access (combination of eACCESS_TYPE).
[in]p_gpuAccessThe required GPU access (combination of eACCESS_TYPE).

◆ ~Texture()

virtual C3D_API Castor3D::Texture::~Texture ( )
virtual

Destructor.

Member Function Documentation

◆ Bind()

C3D_API bool Castor3D::Texture::Bind ( uint32_t  p_index) const

Activation function, to tell the GPU it is active.

Parameters
[in]p_indexThe texture index
Returns
true if successful

◆ Cleanup()

virtual C3D_API void Castor3D::Texture::Cleanup ( )
pure virtual

Cleanup function.

Implemented in Castor3D::StaticTexture, and Castor3D::DynamicTexture.

◆ Create()

virtual C3D_API bool Castor3D::Texture::Create ( )
pure virtual

Creation function.

Returns
true if OK

◆ DECLARE_VECTOR()

Castor3D::Texture::DECLARE_VECTOR ( Castor::PxBufferBaseSPtr  ,
PxBuffer   
)
protected

◆ Destroy()

virtual C3D_API void Castor3D::Texture::Destroy ( )
pure virtual

Destruction function.

◆ DoBind()

virtual C3D_API bool Castor3D::Texture::DoBind ( uint32_t  p_index) const
protectedpure virtual

API specific binding function.

Returns
if OK

◆ DoInitialise()

virtual C3D_API bool Castor3D::Texture::DoInitialise ( )
protectedpure virtual

API specific initialisation function.

Returns
true if OK.

◆ DoUnbind()

virtual C3D_API void Castor3D::Texture::DoUnbind ( uint32_t  p_index) const
protectedpure virtual

API specific unbinding function.

◆ GenerateMipmaps()

virtual C3D_API void Castor3D::Texture::GenerateMipmaps ( ) const
pure virtual

Generate texture mipmaps.

◆ GetBaseType()

eTEXTURE_BASE_TYPE Castor3D::Texture::GetBaseType ( ) const
inline

Retrieves the texture type.

Returns
The texture type

References m_baseType.

◆ GetBuffer()

Castor::PxBufferBaseSPtr Castor3D::Texture::GetBuffer ( ) const
inline

Retrieves the texture buffer.

Returns
The buffer

References m_pixelBuffer.

◆ GetDepth()

uint32_t Castor3D::Texture::GetDepth ( ) const
inline

Retrieves the texture depth.

Returns
The depth, 1 if not 3D

References m_depth.

◆ GetDimensions()

Castor::Size Castor3D::Texture::GetDimensions ( ) const
inline

Retrieves the texture image dimensions.

Returns
The image dimensions

References GetHeight(), and GetWidth().

+ Here is the call graph for this function:

◆ GetHeight()

uint32_t Castor3D::Texture::GetHeight ( ) const
inline

Retrieves the texture image height.

Returns
The height

References m_depth, m_pixelBuffer, and m_size.

Referenced by GetDimensions().

+ Here is the caller graph for this function:

◆ GetMappingMode()

eTEXTURE_MAP_MODE Castor3D::Texture::GetMappingMode ( ) const
inline

Retrieves the texture mapping mode.

Returns
The texture mapping mode

References m_mapMode.

◆ GetPixelFormat()

Castor::ePIXEL_FORMAT Castor3D::Texture::GetPixelFormat ( ) const
inline

Retrieves the texture pixel format.

Returns
The pixel format

References m_pixelBuffer, and m_pixelFormat.

◆ GetType()

eTEXTURE_TYPE Castor3D::Texture::GetType ( ) const
inline

Retrieves the texture dimension.

Returns
The texture dimension

References m_type.

◆ GetWidth()

uint32_t Castor3D::Texture::GetWidth ( ) const
inline

Retrieves the texture image width.

Returns
The width

References m_pixelBuffer, and m_size.

Referenced by GetDimensions().

+ Here is the caller graph for this function:

◆ Initialise()

virtual C3D_API bool Castor3D::Texture::Initialise ( )
pure virtual

Initialisation function.

Returns
true if OK.

Implemented in Castor3D::StaticTexture, and Castor3D::DynamicTexture.

◆ IsInitialised()

bool Castor3D::Texture::IsInitialised ( ) const
inline

Retrieves the initialisation status.

Returns
The initialisation status

References m_initialised.

◆ Lock()

virtual C3D_API uint8_t* Castor3D::Texture::Lock ( uint32_t  p_lock)
pure virtual

Locks image buffer from GPU, allowing modifications into it.

Parameters
[in]p_lockDefines the lock mode (r, w, rw), combination of eACCESS_TYPE
Returns
The image buffer

◆ SetImage()

C3D_API void Castor3D::Texture::SetImage ( Castor::PxBufferBaseSPtr  p_buffer)

Defines the texture buffer.

Parameters
[in]p_bufferThe buffer

◆ SetMappingMode()

void Castor3D::Texture::SetMappingMode ( eTEXTURE_MAP_MODE  p_eMapMode)
inline

Defines the texture mapping mode.

Parameters
[in]p_eMapModeThe texture mapping mode

References m_mapMode.

◆ SetType()

void Castor3D::Texture::SetType ( eTEXTURE_TYPE  p_dimension)
inline

Defines the texture dimension.

Parameters
[in]p_dimensionThe texture dimension

References m_type.

◆ Unbind()

C3D_API void Castor3D::Texture::Unbind ( uint32_t  p_index) const

Deactivation function, to tell the GPU it is inactive.

Parameters
[in]p_indexThe texture index

◆ Unlock()

virtual C3D_API void Castor3D::Texture::Unlock ( bool  p_modified)
pure virtual

Unlocks image buffer from GPU.

Parameters
[in]p_modifiedTells if the buffer has been modified, so modifications are uploaded to GPU

Member Data Documentation

◆ m_baseType

eTEXTURE_BASE_TYPE Castor3D::Texture::m_baseType
protected

Texture base type.

Referenced by GetBaseType().

◆ m_cpuAccess

uint8_t Castor3D::Texture::m_cpuAccess
protected

The required CPU access (combination of eACCESS_TYPE).

◆ m_depth

uint32_t Castor3D::Texture::m_depth
protected

3D Texture depth

Referenced by GetDepth(), and GetHeight().

◆ m_gpuAccess

uint8_t Castor3D::Texture::m_gpuAccess
protected

The required GPU access (combination of eACCESS_TYPE).

◆ m_initialised

bool Castor3D::Texture::m_initialised
protected

Initialisation status.

Referenced by IsInitialised().

◆ m_mapMode

eTEXTURE_MAP_MODE Castor3D::Texture::m_mapMode
protected

Texture mapping modes.

Referenced by GetMappingMode(), and SetMappingMode().

◆ m_pixelBuffer

Castor::PxBufferBaseSPtr Castor3D::Texture::m_pixelBuffer
protected

Texture pixels, at least at initialisation.

Referenced by GetBuffer(), GetHeight(), GetPixelFormat(), and GetWidth().

◆ m_pixelFormat

Castor::ePIXEL_FORMAT Castor3D::Texture::m_pixelFormat
protected

The pixel buffer format.

Referenced by GetPixelFormat().

◆ m_size

Castor::Size Castor3D::Texture::m_size
protected

The pixel buffer dimensions.

Referenced by GetHeight(), and GetWidth().

◆ m_type

eTEXTURE_TYPE Castor3D::Texture::m_type
protected

Texture type.

Referenced by GetType(), and SetType().


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