Main Page Namespace List Class Hierarchy Alphabetical List Compound List Namespace Members Compound Members Related Pages

# PajaSystem::DeviceContextC Class Reference

Device context class. More...

`#include <DeviceContextC.h>`

List of all members.

## Public Methods

- DeviceContextC ()
- virtual ~DeviceContextC ()
- virtual DeviceInterfaceI* query_interface ( PajaTypes::int32 i32Iface )
- virtual void register_interface ( PajaTypes::int32 i32Iface, DeviceInterfaceI* pInterface )

## Detailed Description

Device context class.

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.

## Constructor & Destructor Documentation

DeviceContextC ( | )

| Default constructor. Initialises the structures used by the device context. Used internally.

~DeviceContextC ( | )`[virtual]`

| Default destructor. The destructor. Releases all resgitered interfaces. Used internally.

## Member Function Documentation

DeviceInterfaceI * query_interface ( | PajaTypes::int32 i32Iface )`[virtual]`

  | Query specified device interface. Parameters:
  i32IFace | ID of the interface to query.
Returns: Pointer to existing interface. If no interface was found the return value is NULL. This is the only method user needs to call from this class. It makes a query to the list inside the device context to see if the queried interface is available. If it is available pointer to the interface will be returned, otherwise the return value is NULL. The IDs for the interfaces are defined in the header files of the interfaces. Example:
                void
                TestEffectC::do_frame( DeviceContextC* pContext )
                {
                    OpenGLInterfaceC* pInterface = (OpenGLInterfaceC*)pContext->query_interface( INTERFACE_OPENGL );
                    if( !pInterface ) {
                        // No interface available... bail out!
                        return;
                    }
                    // do the effect...
                }

void register_interface ( | PajaTypes::int32 i32Iface,
| DeviceInterfaceI * pInterface )`[virtual]`

| Register device interface. The system uses this method internally to register device interfaces to the device context.

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

- DeviceContextC.h