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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MRenderTargetManager Class Reference
OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013, Framework Classes, 2.4 Texture creation and texture manager, 2.5 Render Targets and Render Target Manager, 3.2 The Renderer.

Search for all occurrences

## Detailed Description

Provides access to MRenderTarget objects for use in Viewport 2.0.

This class generates MRenderTarget objects for use with MRenderOperation objects. Any MRenderTarget objects created by this class are owned by the caller.

`#include <MRenderTargetManager.h>`

List of all members.

## Public Member Functions
MRenderTarget * | acquireRenderTarget (const MRenderTargetDescription &targetDescription) const
| Acquire an instance of a render target.
MRenderTarget * | acquireRenderTargetFromScreen (const MString &targetName) const
| Acquire an instance of a render target with the same characteristics as the current on-screen target.
bool | formatSupportsSRGBWrite (MHWRender::MRasterFormat format) const
| This method will perform a check to determine whether gamma correction can be performed by the GPU when writing pixels to a render target of a given format.
void | releaseRenderTarget (MRenderTarget *target) const
| Deletes the MRenderTarget and releases the reference to the underlying target which is held by the MRenderTarget object.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Member Function Documentation

MRenderTarget * acquireRenderTarget | ( | const MRenderTargetDescription & | targetDescription | ) | const

Search for all occurrences

Acquire an instance of a render target.

When the object is no longer needed, MRenderTargetManager::releaseTarget() should be called to notify the target manager that the caller is done with the render target.

If a target with the same identifier already exists then no new target will be created as render targets cannot be instanced. A NULL value will be returned.

Parameters:

  [in] | targetDescription | Description of the target

Returns:
  A pointer to an instance of the requested target, or NULL on failure

MRenderTarget * acquireRenderTargetFromScreen | ( | const MString & | targetName | ) | const

Search for all occurrences

Acquire an instance of a render target with the same characteristics as the current on-screen target.

When the object is no longer needed, MRenderTargetManager::releaseTarget() should be called to notify the target manager that the caller is done with the render target. releaseTarget() will delete the target after which it is no longer safe to use.

If a target with the same identifier already exists then no new target will be created as render targets cannot be instanced. A NULL value will be returned.

The new target will be given the current on-screen render target properties (width, heigth, format), and will be filled by its content.

Parameters:

  [in] | targetName | Name of the target

Returns:
  A pointer to an instance of the requested target, or NULL on failure

bool formatSupportsSRGBWrite | ( | MHWRender::MRasterFormat | format | ) | const

Search for all occurrences

This method will perform a check to determine whether gamma correction can be performed by the GPU when writing pixels to a render target of a given format.

Hardware support assumes a gamma value of 2.2 which is equivalent to converting to sRGB space. Thus, the capability of the render target is often referred as supporting "sRGB write".

Parameters:

  [in] | format | Render target format to check

Returns:
  true if format supports sRGB write

void releaseRenderTarget | ( | MRenderTarget * | target | ) | const

Search for all occurrences

Deletes the MRenderTarget and releases the reference to the underlying target which is held by the MRenderTarget object.

After calling this method it is an error to try to use the MRenderTarget and attempting to do so will result in instability. The underlying target might not be deleted immediately if it is in use by the renderer.

Parameters:

  [in] | target | The target to release

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager
MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager MRenderTargetManager