viewOverrideTrackTexture/viewOverrideTrackTexture.h

viewOverrideTrackTexture/viewOverrideTrackTexture.h
#ifndef viewOverrideTrackTexture_h_
#define viewOverrideTrackTexture_h_
//-
// Copyright 2015 Autodesk, Inc. All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk license agreement
// provided at the time of installation or download, or which otherwise
// accompanies this software in either electronic or hard copy form.
//+
#include <maya/MString.h>
#include <maya/MViewport2Renderer.h>
#include <maya/MShaderManager.h>
#include <maya/MTextureManager.h>
//
// Simple override class derived from MRenderOverride
//
class viewOverrideTrackTexture : public MHWRender::MRenderOverride
{
public:
viewOverrideTrackTexture( const MString & name );
virtual ~viewOverrideTrackTexture();
// Basic setup and cleanup
virtual MStatus setup( const MString & destination );
virtual MStatus cleanup();
// Operation iteration methods
virtual bool startOperationIterator();
virtual bool nextRenderOperation();
// UI name
virtual MString uiName() const
{
return mUIName;
}
protected:
// UI name
MString mUIName;
// Operations and operation names
MHWRender::MRenderOperation* mOperations[2];
MString mOperationNames[2];
// Temporary of operation iteration
int mCurrentOperation;
};
//
// Image blit used to perform the 'scene render'
//
class TextureBlit : public MHWRender::MQuadRender
{
public:
TextureBlit(const MString &name);
~TextureBlit();
inline void setColorTexture(MHWRender::MTexture* texture)
{
mColorTexture.texture = texture;
mColorTextureChanged = true;
}
protected:
// Shader to use for the quad render
MHWRender::MShaderInstance *mShaderInstance;
// Texture used for the quad render. Not owned by operation.
bool mColorTextureChanged;
};
#endif