Public Member Functions | Static Public Member Functions

MPxGlBuffer Class Reference

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

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