U3D
Open-source, cross-platform 2D and 3D game engine built in C++
|
Base class for GPU resources. More...
#include </var/dev/u3d/stable/Source/Urho3D/Graphics/GPUObject.h>
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. | |
Graphics * | GetGraphics () const |
Return the graphics subsystem associated with this GPU object. | |
void * | GetGPUObject () const |
Return the object pointer. Applicable only on Direct3D. | |
unsigned | GetGPUObjectName () const |
Return the object name. Applicable only on OpenGL. | |
bool | IsDataLost () const |
bool | HasPendingData () const |
Return whether has pending data assigned while graphics context was lost. | |
Protected Attributes | |
WeakPtr< Graphics > | graphics_ |
Graphics subsystem. | |
GPUObjectHandle | object_ {} |
Object pointer or name. | |
bool | dataLost_ {} |
Data lost flag. | |
bool | dataPending_ {} |
Data pending flag. | |
Base class for GPU resources.
|
inline |
Return whether data is lost due to context loss.
|
virtual |
Mark the GPU resource destroyed on graphics context destruction.
Reimplemented in Urho3D::IndexBuffer, Urho3D::ShaderProgram, Urho3D::ShaderVariation, Urho3D::Texture2D, Urho3D::Texture2DArray, Urho3D::Texture3D, Urho3D::TextureCube, and Urho3D::VertexBuffer.
|
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.
|
virtual |
Unconditionally release the GPU resource.
Reimplemented in Urho3D::ConstantBuffer, Urho3D::IndexBuffer, Urho3D::ShaderProgram, Urho3D::ShaderVariation, Urho3D::Texture2D, Urho3D::Texture2DArray, Urho3D::Texture3D, Urho3D::TextureCube, and Urho3D::VertexBuffer.