#include <DeviceContextC.h>
Public Methods | |
DeviceContextC () | |
Default constructor. | |
virtual | ~DeviceContextC () |
Default destructor. | |
virtual DeviceInterfaceI * | query_interface (const PluginClass::ClassIdC &rClassId) |
Query specified device interface. | |
virtual DeviceInterfaceI * | query_interface (const PluginClass::SuperClassIdC &rSClassId) |
Queries an interface based on super class ID. | |
virtual void | register_interface (DeviceInterfaceI *pInterface) |
Register device interface. | |
virtual void | unregister_interface (const PluginClass::ClassIdC &rClassId) |
Unregister device interface. | |
virtual PajaTypes::uint32 | get_interface_count () const |
Returns number of interfaces in the device context. | |
virtual DeviceInterfaceI * | get_interface (PajaTypes::uint32 ui32Index) |
Returns specified interface. |
The purpose of the device context class is to gather all the device interfaces available to the effects. The interfaces may range from renderin APIs (such as OpenGL, or Direct3D) to music system APIs. The interface holds just enough information to use the API and some helper methods to help the use of the API under the editor. Device context simply holds these interfaces. These interfaces can be queried from the context.
This class is implemented by the system.
|
Default constructor. Initialises the structures used by the device context. Used internally. |
|
Default destructor. The destructor. Releases all resgitered interfaces. Used internally. |
|
Returns specified interface.
|
|
Returns number of interfaces in the device context.
|
|
Queries an interface based on super class ID. Example:
... GraphicsDeviceI* pGraphDevice = (GraphicsDeviceI*)pContext->query_interface( SUPERCLASS_GRAPHICSDEVICE ); ... |
|
Query specified device interface.
The class IDs for the interfaces are defined in the header files of the interfaces. Example: void TestEffectC::do_frame( DeviceContextC* pContext ) { // Get the OpenGL device. OpenGLDeviceC* pDevice = (OpenGLDeviceC*)pContext->query_interface( CLASS_OPENGL_DEVICEDRIVER ); if( !pDevice ) { // No device available... bail out! return; } // do the effect... } |
|
Register device interface. The system (or the Demopaja player) uses this method internally to register device interfaces to the device context. |
|
Unregister device interface. The system (or the Demopaja player) uses this method internally to register device interfaces to the device context. |