Public Member Functions | Static Public Member Functions

MPxGlBuffer Class Reference

Search for all occurrences

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.

#include <MPxGlBuffer.h>

List of all members.

Public Member Functions

  MPxGlBuffer ()
  Construct an MPxGlBuffer for use with the currently active view.
  MPxGlBuffer (M3dView &view)
  Construct an MPxGlBuffer for use with a specified view.
virtual void  beginBufferNotify ()
  This method is called when the GL buffer is being setup by the viewport renderer.
virtual void  endBufferNotify ()
  This method is called when the GL buffer is being shutdown by the viewport renderer.
virtual MStatus  close ()
  Close and deallocate the actual pixel buffer.

Static Public Member Functions

static const char *  className ()
  Returns the name of this class.

Constructor & Destructor Documentation

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 ( 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 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 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 close ( ) [virtual]

Close and deallocate the actual pixel buffer.

Returns:
Return status
Status Codes:
const char * className ( ) [static]

Returns the name of this class.

Returns:
Name of this class.

MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer
MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer MPxGlBuffer