You.i Engine
CYID3D11FramebufferObject Class Reference

Detailed Description

IYIGPUObject implementation for OpenGL Framebuffers.

#include <renderer/YiD3D11FramebufferObject.h>

Inheritance diagram for CYID3D11FramebufferObject:

Public Member Functions

 CYID3D11FramebufferObject (bool screenBuffer=false)
 
virtual ~CYID3D11FramebufferObject ()
 
virtual void Load (const std::shared_ptr< CYIAssetHardware > &pAsset) override
 
virtual void Unload () override
 
virtual void Use () const override
 
bool HasDepth () const
 
bool HasColor () 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 (uint32_t uSize)
 
- Public Member Functions inherited from IYIGPUObject
 IYIGPUObject ()
 
virtual ~IYIGPUObject ()
 
YI_GPU_OBJECT_STATUS GetStatus () const
 

Protected Member Functions

virtual void Generate () override
 
virtual void Free () override
 
virtual void InvalidateHandle () override
 

Protected Attributes

bool m_bHasColor
 
bool m_bHasDepth
 
bool m_bScreenBuffer
 
bool m_bPlatformSupportsDepthTextures
 
bool m_bPlatformSupportsPackedDepthStencil
 
ID3D11RenderTargetView * m_pRenderTargetView
 
ID3D11DepthStencilView * m_pDepthStencilView
 
- Protected Attributes inherited from CYID3D11AbstractBufferObject
uint32_t m_handle
 
- Protected Attributes inherited from IYIGPUObject
YI_GPU_OBJECT_STATUS m_status
 

Additional Inherited Members

- Public Types inherited from IYIGPUObject
enum  YI_GPU_OBJECT_STATUS {
  INVALID,
  UNLOADED,
  LOADED_FRESH,
  LOADED_STALE
}
 

Constructor & Destructor Documentation

CYID3D11FramebufferObject::CYID3D11FramebufferObject ( bool  screenBuffer = false)

Upon creation, a framebuffer will generate a valid handle in graphics memory

screenBuffer is a boolean flag indicating whether the framebuffer represents the screen.

virtual CYID3D11FramebufferObject::~CYID3D11FramebufferObject ( )
virtual

Upon deletion, a framebuffer will free all of its memory and invalidate its handle.

Warning
The textures contained inside the FBO are managed separately, only the FBO will be destroyed

Member Function Documentation

virtual void CYID3D11FramebufferObject::Free ( )
overrideprotectedvirtual

Deallocates the GPU memory associated with this object.

Implements IYIGPUObject.

virtual void CYID3D11FramebufferObject::Generate ( )
overrideprotectedvirtual

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

Implements IYIGPUObject.

bool CYID3D11FramebufferObject::HasColor ( ) const
bool CYID3D11FramebufferObject::HasDepth ( ) const
virtual void CYID3D11FramebufferObject::InvalidateHandle ( )
overrideprotectedvirtual

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 CYID3D11FramebufferObject::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.

virtual void CYID3D11FramebufferObject::Unload ( )
overridevirtual

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

Implements IYIGPUObject.

virtual void CYID3D11FramebufferObject::Use ( ) const
overridevirtual

Makes the GPU Object active, called by the renderer

Implements IYIGPUObject.

Member Data Documentation

bool CYID3D11FramebufferObject::m_bHasColor
protected
bool CYID3D11FramebufferObject::m_bHasDepth
protected
bool CYID3D11FramebufferObject::m_bPlatformSupportsDepthTextures
protected
bool CYID3D11FramebufferObject::m_bPlatformSupportsPackedDepthStencil
protected
bool CYID3D11FramebufferObject::m_bScreenBuffer
protected
ID3D11DepthStencilView* CYID3D11FramebufferObject::m_pDepthStencilView
protected
ID3D11RenderTargetView* CYID3D11FramebufferObject::m_pRenderTargetView
protected

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