You.i Engine
CYID3D11TextureObject Class Reference

Detailed Description

IYIGPUObject implementation for DirectFB textures.

#include <renderer/YiD3D11TextureObject.h>

Inheritance diagram for CYID3D11TextureObject:

Public Member Functions

 CYID3D11TextureObject ()
virtual ~CYID3D11TextureObject ()
virtual void Load (const std::shared_ptr< CYIAssetHardware > &pAsset) override
virtual void Unload () override
virtual void Use () const override
virtual void Generate () override
virtual void Free () override
virtual void InvalidateHandle () override
void Configure (size_t width, size_t height, IYIMaterialFactory::ColorSpace format, IYIMaterialFactory::TextureType type)
ID3D11Texture2D * GetDirect3D11Texture () const
ID3D11ShaderResourceView * GetResourceView () const
void SetDX11Texture (ID3D11Texture2D *pTexture, ID3D11ShaderResourceView *pResourceView)
void ReconfigureWrapMode (CYIAssetTextureBase::WrapMode wrapS, CYIAssetTextureBase::WrapMode wrapT)
void SetIsRenderTarget (bool renderTarget)
void Bind (uint32_t slot=0) const
- Public Member Functions inherited from CYID3D11AbstractBufferObject
 CYID3D11AbstractBufferObject (int32_t handle)
virtual ~CYID3D11AbstractBufferObject ()
virtual uint32_t GetHandle ()
- Public Member Functions inherited from CYIBufferObject
 CYIBufferObject ()
virtual ~CYIBufferObject ()
virtual void * Map ()
virtual void Unmap (size_t size)
- Public Member Functions inherited from IYIGPUObject
 IYIGPUObject ()
virtual ~IYIGPUObject ()
Status GetStatus () const


class CYID3D11FramebufferObject

Additional Inherited Members

- Public Types inherited from IYIGPUObject
enum  Status {
- Protected Attributes inherited from CYID3D11AbstractBufferObject
uint32_t m_handle
- Protected Attributes inherited from IYIGPUObject
Status m_status

Constructor & Destructor Documentation

◆ CYID3D11TextureObject()

CYID3D11TextureObject::CYID3D11TextureObject ( )

Upon creation, a texture object will generate a valid handle in graphics memory

◆ ~CYID3D11TextureObject()

virtual CYID3D11TextureObject::~CYID3D11TextureObject ( )

Upon deletion, a texture object will free all of its memory and invalidate its handle

Member Function Documentation

◆ Bind()

void CYID3D11TextureObject::Bind ( uint32_t  slot = 0) const

◆ Configure()

void CYID3D11TextureObject::Configure ( size_t  width,
size_t  height,
IYIMaterialFactory::ColorSpace  format,
IYIMaterialFactory::TextureType  type 

Parameters used are identical to those used for OpenGL's glTexImage2D(). Direct3D equivalents are implemented.

◆ Free()

virtual void CYID3D11TextureObject::Free ( )

Deallocates the GPU memory associated with this object.

Implements IYIGPUObject.

◆ Generate()

virtual void CYID3D11TextureObject::Generate ( )

Generates a valid handle. No GPU memory is allocated until Load() is called.

Implements IYIGPUObject.

◆ GetDirect3D11Texture()

ID3D11Texture2D* CYID3D11TextureObject::GetDirect3D11Texture ( ) const

◆ GetResourceView()

ID3D11ShaderResourceView* CYID3D11TextureObject::GetResourceView ( ) const

◆ InvalidateHandle()

virtual void CYID3D11TextureObject::InvalidateHandle ( )

This function can be called to invalidate the buffer handle without freeing the associated memory.

This can be used if the GL context is lost and GPU memory is freed implicitly. Calling Free() on this object will result in a crash if the handle is no longer pointing to valid memory, and a new handle may not be created with Generate() if the current handle is valid. This function allows you to inform the buffer object that the GL data has been freed externally and that the handle should be disconnected.

Calling this function without being sure that the handle has been freed in GPU memory will result in a memory leak. Use at your own risk.

Implements IYIGPUObject.

◆ Load()

virtual void CYID3D11TextureObject::Load ( const std::shared_ptr< CYIAssetHardware > &  pHWAsset)

Loads the software data from the associated CYIAsset into graphics memory. If the Status is LOADED_FRESH upon a call to load, meaning that data was previously successfully loaded, the status may become LOADED_STALE in the case where this load failed. See the Status documentation for more details.

Implements IYIGPUObject.

◆ ReconfigureWrapMode()

void CYID3D11TextureObject::ReconfigureWrapMode ( CYIAssetTextureBase::WrapMode  wrapS,
CYIAssetTextureBase::WrapMode  wrapT 

Reconfigures the current texture's wrap modes.

The change takes effect after the texture has been bound. If the texture is already bound, it must be rebound for the new mode to take effect.

◆ SetDX11Texture()

void CYID3D11TextureObject::SetDX11Texture ( ID3D11Texture2D *  pTexture,
ID3D11ShaderResourceView *  pResourceView 

◆ SetIsRenderTarget()

void CYID3D11TextureObject::SetIsRenderTarget ( bool  renderTarget)

◆ Unload()

virtual void CYID3D11TextureObject::Unload ( )

Frees any previously loaded data from video memory, but retains the handle.

Implements IYIGPUObject.

◆ Use()

virtual void CYID3D11TextureObject::Use ( ) const

Makes the GPU Object active, called by the renderer

Implements IYIGPUObject.

Friends And Related Function Documentation

◆ CYID3D11FramebufferObject

friend class CYID3D11FramebufferObject

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