#include
<MViewportRenderer.h>
MViewportRenderer is a class which represents a hardware viewport renderer.
Public Types |
|
enum | RenderingAPI { kOpenGL, kDirect3D, kSoftware } |
API used for rendering. More... |
|
enum | RenderingOverride { kNoOverride, kOverrideAllDrawing } |
Override status. More... |
|
Public Member Functions |
|
MViewportRenderer (const MString &name) | |
Constructor. |
|
virtual | ~MViewportRenderer () |
Destructor. |
|
virtual MStatus | initialize ()=0 |
Renderer initialization. Must be overridden.
|
|
virtual MStatus | uninitialize ()=0 |
Renderer de-initialization. Must be
overridden. |
|
virtual MStatus | render (const MRenderingInfo &info)=0 |
Rendering method. Must be overridden.
|
|
virtual bool | nativelySupports (MViewportRenderer::RenderingAPI api, float version)=0 |
virtual bool | override (MViewportRenderer::RenderingOverride override)=0 |
Check if override exists. |
|
MStatus | registerRenderer () const |
MStatus | deregisterRenderer () const |
const MString & | name () const |
const MString & | UIname () const |
void | setUIName (const MString &name) |
MViewportRenderer::RenderingOverride | renderingOverride () const |
void | setRenderingOverride (RenderingOverride override) |
Friends |
|
class | MHardwareRenderer |
MViewportRenderer::MViewportRenderer | ( | const MString & | name | ) |
Constructor.
Constructor. By default the user interface name is set to be the internal name. The user is free to change the UI. The internal name cannot be changed once set.
[in] | name | internal name of the renderer |
MViewportRenderer::~MViewportRenderer | ( | ) | [virtual] |
Destructor.
Class destructor.
MStatus MViewportRenderer::initialize | ( | ) | [pure virtual] |
Renderer initialization. Must be overridden.
This method gets called to allow the renderer to perform a one time initialization. The corresponding method for cleanup is uninitialize().
Initialization is called if and only if the renderer has been registered. See register() method.
MStatus MViewportRenderer::uninitialize | ( | ) | [pure virtual] |
Renderer de-initialization. Must be overridden.
This method gets called to allow the renderer to perform a one time de-initialization. The corresponding method for cleanup is initialize().
MStatus MViewportRenderer::render | ( | const MRenderingInfo & | info | ) | [pure virtual] |
Rendering method. Must be overridden.
This method gets called to allow the renderer to perform rendering. It will be called whenever the viewport to which it is registered, requires a refresh.
bool MViewportRenderer::nativelySupports | ( | MViewportRenderer::RenderingAPI | api, | |
float | version | |||
) | [pure virtual] |
Query the native rendering API's supported by this renderer. Must be overridden.
Query the renderer to see if the renderer can natively support a specific API and API version number. This is to provide compatibility checks between the drawing API used for the render target of this renderer, and the renderer itself.
As an example the render target may be using OpenGL natively while the renderer associated with the render target is using Direct3D. In this case the method should return false.
As an example the render target may be using Direct3D version K natively while the renderer associated with the render target is using Direct3D version L. In this case the method may return false.
[in] | api | rendering API natively used by the render target |
[in] | version | rendering API version of the API natively used by the render target |
bool MViewportRenderer::override | ( | MViewportRenderer::RenderingOverride | override | ) | [pure virtual] |
Check if override exists.
This method gets called to query the renderer to see if it has a given type of render target override.
[in] | override | render target override |
MStatus MViewportRenderer::registerRenderer | ( | ) | const |
Register the renderer. Registration should occur when the plugin is initialized. A renderer will be available for usage from 3d modeling viewports if and only if it has been registered.
Additionally, the initialization method initialize() will be made only if a renderer has been registered.
MStatus MViewportRenderer::deregisterRenderer | ( | ) | const |
Deregister the renderer. Deregistration should occur when the plugin is unloaded.
const MString & MViewportRenderer::name | ( | ) | const |
Return the internal name of the renderer
const MString & MViewportRenderer::UIname | ( | ) | const |
Return the user interface name of the renderer
void MViewportRenderer::setUIName | ( | const MString & | name | ) |
Set the user interface name of the renderer.
[in] | name | name to set |
MViewportRenderer::RenderingOverride MViewportRenderer::renderingOverride | ( | ) | const |
Get the rendering API version number
void MViewportRenderer::setRenderingOverride | ( | RenderingOverride | override | ) |
Set the rendering override for the renderer.
[in] | override | override value to set |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |