本文整理汇总了C++中CGeometry::getNumOfIndices方法的典型用法代码示例。如果您正苦于以下问题:C++ CGeometry::getNumOfIndices方法的具体用法?C++ CGeometry::getNumOfIndices怎么用?C++ CGeometry::getNumOfIndices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGeometry
的用法示例。
在下文中一共展示了CGeometry::getNumOfIndices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: glBindBuffer
void CWin32Renderer::draw(CRenderable* pRenderable)
{
if (pRenderable && pRenderable->canBeRendered())
{
const GLuint vboId = (GLuint)pRenderable->get1DParam(VBO0_ID);
const GLuint iboId = (GLuint)pRenderable->get1DParam(IBO0_ID);
if (vboId && iboId)
{
glBindBuffer(GL_ARRAY_BUFFER, vboId);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, iboId);
///@todo: implement in renderable, add the argument that defines the environment
pRenderable->setEnvironment(); // Renderable-specific changes of the OpenGL environment: switch depth on/off etc.
CGeometry* pGeometry = pRenderable->getGeometry();
CShader* pShader = pRenderable->getShader();
if (pGeometry && pShader)
{
pShader->setup(*pRenderable);
if (mIsDebugMode && pRenderable->getFlag(eShaderFlags::DRAW_LINES))
{
glLineWidth(pRenderable->get1DParam(eShader1DParams::LINE_WIDTH));
glDrawElements(GL_LINES, pGeometry->getNumOfIndices(), GL_UNSIGNED_INT, 0);
}
else
{
glDrawElements(GL_TRIANGLE_STRIP, pGeometry->getNumOfIndices(), GL_UNSIGNED_INT, 0);
}
}
// Return to the initial OpenGL state.
pRenderable->resetEnvironment();
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glBindTexture(GL_TEXTURE_2D, 0);
}
}
}