- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MPxGlBuffer Class Reference
OpenMayaUI - API module for user interface | Proxy classes

Search for all occurrences

## Detailed Description

Base class for user defined GL buffers.

Historically this class was used to created offscreen buffers on Linux. Users should refrain from using this class in the traditional pbuffer use case outlined in the deprecated section below as results may be undefined. Instead users should not override any of the function call below and simply invoke openFbo() method. The contents of the frame buffer object (FBO) can be read back by using the bindFbo() method and OpenGl calls to read pixels. After rendering and reading pixels, the frame buffer object can be destroyed by calling closeFbo(). The blastCmd API example has been updated to illustrate how to render offscreen.

Note, by using a frame buffer object it is now possible to utilize this class in on non-Linux platforms.

Using this class in pbuffer or externally defined window is DEPRECATED.

`#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.
MStatus | openFbo (short width, short height, M3dView &)
| Create a frame buffer object where the renderer result will be stored.
MStatus | closeFbo (M3dView &)
| Destroy a frame buffer object that was created by createFbo.
MStatus | bindFbo ()
| If a frame buffer object was created using the method openFbo, then this method can be used to bind that Fbo.
MStatus | unbindFbo ()
| If a frame buffer object was created using the method openFbo, then this method can be used to unbind that Fbo.
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

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 | ( | 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

MStatus openFbo | ( | short | width,
|  | short | height,
|  | M3dView & | view
| ) |  |

Search for all occurrences

Create a frame buffer object where the renderer result will be stored.

The format of this buffer will be RGBA. Note only one of these offscreen buffers should exist.

Parameters:

  [in] | width | width of the buffer to create
  [in] | height | height of the buffer to create
  [in] | view | M3dView handle to create an offscreen buffer.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure a frame buffer object could not be created.

MStatus closeFbo | ( | M3dView & | view | ) |

Search for all occurrences

Destroy a frame buffer object that was created by createFbo.

Parameters:

  [in] | view | M3dView handle to create an offscreen buffer.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure a frame buffer object could not be destroyed.

MStatus bindFbo | ( |  | ) |

Search for all occurrences

If a frame buffer object was created using the method openFbo, then this method can be used to bind that Fbo.

When the buffer is bound, all OpenGL draw calls will render into the created buffer.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure a frame buffer object does not exist or is already bound.

MStatus unbindFbo | ( |  | ) |

Search for all occurrences

If a frame buffer object was created using the method openFbo, then this method can be used to unbind that Fbo.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure a frame buffer object does not exist.

void beginBufferNotify | ( |  | ) | `[virtual]`

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

Close and deallocate the actual pixel buffer.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure Error closing the buffer.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

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