MRenderTargetManager Class Reference

#include <MRenderTargetManager.h>

Class Description

Public Member Functions

MRenderTargetacquireRenderTarget (const MRenderTargetDescription &targetDescription) const
 Acquire an instance of a render target. More...
 
MRenderTargetacquireRenderTargetFromScreen (const MString &targetName) const
 Acquire an instance of a render target with the same characteristics as the current on-screen target. More...
 
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. More...
 
void releaseRenderTarget (MRenderTarget *target) const
 Deletes the MRenderTarget and releases the reference to the underlying target which is held by the MRenderTarget object. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Member Function Documentation

MRenderTarget * acquireRenderTarget ( const MRenderTargetDescription targetDescription) const

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]targetDescriptionDescription of the target
Returns
A pointer to an instance of the requested target, or NULL on failure
+ Examples:
MRenderTarget * acquireRenderTargetFromScreen ( const MString targetName) const

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]targetNameName of the target
Returns
A pointer to an instance of the requested target, or NULL on failure
+ Examples:
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.

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]formatRender target format to check
Returns
true if format supports sRGB write
+ Examples:
void releaseRenderTarget ( MRenderTarget target) const

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]targetThe target to release
+ Examples:
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files:
  • MRenderTargetManager.h
  • MRenderTargetManager.cpp