class MD3D9Renderer

Jump to documentation

Access DirectX utility class (OpenMayaRender) (OpenMayaRender.py)

public members:

MStatus makeSwatchContextCurrent (unsigned int& width, unsigned int& height)
MStatus setBackgroundColor (const MColor & color)
MStatus readSwatchContextPixels ( MImage & image)
IDirect3DDevice9* getD3D9Device ()

Documentation

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

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

Functions

IDirect3DDevice9 * MD3D9Renderer:: getD3D9Device ()

Description

Get Maya's DirectX 9 D3D device (pointer to a IDirect3DDevice9). This method will always return NULL if called from a non Microsoft Windows platform.

Arguments

  • None.

Return Value

  • Pointer to a D3D9 device, or NULL if it is not available.

MD3D9Renderer * MD3D9Renderer:: theRenderer ()

Description Returns a static pointer to the hardware renderer wrapper class.

Arguments

  • None.

Return Value

  • Pointer to a MD3D9Renderer.

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

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

Arguments

  • The width and height of the swatch image.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An error has occurred.

MStatus MD3D9Renderer:: setBackgroundColor ( const MColor & color)

Description Set the back ground color of the swatch. This clear the reading buffer as well. Arguments

  • The color to which the backgorund color will be set.

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An error has occurred.

MStatus MD3D9Renderer:: readSwatchContextPixels ( MImage & image )

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

Arguments

  • The image to copy the swatch into

Return Value

  • MS::kSuccess The method was successful.
  • MS::kFailure An error has occurred.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright