MPxGlBuffer Class Reference
[OpenMayaUI - API module for user interfaceProxy classes]

#include <MPxGlBuffer.h>

List of all members.


Detailed Description

Base class for user defined GL buffers.

This is the base class for user defined GL buffers, however; it is seldom necessary to derive from this class. It is generally suficient to directly use it. In cases where creating a child class is desirable, it will only work if every overridden method calls the parent method at some point in its execution.

There are two basic ways to use this class, to draw to a pbuffer and to draw to an external window:

To draw to a pbuffer:

  1. set setDoubleBuffer() to true if a double buffered pbuffer is desired.
  2. use open() to create the pbuffer
  3. use M3dView:refresh() to have Maya draw to the pbuffer.
  4. (optionally) use attributeList(), visual(), display(), drawable() and context() to find out information about the configuration of the pbuffer or to do additional drawing to it.
  5. use close() to destroy the pbuffer

To draw to an externally defined window:

  1. set setDoubleBuffer() to true if a double buffered drawable will be used.
  2. set setUseExternalDrawable() to true
  3. (optionally) use attributeList() to get the appropriate attribute list, use the resulting list to choose a visual and call setVisual() to tell Maya about that visual.
  4. (optionally) use setDisplay() to tell Maya what display to use when creating the context
  5. create a drawable X window
  6. call setDrawable() to tell Maya about the drawable.
  7. call open() to create the context
  8. use M3dView:refresh() to have Maya draw to the window
  9. (optionally) use attributeList(), visual(), display(), drawable() and context() to find out information about the configuration of the window or to do additional drawing to it.
  10. use close() to destroy the context

Note: It is usually a good idea to use the MPxGlBuffer( M3dView &view ) form of the constructor to insure that the context created is done so correctly.

NOTE: This class only works with the Linux version of Maya.


Public Member Functions

  MPxGlBuffer ()
  MPxGlBuffer (M3dView &view)
virtual void  beginBufferNotify ()
virtual void  endBufferNotify ()
virtual MStatus  close ()

Constructor & Destructor Documentation

MPxGlBuffer::MPxGlBuffer (  ) 

Construct an MPxGlBuffer for use with the currently active view. The buffer must match the view with respect to color index or RGB mode, depth, accumulation, and alpha buffers.

MPxGlBuffer::MPxGlBuffer ( M3dView view  ) 

Construct an MPxGlBuffer for use with a specified view. The buffer must match the view with respect to color index or RGB mode, depth, accumulation, and alpha buffers.

Parameters:
[in]  view  The 3d view to assiciate with the buffer.

Member Function Documentation

void MPxGlBuffer::beginBufferNotify (  )  [virtual]

This method is called when the GL buffer is being setup by the viewport renderer. Overriding this call will allow you to access the full GL state after it has been setup but before any drawing has occurred.

If you change any state information from within this call; you must make sure you return it back to this state at the call to endBufferNotify()

Returns:
None
Status Codes:
None

void MPxGlBuffer::endBufferNotify (  )  [virtual]

This method is called when the GL buffer is being shutdown by the viewport renderer. Overriding this call will allow you to access the full GL state after drawing has completed but just before the GL buffer is shut down.

Returns:
None
Status Codes:
None

MStatus MPxGlBuffer::close (  )  [virtual]

Close and deallocate the actual pixel buffer.

Returns:
Return status
Status Codes:

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