DeviceContextC
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.
Header: | DeviceContextC.h |
Library: | core.lib |
DeviceContextC();
|
Default constructor. Initialises the structures used by the device context. Used internally.
virtual ~DeviceContextC();
|
The destructor. Releases all resgitered interfaces. Used internally.
virtual DeviceInterfaceI* query_interface(
|
Pointer to existing interface. If no interface was found the return value is NULL.
This is the only method user needs to call. 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.
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...
}
virtual void register_interface(
|
The system uses this method to register device interfaces to the device context. This method is used internally.
virtual void set_name(
|
None.
Sets the name of the effect. It is not necessary to overload this member.
Copyright © 2000 Moppi Productions