C++ API Reference
MD3D9Renderer Class Reference

MD3D9Renderer is a wrapper class to provide access to Maya's DirectX resources. More...

#include <MD3D9Renderer.h>

Public Member Functions

MStatus makeSwatchContextCurrent (unsigned int &width, unsigned int &height)
 Create a directX render target (or context) to render into for swatches. More...
 
MStatus setBackgroundColor (const MColor &color)
 Set the back ground color of the swatch. More...
 
MStatus readSwatchContextPixels (MImage &image)
 Reads out the current swatch context color buffer into an image format. More...
 

Static Public Member Functions

static MD3D9RenderertheRenderer ()
 Returns a static pointer to the hardware renderer wrapper class. More...
 

Detailed Description

MD3D9Renderer is a wrapper class to provide access to Maya's DirectX resources.

Examples:
hlslShader/hlslShader.cpp.

Member Function Documentation

MStatus makeSwatchContextCurrent ( unsigned int &  width,
unsigned int &  height 
)

Create a directX render target (or context) to render into for swatches.

Parameters
[out]widthThe width of the swatch image.
[out]heightThe height of the swatch image.
Returns
  • MS::kSuccess The method was successful.
  • MS::kFailure An error has occurred.
Examples:
hlslShader/hlslShader.cpp.
MStatus setBackgroundColor ( const MColor color)

Set the back ground color of the swatch.

This clear the reading buffer as well.

Parameters
[in]colorThe color to which the backgorund color will be set.
Returns
  • MS::kSuccess The method was successful.
  • MS::kFailure An error has occurred.
Examples:
hlslShader/hlslShader.cpp.
MStatus readSwatchContextPixels ( MImage image)

Reads out the current swatch context color buffer into an image format.

Parameters
[in]imageThe image to copy the swatch into
Returns
  • MS::kSuccess The method was successful.
  • MS::kFailure An error has occurred.
Examples:
hlslShader/hlslShader.cpp.
MD3D9Renderer * theRenderer ( )
static

Returns a static pointer to the hardware renderer wrapper class.

Returns
Pointer to a MD3D9Renderer.
Examples:
hlslShader/hlslShader.cpp.

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