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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MD3D9Renderer Class Reference

# OpenMayaRender - API module for rendering

Search for all occurrences

## Detailed Description

Access DirectX utility class.

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

Examples:

  hlslShader.cpp.

`#include <MD3D9Renderer.h>`

List of all members.

## Public Member Functions
MStatus | makeSwatchContextCurrent (unsigned int &width, unsigned int &height)
| Create a directX render target (or context) to render into for swatches.
MStatus | setBackgroundColor (const MColor &color)
| Set the back ground color of the swatch.
MStatus | readSwatchContextPixels (MImage &image)
| Reads out the current swatch context color buffer into an image format.
## Static Public Member Functions
static MD3D9Renderer * | theRenderer ()
| Returns a static pointer to the hardware renderer wrapper class.

## Member Function Documentation

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

Search for all occurrences

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

Parameters:

  [out] | width | The width of the swatch image.
  [out] | height | The height of the swatch image.

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

Examples:
  hlslShader.cpp.

MStatus setBackgroundColor | ( | const MColor & | color | ) |

Search for all occurrences

Set the back ground color of the swatch.

This clear the reading buffer as well.

Parameters:

  [in] | color | The color to which the backgorund color will be set.

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

Examples:
  hlslShader.cpp.

MStatus readSwatchContextPixels | ( | MImage & | image | ) |

Search for all occurrences

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

Parameters:

  [in] | image | The image to copy the swatch into

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

Examples:
  hlslShader.cpp.

MD3D9Renderer * theRenderer | ( |  | ) | `[static]`

Search for all occurrences

Returns a static pointer to the hardware renderer wrapper class.

Returns:
  Pointer to a MD3D9Renderer.

Examples:
  hlslShader.cpp.

MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer
MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer MD3D9Renderer