Urho3D
Public Member Functions | Protected Attributes | List of all members
Urho3D::GPUObject Class Reference

Base class for GPU resources. More...

#include </home/runner/work/rurho3d.github.io/rurho3d.github.io/urho3d_repo/Source/Urho3D/GraphicsAPI/GPUObject.h>

Inheritance diagram for Urho3D::GPUObject:
Urho3D::ConstantBuffer Urho3D::IndexBuffer Urho3D::ShaderProgram_OGL Urho3D::ShaderVariation Urho3D::Texture Urho3D::VertexBuffer Urho3D::Texture2D Urho3D::Texture2DArray Urho3D::Texture3D Urho3D::TextureCube

Public Member Functions

 GPUObject (Graphics *graphics)
 Construct with graphics subsystem pointer.
 
virtual ~GPUObject ()
 Destruct. Remove from the Graphics.
 
virtual void OnDeviceLost ()
 Mark the GPU resource destroyed on graphics context destruction. More...
 
virtual void OnDeviceReset ()
 Recreate the GPU resource and restore data if applicable. More...
 
virtual void Release ()
 Unconditionally release the GPU resource. More...
 
void ClearDataLost ()
 Clear the data lost flag.
 
GraphicsGetGraphics () const
 Return the graphics subsystem associated with this GPU object.
 
void * GetGPUObject () const
 Return the object pointer. Applicable only on Direct3D.
 
u32 GetGPUObjectName () const
 Return the object name. Applicable only on OpenGL.
 
bool IsDataLost () const
 Return whether data is lost due to context loss.
 
bool HasPendingData () const
 Return whether has pending data assigned while graphics context was lost.
 

Protected Attributes

WeakPtr< Graphicsgraphics_
 Graphics subsystem.
 
GPUObjectHandle object_ {}
 Object pointer or name.
 
bool dataLost_ {}
 Data lost flag.
 
bool dataPending_ {}
 Data pending flag.
 

Detailed Description

Base class for GPU resources.

Member Function Documentation

◆ OnDeviceLost()

void Urho3D::GPUObject::OnDeviceLost ( )
virtual

◆ OnDeviceReset()

void Urho3D::GPUObject::OnDeviceReset ( )
virtual

Recreate the GPU resource and restore data if applicable.

Reimplemented in Urho3D::ConstantBuffer, Urho3D::IndexBuffer, Urho3D::Texture2D, Urho3D::Texture2DArray, Urho3D::Texture3D, Urho3D::TextureCube, and Urho3D::VertexBuffer.

◆ Release()

void Urho3D::GPUObject::Release ( )
virtual

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