API Guide > Viewport 2.0 API >

# Framework Classes

The framework classes give plugins access to Maya’s internal rendering framework objects, including state and resource management, rendering context and override management.

MDrawRegistry

This is where implementations of proxy override classes must be registered against a specific node type in Maya. The same proxy may be registered against multiple node types, but each node type may only have one associated proxy class. Additional registrations override existing registrations.

MDrawContext

MDrawContext stores all draw context information for use by classes that override the actual draw (MPxDrawOverride and MPxShaderOverride). This class can be used to get and set draw state.

MStateManager

The state manager can be retrieved from the draw context instance in order to access and/or modify GPU state in an efficient and controlled manner. Although it is, of course, possible for users to modify state directly, it is recommended that all state management go through this interface. Not only does Maya attempt to optimize access to device state in order to avoid expensive read-backs and redundant state changes, using this interface also helps Maya keep track of the current state to avoid corruption.

MRenderer

This is the main interface for the Viewport 2.0 renderer. It presents interfaces for resource management as well render logic control. The renderer is a singleton object which may be accessed through MRenderer::theRenderer().

Texture Management

Textures are resources that can be acquired and released from the renderer. The main interfaces allow for acquiring a file texture from disk or creating a texture from a block of system memory. All textures are managed by the renderer. A texture is described by MTextureDescription and the list of available raster formats is described by MRasterFormat. The supported texture types are described by MTextureType and the environment mapping types by MEnvironmentMapType. It is also possible to access the device level handle of a texture to allow users to directly use the resource.

Shader Management

Some simple stock shaders, as well as CgFX shaders loaded stored in files on disk, can be acquired from the renderer through the shader manager. Access the MShaderManager class from the renderer to get access to MShaderInstance objects which can be used by MPxGeometryOverride or as a complete shader override on a render.

Target Management

MRenderTargetManager can be used to acquire render targets from the renderer for use as overrides on render operations.