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

A class that represents an interface to a graphics device driver. More...

#include <omGraphicsDevice.h>

Inheritance diagram for om::graphics::devices::GraphicsDevice:
om::graphics::devices::opengl::OpenGLDevice

Public Member Functions

virtual ~GraphicsDevice ()
 Destroy a graphics device, releasing all of its resources and internal state. More...
 
virtual Shared< GraphicsContextcreateContext (const RenderedPixelFormat &pixelFormat, const GraphicsContextFlags &flags)=0
 Create a new context for this graphics device with the specified framebuffer pixel format and flags. More...
 
virtual Shared< GraphicsContextcreateContext (const RenderedPixelFormat &pixelFormat, const GraphicsContextFlags &flags, const Shared< GraphicsContext > &sharedContext)=0
 Create a new context with shared resources for this graphics device with the specified framebuffer pixel format and flags. More...
 
virtual Bool checkFormat (RenderedPixelFormat &pixelFormat, GraphicsContextFlags &flags, Bool strict=false) const =0
 Return whether or not the specified pixel format and flags are supported by this device. More...
 
virtual GraphicsDeviceType getType () const =0
 Return an object that indicates the type of this graphics device. More...
 

Detailed Description

A class that represents an interface to a graphics device driver.

Specialized implementations inherit from this interface to provide a way to provide uniform access to their underlying drivers.

Constructor & Destructor Documentation

virtual om::graphics::devices::GraphicsDevice::~GraphicsDevice ( )
inlinevirtual

Destroy a graphics device, releasing all of its resources and internal state.

Member Function Documentation

virtual Shared<GraphicsContext> om::graphics::devices::GraphicsDevice::createContext ( const RenderedPixelFormat pixelFormat,
const GraphicsContextFlags flags 
)
pure virtual

Create a new context for this graphics device with the specified framebuffer pixel format and flags.

This method chooses a pixel format for the context which most closely matches the specified pixel format and flags. A pointer to the created context is returned. If the returned pointer is NULL, the context creation failed.

Implemented in om::graphics::devices::opengl::OpenGLDevice.

virtual Shared<GraphicsContext> om::graphics::devices::GraphicsDevice::createContext ( const RenderedPixelFormat pixelFormat,
const GraphicsContextFlags flags,
const Shared< GraphicsContext > &  sharedContext 
)
pure virtual

Create a new context with shared resources for this graphics device with the specified framebuffer pixel format and flags.

The new context is able to use resources from the specified shared context. This method chooses a pixel format for the context which most closely matches the specified pixel format and flags. A pointer to the created context is returned. If the returned pointer is NULL, the context creation failed.

Implemented in om::graphics::devices::opengl::OpenGLDevice.

virtual Bool om::graphics::devices::GraphicsDevice::checkFormat ( RenderedPixelFormat pixelFormat,
GraphicsContextFlags flags,
Bool  strict = false 
) const
pure virtual

Return whether or not the specified pixel format and flags are supported by this device.

If they are supported as-is, the method returns TRUE indicating that the format is supported by this device.

If the format is not entirely supported but can be approximated (i.e. different bit depth) and the strict flag is not set, the supported format which most closely matches the specified format is written to the output pixel format and flags. TRUE is returned.

Otherwise, if the format cannot be approximated or if the strict flag is set, FALSE is returned indicating that the format is not supported. This means that creating a device context with these settings would fail.

Implemented in om::graphics::devices::opengl::OpenGLDevice.

virtual GraphicsDeviceType om::graphics::devices::GraphicsDevice::getType ( ) const
pure virtual

Return an object that indicates the type of this graphics device.

Implemented in om::graphics::devices::opengl::OpenGLDevice.


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