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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# MRenderTarget Class Reference
OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Devkit サンプル.

Search for all occurrences

## Detailed Description

Information to perform rendering into a hardware render target.

MRenderTarget is a class contains information about a given hardware render target.

Examples:

  D3DViewportRenderer.cpp, and OpenGLViewportRenderer.cpp.

`#include <MRenderTarget.h>`

List of all members.

## Public Member Functions
unsigned int | width () const
| Width of render target in pixels.
unsigned int | height () const
| Height of render target in pixels.
void | makeTargetCurrent () const
| Make the render target current for rendering.
MStatus | writeColorBuffer (const MImage &image, signed short x=0, signed short y=0, bool writeDepth=false) const
| Write a 2d image directly to the color buffer, without any transformation.
## Friends Search for all occurrences
class | MHardwareRenderer Search for all occurrences
class | MRenderingInfo Search for all occurrences

## Member Function Documentation

unsigned int width | ( |  | ) | const

Search for all occurrences

Width of render target in pixels.

Return the width in pixels of the render target.

Returns:
  Width value.

Examples:
  D3DViewportRenderer.cpp, and OpenGLViewportRenderer.cpp.

unsigned int height | ( |  | ) | const

Search for all occurrences

Height of render target in pixels.

Return the height in pixels of the render target.

Returns:
  Height value.

Examples:
  D3DViewportRenderer.cpp, and OpenGLViewportRenderer.cpp.

MStatus writeColorBuffer | ( | const MImage & | image,
|  | signed short | x = `0`,
|  | signed short | y = `0`,
|  | bool | writeDepth = `false`
| ) |  | const

Search for all occurrences

Write a 2d image directly to the color buffer, without any transformation.

Method will make the context current if it is not already.

If a depth component in the image also exists, then depth values can also be written to.

Parameters:

  [in] | image | an MImage 2d image
  [in] | x | lower left corner x position in the target to place the image. Default value is 0.
  [in] | y | lower left corner y position in the target to place the image Default value is 0.
  [in] | writeDepth | write the depth component of the incoming image to the depth component of the render target. If image does not contain any depth component then nothing will be written. Default value is false.

Returns:
  MStatus::kSuccess if successful.

Examples:
  D3DViewportRenderer.cpp.

MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget
MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget MRenderTarget