OpenGLViewportRendererPlugin.cpp
#include <stdio.h>
#include <OpenGLViewportRenderer.h>
#include <maya/MGlobal.h>
#include <maya/MString.h>
#include <maya/MStringArray.h>
#include <maya/MFnPlugin.h>
#include <stdio.h>
static OpenGLViewportRenderer *g_OpenGLRenderer = 0;
MStatus initializePlugin( MObject obj )
{
MStatus status = MStatus::kFailure;
MFnPlugin plugin( obj, PLUGIN_COMPANY, "1.0", "Any");
g_OpenGLRenderer = new OpenGLViewportRenderer();
if (g_OpenGLRenderer)
{
status = g_OpenGLRenderer->registerRenderer();
if (status != MStatus::kSuccess)
{
status.perror("Failed to register OpenGL renderer properly.");
}
}
return status;
}
MStatus uninitializePlugin( MObject obj )
{
MStatus status = MStatus::kSuccess;
if (g_OpenGLRenderer)
{
status = g_OpenGLRenderer->deregisterRenderer();
if (status != MStatus::kSuccess)
{
status.perror("Failed to deregister OpenGL renderer properly.");
}
}
g_OpenGLRenderer = 0;
return status;
}