当前位置: 首页>>代码示例>>C++>>正文


C++ VertexBufferState::getDisplayList方法代码示例

本文整理汇总了C++中VertexBufferState::getDisplayList方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexBufferState::getDisplayList方法的具体用法?C++ VertexBufferState::getDisplayList怎么用?C++ VertexBufferState::getDisplayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VertexBufferState的用法示例。


在下文中一共展示了VertexBufferState::getDisplayList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawBoundingSphere

void VertexBufferBase::drawBoundingSphere(VertexBufferState& state ) const
{
    GLuint displayList = state.getDisplayList( &_boundingSphere );

    if( displayList == state.INVALID )
    {
        displayList = state.newDisplayList( &_boundingSphere );
        glNewList( displayList, GL_COMPILE );

        const float x  = _boundingSphere.x();
        const float y  = _boundingSphere.y();
        const float z  = _boundingSphere.z();
        const float x1 = x - _boundingSphere.w();
        const float x2 = x + _boundingSphere.w();
        const float y1 = y - _boundingSphere.w();
        const float y2 = y + _boundingSphere.w();
        const float z1 = z - _boundingSphere.w();
        const float z2 = z + _boundingSphere.w();
        const float size = _boundingSphere.w();

        glBegin( GL_QUADS );
            glNormal3f( 1.0f, 0.0f, 0.0f );
            glVertex3f( x1, y - size, z - size );
            glVertex3f( x1, y + size, z - size );
            glVertex3f( x1, y + size, z + size );
            glVertex3f( x1, y - size, z + size );
            glNormal3f( -1.0f, 0.0f, 0.0f );
            glVertex3f( x2, y - size, z - size );
            glVertex3f( x2, y - size, z + size );
            glVertex3f( x2, y + size, z + size );
            glVertex3f( x2, y + size, z - size );

            glNormal3f( 0.0f, -1.0f, 0.0f );
            glVertex3f( x - size, y2, z - size );
            glVertex3f( x + size, y2, z - size );
            glVertex3f( x + size, y2, z + size );
            glVertex3f( x - size, y2, z + size );
            glNormal3f( 0.0f, 1.0f, 0.0f );
            glVertex3f( x - size, y1, z - size );
            glVertex3f( x - size, y1, z + size );
            glVertex3f( x + size, y1, z + size );
            glVertex3f( x + size, y1, z - size );

            glNormal3f( 0.0f, 0.0f, -1.0f );
            glVertex3f( x - size, y - size, z2 );
            glVertex3f( x - size, y + size, z2 );
            glVertex3f( x + size, y + size, z2 );
            glVertex3f( x + size, y - size, z2 );
            glNormal3f( 0.0f, 0.0f, 1.0f );
            glVertex3f( x - size, y - size, z1 );
            glVertex3f( x + size, y - size, z1 );
            glVertex3f( x + size, y + size, z1 );
            glVertex3f( x - size, y + size, z1 );
        glEnd();

        glEndList();
    }

    glCallList( displayList );
}
开发者ID:Angels-group,项目名称:Equalizer,代码行数:60,代码来源:vertexBufferBase.cpp

示例2: renderDisplayList

/*  Render the leaf with a display list.  */
inline
void VertexBufferLeaf::renderDisplayList( VertexBufferState& state ) const
{
    char* key = (char*)( this );
    if( state.useColors( ))
        ++key;

    GLuint displayList = state.getDisplayList( key );

    if( displayList == state.INVALID )
        setupRendering( state, &displayList );
    
    glCallList( displayList );
}
开发者ID:MichaelVlad,项目名称:Equalizer,代码行数:15,代码来源:vertexBufferLeaf.cpp


注:本文中的VertexBufferState::getDisplayList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。