MHwrCallback Class Reference
[OpenMayaRender - API module for rendering]

#include <MHwrCallback.h>

List of all members.


Detailed Description

Rendering Callbacks.

This class is used to register callbacks to gain access to Maya's Hardware Rendering device status. You can be notified of device creation, lost reset and deletion.

To register callbacks, inherit from this class and override deviceNew, deviceLost, deviceReset, deviceDeleted. Any number of these methods can be overridden by the callback. Then register the callbacks by calling the addCallback() method.

If multiple callbacks need to be registered, the order of invocation can be set by adding each callback with a priority number, 0 being the highest priority.

Examples:

hlslShader.cpp, and hlslShader.h.


Public Member Functions

  MHwrCallback ()
virtual  ~MHwrCallback ()
virtual void  deviceNew ()
virtual void  deviceLost ()
virtual void  deviceReset ()
virtual void  deviceDeleted ()

Static Public Member Functions

static void  addCallback (MHwrCallback *, int priority=0)
static void  removeCallback (MHwrCallback *)

Constructor & Destructor Documentation

MHwrCallback::MHwrCallback (  ) 

Default Constructor

MHwrCallback::~MHwrCallback (  )  [virtual]

Default Destructor


Member Function Documentation

void MHwrCallback::deviceNew (  )  [virtual]

Method to override for being notified of new device creation

Examples:

void MHwrCallback::deviceLost (  )  [virtual]

Method to override for being notified of device Lost.

Examples:

void MHwrCallback::deviceReset (  )  [virtual]

Method to override for being notified of device Reset.

Examples:

void MHwrCallback::deviceDeleted (  )  [virtual]

Method to override for being notified of device Deletion.

Examples:

void MHwrCallback::addCallback ( MHwrCallback callback,
int  priority = 0  
) [static]

Static procedure to add a rendering callback. The callbacks are stored internally in a sorted list and are invoked following the appropriate device state change depending on which methods are overridden. Adding the same callback more than once will have no effect.

Parameters:
[in]  callback  object to add to the list of callbacks to invoke
[in]  priority  priority for this callback, lower priorities are invoked first
Examples:

void MHwrCallback::removeCallback ( MHwrCallback callback  )  [static]

Static procedure to remove a rendering callback. The callback will be removed from the list of callbacks, but its up to the client to actually delete the object. Unstability may result if a callback is deleted and not removed from the callback list.Removing an un-installed callback will have no effect.

Parameters:
[in]  callback  object to remove from the list of callbacks
Examples:

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6