You.i Engine
CYIGNMFramebufferObject Class Reference

#include <renderer/YiGNMFramebufferObject.h>

Inheritance diagram for CYIGNMFramebufferObject:

Public Member Functions

 CYIGNMFramebufferObject (bool screenBuffer=false)
virtual ~CYIGNMFramebufferObject ()
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
void Sync () const
void Clear (float r, float g, float b, float a)
void ClearDepth ()
- Public Member Functions inherited from CYIGNMAbstractBufferObject
 CYIGNMAbstractBufferObject (int32_t handle)
virtual ~CYIGNMAbstractBufferObject ()
virtual void SetTarget (uint32_t target)
uint32_t GetTarget () const
virtual uint32_t GetHandle ()
- Public Member Functions inherited from IYIGPUObject
 IYIGPUObject ()
virtual ~IYIGPUObject ()
Status GetStatus () const

Protected Member Functions

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ CYIGNMFramebufferObject()

CYIGNMFramebufferObject::CYIGNMFramebufferObject ( bool  screenBuffer = false)

◆ ~CYIGNMFramebufferObject()

virtual CYIGNMFramebufferObject::~CYIGNMFramebufferObject ( )

Member Function Documentation

◆ Clear()

void CYIGNMFramebufferObject::Clear ( float  r,
float  g,
float  b,
float  a 

◆ ClearDepth()

void CYIGNMFramebufferObject::ClearDepth ( )

◆ Free()

virtual void CYIGNMFramebufferObject::Free ( )

Deallocates the GPU memory associated with this object.

Implements IYIGPUObject.

◆ Generate()

virtual void CYIGNMFramebufferObject::Generate ( )

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

Implements IYIGPUObject.

◆ HasColor()

bool CYIGNMFramebufferObject::HasColor ( ) const

◆ HasDepth()

bool CYIGNMFramebufferObject::HasDepth ( ) const

◆ InvalidateHandle()

virtual void CYIGNMFramebufferObject::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 CYIGNMFramebufferObject::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.

◆ Sync()

void CYIGNMFramebufferObject::Sync ( ) const

This needs to be called before binding a texture that is also used as a Render Target. We have to make sure the previous rendering to that Render Target has been completed before binding the texture.

◆ Unload()

virtual void CYIGNMFramebufferObject::Unload ( )

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

Implements IYIGPUObject.

◆ Use()

virtual void CYIGNMFramebufferObject::Use ( ) const

Makes the GPU Object active, called by the renderer

Implements IYIGPUObject.

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