C++ API Reference

Historically this class was used to created offscreen buffers on Linux. More...

#include <MPxGlBuffer.h>

Public Member Functions

 MPxGlBuffer ()
 Construct an MPxGlBuffer for use with the currently active view. More...
 
 MPxGlBuffer (M3dView &view)
 Construct an MPxGlBuffer for use with a specified view. More...
 
MStatus openFbo (short width, short height, M3dView &)
 Create a frame buffer object where the renderer result will be stored. More...
 
MStatus closeFbo (M3dView &)
 Destroy a frame buffer object that was created by createFbo. More...
 
MStatus bindFbo ()
 If a frame buffer object was created using the method openFbo, then this method can be used to bind that Fbo. More...
 
MStatus unbindFbo ()
 If a frame buffer object was created using the method openFbo, then this method can be used to unbind that Fbo. More...
 
virtual void beginBufferNotify ()
 This method is called when the GL buffer is being setup by the viewport renderer. More...
 
virtual void endBufferNotify ()
 This method is called when the GL buffer is being shutdown by the viewport renderer. More...
 

Static Public Member Functions

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

Detailed Description

Historically this class was used to created offscreen buffers on Linux.

This class is now using FBO. Invoke openFbo() method to create a Frame Buffer Object. 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().

This method is obsolete. [from before Maya 2016]

Deprecated:
Use MHWRender::MRenderOverride and MHWRender::MRenderTarget instead.

Constructor & Destructor Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN 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]viewThe 3d view to assiciate with the buffer.

Member Function Documentation

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

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]widthwidth of the buffer to create
[in]heightheight of the buffer to create
[in]viewM3dView 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)

Destroy a frame buffer object that was created by createFbo.

Parameters
[in]viewM3dView 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 ( )

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

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

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
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files: