Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::graphics::devices::DeviceResource Class Referenceabstract

A class that represents the base class for a hardware-based graphics device resource. More...

#include <omGraphicsDeviceResource.h>

Inheritance diagram for om::graphics::devices::DeviceResource:
om::graphics::buffers::DeviceBuffer om::graphics::materials::DeviceShader om::graphics::materials::DeviceShaderProgram om::graphics::textures::DeviceFramebuffer om::graphics::textures::DeviceTexture om::graphics::devices::opengl::OpenGLBuffer om::graphics::devices::opengl::OpenGLShader om::graphics::devices::opengl::OpenGLShaderProgram om::graphics::devices::opengl::OpenGLFramebuffer om::graphics::devices::opengl::OpenGLTexture

Public Member Functions

virtual ~DeviceResource ()
 Destroy a device object, releasing all internal state. More...
 
GraphicsContextgetContext () 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...
 

Detailed Description

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).

Constructor & Destructor Documentation

virtual om::graphics::devices::DeviceResource::~DeviceResource ( )
virtual

Destroy a device object, releasing all internal state.

om::graphics::devices::DeviceResource::DeviceResource ( GraphicsContext newContext)
protected

Create a new device object that is associated with the specified graphics context.

Member Function Documentation

GraphicsContext* om::graphics::devices::DeviceResource::getContext ( ) const
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.

virtual Bool om::graphics::devices::DeviceResource::isValid ( ) const
pure virtual

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