本文整理汇总了C++中StatePtr::add方法的典型用法代码示例。如果您正苦于以下问题:C++ StatePtr::add方法的具体用法?C++ StatePtr::add怎么用?C++ StatePtr::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatePtr
的用法示例。
在下文中一共展示了StatePtr::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: beginOcclusionQuery
void beginOcclusionQuery()
{
m_queries.resize( 0 );
m_queryNames.resize( 0 );
glClearColor( 0.0, 0.0, 0.0, 1.0 );
glClearDepth( 1.0 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
m_baseState->add( depthTestStateComponent(), true /* override */ );
}
示例2: endOcclusionQuery
void endOcclusionQuery()
{
if( m_queries.size() )
{
glEndQueryARB( GL_SAMPLES_PASSED_ARB );
}
for( size_t i = 0, e = m_queries.size(); i < e; i++ )
{
GLuint samplesPassed = 0;
glGetQueryObjectuivARB( m_queries[i], GL_QUERY_RESULT_ARB, &samplesPassed );
if( samplesPassed )
{
m_hits.push_back( HitRecord( 0, 0, m_queryNames[i] ) );
}
}
glDeleteQueriesARB( m_queries.size(), &(m_queries[0]) );
m_baseState->add( const_cast<DepthTestStateComponent *>( State::defaultState()->get<DepthTestStateComponent>() ), false /* no override */ );
}
示例3: doConversion
IECore::RunTimeTypedPtr ToGLStateConverter::doConversion( IECore::ConstObjectPtr src, IECore::ConstCompoundObjectPtr operands ) const
{
const CompoundObject *co = runTimeCast<const CompoundObject>( src.get() );
if( !co )
{
throw Exception( "Expected a CompoundObject" );
}
const AttributeToStateMap &m = attributeToStateMap();
const StatePtr result = new State( false );
for( CompoundObject::ObjectMap::const_iterator it = co->members().begin(), eIt = co->members().end(); it != eIt; ++it )
{
AttributeToStateMap::const_iterator mIt = m.find( it->first );
if( mIt != m.end() )
{
StateComponentPtr s = mIt->second( it->second.get() );
result->add( s );
}
}
return result;
}
示例4: beginIDRender
void beginIDRender()
{
m_frameBuffer = new FrameBuffer();
m_frameBuffer->setColor( new UIntTexture( 128, 128 ) );
m_frameBuffer->setDepth( new DepthTexture( 128, 128 ) );
m_frameBuffer->validate();
m_frameBufferBinding = boost::shared_ptr<FrameBuffer::ScopedBinding>( new FrameBuffer::ScopedBinding( *m_frameBuffer ) );
glGetIntegerv( GL_VIEWPORT, m_prevViewport );
glViewport( 0, 0, 128, 128 );
glClearColor( 0.0, 0.0, 0.0, 1.0 );
glClearDepth( 1.0 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
const std::vector<StateComponentPtr> &stateComponents = idStateComponents();
for( std::vector<StateComponentPtr>::const_iterator it = stateComponents.begin(), eIt = stateComponents.end(); it != eIt; it++ )
{
m_baseState->add( *it, true /* override */ );
}
glGetIntegerv( GL_CURRENT_PROGRAM, &m_prevProgram );
pushIDShader( m_baseState->get<ShaderStateComponent>()->shaderSetup()->shader() );
}