IYIGPUObject implementation for DirectFB textures.
#include <renderer/YiD3D11TextureObject.h>
| CYID3D11TextureObject::CYID3D11TextureObject |
( |
| ) |
|
Upon creation, a texture object will generate a valid handle in graphics memory
| virtual CYID3D11TextureObject::~CYID3D11TextureObject |
( |
| ) |
|
|
virtual |
Upon deletion, a texture object will free all of its memory and invalidate its handle
| void CYID3D11TextureObject::Bind |
( |
uint32_t |
slot = 0 | ) |
const |
| void CYID3D11TextureObject::Configure |
( |
int32_t |
width, |
|
|
int32_t |
height, |
|
|
int32_t |
format, |
|
|
int32_t |
type |
|
) |
| |
Parameters used are identical to those used for OpenGL's glTexImage2D(). Direct3D equivalents are implemented.
| virtual void CYID3D11TextureObject::Free |
( |
| ) |
|
|
overridevirtual |
Deallocates the GPU memory associated with this object.
Implements IYIGPUObject.
| virtual void CYID3D11TextureObject::Generate |
( |
| ) |
|
|
overridevirtual |
Generates a valid handle. No GPU memory is allocated until Load() is called.
Implements IYIGPUObject.
| ID3D11Texture2D* CYID3D11TextureObject::GetDirect3D11Texture |
( |
| ) |
const |
|
inline |
| ID3D11ShaderResourceView* CYID3D11TextureObject::GetResourceView |
( |
| ) |
const |
|
inline |
| virtual void CYID3D11TextureObject::InvalidateHandle |
( |
| ) |
|
|
overridevirtual |
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.
- Warning
- 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.
| virtual void CYID3D11TextureObject::Load |
( |
const std::shared_ptr< CYIAssetHardware > & |
pHWAsset | ) |
|
|
overridevirtual |
Loads the software data from the associated CYIAsset into graphics memory. If the YI_GPU_OBJECT_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 YI_GPU_OBJECT_STATUS documentation for more details.
Implements IYIGPUObject.
| void CYID3D11TextureObject::SetDX11Texture |
( |
ID3D11Texture2D * |
pTexture, |
|
|
ID3D11ShaderResourceView * |
pResourceView |
|
) |
| |
| void CYID3D11TextureObject::SetIsRenderTarget |
( |
bool |
bRenderTarget | ) |
|
| virtual void CYID3D11TextureObject::Unload |
( |
| ) |
|
|
overridevirtual |
Frees any previously loaded data from video memory, but retains the handle.
Implements IYIGPUObject.
| virtual void CYID3D11TextureObject::Use |
( |
| ) |
const |
|
overridevirtual |
Makes the GPU Object active, called by the renderer
Implements IYIGPUObject.
The documentation for this class was generated from the following file: