本文整理汇总了C++中CBlock::getDisplayLists方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlock::getDisplayLists方法的具体用法?C++ CBlock::getDisplayLists怎么用?C++ CBlock::getDisplayLists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlock
的用法示例。
在下文中一共展示了CBlock::getDisplayLists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
//.........这里部分代码省略.........
{
blockVisible++;
block->updateTexture(delta);
lavaWater = (block->isLava() || block->isWater());
if (lavaWater)
{
atManager->updateBlock(block);
}
renderedBlocks.push_back(block);
// draw block objects
if (block->getBlockObjects()->size()>0)
{
for (std::vector<CBlockObject*>::iterator rmIter = block->getBlockObjects()->begin(); rmIter != block->getBlockObjects()->end(); rmIter++)
{
CBlockObject *bObj = *rmIter;
bObj->moveTo();
glRotatef(bObj->getRotateY(),0.0f,1.0f,0.0f);
bObj->drawModel(delta);
glRotatef(-bObj->getRotateY(),0.0f,1.0f,0.0f);
bObj->moveBack();
}
}
bool isRoom = block->isRoom();
if (isRoom)
{
std::vector<GLuint> *dls = block->getDisplayLists();
if (dls->size()!=0)
{
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,textureAtlasColor);
glBegin(GL_QUADS);
{
for (std::vector<GLuint>::iterator dlIter = dls->begin(); dlIter != dls->end(); dlIter++)
{
glCallList(*dlIter);
}
}
glEnd();
glDisable(GL_TEXTURE_2D);
}
}
for (GLint f=CBlock::BFS_FRONT; f<=CBlock::BFS_CEILING; f++)
{
if ((!isFPS && f==CBlock::BFS_CEILING) || (isFPS && f==CBlock::BFS_TOP) || (isRoom && f!=CBlock::BFS_CEILING))
{
continue;
}
if (block->isFaceVisible((CBlock::BLOCK_FACE_SELECTOR)f))
{
verts = block->getVertices();
texCoords = block->getTextureCoordinates((CBlock::BLOCK_FACE_SELECTOR)f);
if (lavaWater && f<=CBlock::BFS_RIGHT)
{
/*
Lava and water have only lowers row of wall sections drawn.