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

A class that enumerates the available graphics devices for this system. More...

#include <omGraphicsDeviceManager.h>

Public Member Functions

 GraphicsDeviceManager ()
 Create a new graphics device manager which inspects the available system graphics devices. More...
 
virtual ~GraphicsDeviceManager ()
 Destroy this graphics device manager and release all associated resources. More...
 
Size getDeviceCount () const
 Return the total number of graphics devices that this manager is aware of. More...
 
Shared< GraphicsDevicegetDevice (Index deviceIndex) const
 Return a pointer to the graphics device at the specified index in the device manager. More...
 
Shared< GraphicsDevicegetDefaultDevice () const
 Return a pointer to the default graphics device for this system. More...
 
Shared< GraphicsDevicegetDeviceWithType (const GraphicsDeviceType &newType) const
 Return a pointer to the graphics device on this system with the specified device type. More...
 
virtual Bool registerDevice (const Shared< GraphicsDevice > &newDevice)
 Register the specified graphics device pointer with this device manager. More...
 

Protected Member Functions

virtual void detectDevices ()
 Detect the devices that are available on this system and add them to the device list. More...
 

Detailed Description

A class that enumerates the available graphics devices for this system.

This allows the user to pick an arbitrary GraphicsDevice and use it for rendering. For instance, the device manager might support 2 devices: one for OpenGL and another for Direct3D. The user can pick a device at run time and use it.

Constructor & Destructor Documentation

om::graphics::devices::GraphicsDeviceManager::GraphicsDeviceManager ( )

Create a new graphics device manager which inspects the available system graphics devices.

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

Destroy this graphics device manager and release all associated resources.

Member Function Documentation

Size om::graphics::devices::GraphicsDeviceManager::getDeviceCount ( ) const

Return the total number of graphics devices that this manager is aware of.

Shared<GraphicsDevice> om::graphics::devices::GraphicsDeviceManager::getDevice ( Index  deviceIndex) const

Return a pointer to the graphics device at the specified index in the device manager.

If an invalid device index is specified, a NULL pointer is returned.

Shared<GraphicsDevice> om::graphics::devices::GraphicsDeviceManager::getDefaultDevice ( ) const

Return a pointer to the default graphics device for this system.

If there are no devices present which could be the default, a NULL pointer is returned.

Shared<GraphicsDevice> om::graphics::devices::GraphicsDeviceManager::getDeviceWithType ( const GraphicsDeviceType newType) const

Return a pointer to the graphics device on this system with the specified device type.

If there are no devices present with that device type, a NULL pointer is returned.

virtual Bool om::graphics::devices::GraphicsDeviceManager::registerDevice ( const Shared< GraphicsDevice > &  newDevice)
virtual

Register the specified graphics device pointer with this device manager.

This allows the user to make the manager aware of new types of devices that it might not be aware of. The method returns whether or not the specified device was able to be registered. The method can fail if the new device pointer is NULL.

virtual void om::graphics::devices::GraphicsDeviceManager::detectDevices ( )
protectedvirtual

Detect the devices that are available on this system and add them to the device list.


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