本文整理汇总了C++中Viewport::getColourWrite方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::getColourWrite方法的具体用法?C++ Viewport::getColourWrite怎么用?C++ Viewport::getColourWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::getColourWrite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mDefinition
CompositorPass::CompositorPass( const CompositorPassDef *definition, const CompositorChannel &target,
CompositorNode *parentNode ) :
mDefinition( definition ),
mTarget( 0 ),
mViewport( 0 ),
mNumPassesLeft( definition->mNumInitialPasses ),
mParentNode( parentNode ),
mTargetTexture( IdString(), &target.textures ),
mNumValidResourceTransitions( 0 )
{
assert( definition->mNumInitialPasses && "Definition is broken, pass will never execute!" );
mTarget = calculateRenderTarget( mDefinition->getRtIndex(), target );
//TODO: Merging RenderTarget & Texture in a refactor would get rid of these missmatches
//between a "target" and a "texture" in mTargetTexture.
if( !target.textures.empty() )
mTargetTexture.name = IdString( target.textures[0]->getName() );
const Real EPSILON = 1e-6f;
CompositorWorkspace *workspace = mParentNode->getWorkspace();
uint8 workspaceVpMask = workspace->getViewportModifierMask();
bool applyModifier = (workspaceVpMask & mDefinition->mViewportModifierMask) != 0;
Vector4 vpModifier = applyModifier ? workspace->getViewportModifier() : Vector4( 0, 0, 1, 1 );
Real left = mDefinition->mVpLeft + vpModifier.x;
Real top = mDefinition->mVpTop + vpModifier.y;
Real width = mDefinition->mVpWidth * vpModifier.z;
Real height = mDefinition->mVpHeight * vpModifier.w;
Real scLeft = mDefinition->mVpScissorLeft + vpModifier.x;
Real scTop = mDefinition->mVpScissorTop + vpModifier.y;
Real scWidth = mDefinition->mVpScissorWidth * vpModifier.z;
Real scHeight = mDefinition->mVpScissorHeight * vpModifier.w;
const unsigned short numViewports = mTarget->getNumViewports();
for( unsigned short i=0; i<numViewports && !mViewport; ++i )
{
Viewport *vp = mTarget->getViewport(i);
if( Math::Abs( vp->getLeft() - left ) < EPSILON &&
Math::Abs( vp->getTop() - top ) < EPSILON &&
Math::Abs( vp->getWidth() - width ) < EPSILON &&
Math::Abs( vp->getHeight() - height )<EPSILON &&
Math::Abs( vp->getScissorLeft() - scLeft ) < EPSILON &&
Math::Abs( vp->getScissorTop() - scTop ) < EPSILON &&
Math::Abs( vp->getScissorWidth() - scWidth ) < EPSILON &&
Math::Abs( vp->getScissorHeight() - scHeight )<EPSILON &&
vp->getColourWrite() == mDefinition->mColourWrite &&
vp->getReadOnlyDepth() == mDefinition->mReadOnlyDepth &&
vp->getReadOnlStencil() == mDefinition->mReadOnlyStencil &&
vp->getOverlaysEnabled() == mDefinition->mIncludeOverlays )
{
mViewport = vp;
}
}
if( !mViewport )
{
mViewport = mTarget->addViewport( left, top, width, height );
mViewport->setScissors( scLeft, scTop, scWidth, scHeight );
mViewport->setColourWrite( mDefinition->mColourWrite );
mViewport->setReadOnly( mDefinition->mReadOnlyDepth, mDefinition->mReadOnlyStencil );
mViewport->setOverlaysEnabled( mDefinition->mIncludeOverlays );
}
populateTextureDependenciesFromExposedTextures();
}