#include "hwRendererHelper.h"
#include "hwApiTextureTestStrings.h"
#include <maya/MViewport2Renderer.h>
#include <maya/MTextureManager.h>
#include <maya/MRenderTargetManager.h>
#include <maya/MGlobal.h>
#include "hwRendererHelperGL.h"
#ifdef _WIN32
#include "hwRendererHelperDX.h"
#endif
: fRenderer(renderer)
{
}
hwRendererHelper::~hwRendererHelper()
{
}
{
hwRendererHelper* helper = NULL;
{
helper = new hwRendererHelperGL(renderer);
}
#if defined( _WIN32)
else
{
helper = new hwRendererHelperDX(renderer, dxDevice);
}
#endif
return helper;
}
{
if(targetManager == NULL)
{
return NULL;
}
if(textureManager == NULL)
{
return NULL;
}
if(onScreenRenderTarget == NULL)
{
return NULL;
}
int rowPitch = 0;
size_t slicePitch = 0;
char* targetData = (
char*)onScreenRenderTarget->
rawData(rowPitch, slicePitch);
if(targetData != NULL)
{
delete targetData;
}
return texture;
}
{
if(targetManager == NULL)
{
return false;
}
1 ,
false );
if(renderTarget == NULL)
return false;
bool result = false;
if( renderTextureToTarget(texture, renderTarget) )
{
result = fRenderer->copyTargetToScreen( renderTarget );
}
return result;
}