Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents the base class for a hardware-based graphics device resource. More...
#include <omGraphicsDeviceResource.h>
Public Member Functions | |
virtual | ~DeviceResource () |
Destroy a device object, releasing all internal state. More... | |
GraphicsContext * | getContext () const |
Return a pointer to the graphics context associated with this DeviceResource. More... | |
virtual Bool | isValid () const =0 |
Return whether or not the state of this device resource is valid and able to be used for rendering. More... | |
Protected Member Functions | |
DeviceResource (GraphicsContext *newContext) | |
Create a new device object that is associated with the specified graphics context. More... | |
A class that represents the base class for a hardware-based graphics device resource.
Examples of types that should inherit from DeviceResource: textures, hardware-based buffer objects, shader objects, framebuffers, etc.
This class exists to provide a common interface for all hardware-based objects to access the device that is associated with them. A device object can be resident in either CPU memory, GPU memory, or both. The upload() and download() methods move resource data to and from the GPU device.
A device object is associated with a graphics device which must be valid in order for the device object to be used for rendering.
A device object cannot be directly copied (it has a private copy constructor and assignment operator).
|
virtual |
Destroy a device object, releasing all internal state.
|
protected |
Create a new device object that is associated with the specified graphics context.
|
inline |
Return a pointer to the graphics context associated with this DeviceResource.
This is the context that created this object. The object cannot be used with any other context. This pointer is mainly used by contexts to make sure that this resource is associated with the same context that is trying to use it.
|
pure virtual |
Return whether or not the state of this device resource is valid and able to be used for rendering.
Implemented in om::graphics::devices::opengl::OpenGLTexture, om::graphics::devices::opengl::OpenGLBuffer, om::graphics::devices::opengl::OpenGLShaderProgram, om::graphics::devices::opengl::OpenGLFramebuffer, and om::graphics::devices::opengl::OpenGLShader.