本文整理汇总了C++中ViewerNodePtr::isCheckerboardEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ ViewerNodePtr::isCheckerboardEnabled方法的具体用法?C++ ViewerNodePtr::isCheckerboardEnabled怎么用?C++ ViewerNodePtr::isCheckerboardEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewerNodePtr
的用法示例。
在下文中一共展示了ViewerNodePtr::isCheckerboardEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rectClippedToRoI
//.........这里部分代码省略.........
polygonMode = eDrawPolygonModeWhole;
}
}
if (polygonMode == eDrawPolygonModeWhole) {
const double pixelCenterOffset = 0.5;
// draw vertices at the center of the first and last pixel in the texture, with the same texture coordinates
rectClippedToRoI.x1 += pixelCenterOffset * par;
rectClippedToRoI.x2 -= pixelCenterOffset * par;
rectClippedToRoI.y1 += pixelCenterOffset;
rectClippedToRoI.y2 -= pixelCenterOffset;
///Vertices are in canonical coords
GLfloat vertices[32] = {
(GLfloat)rod.left(), (GLfloat)rod.top(), //0
(GLfloat)(rectClippedToRoI.x1 + pixelCenterOffset), (GLfloat)rod.top(), //1
(GLfloat)(rectClippedToRoI.x2 - pixelCenterOffset), (GLfloat)rod.top(), //2
(GLfloat)rod.right(), (GLfloat)rod.top(), //3
(GLfloat)rod.left(), (GLfloat)(rectClippedToRoI.y2 - pixelCenterOffset), //4
(GLfloat)rectClippedToRoI.x1, (GLfloat)rectClippedToRoI.y2, //5
(GLfloat)rectClippedToRoI.x2, (GLfloat)rectClippedToRoI.y2, //6
(GLfloat)rod.right(), (GLfloat)rectClippedToRoI.y2, //7
(GLfloat)rod.left(), (GLfloat)rectClippedToRoI.y1, //8
(GLfloat)rectClippedToRoI.x1, (GLfloat)rectClippedToRoI.y1, //9
(GLfloat)rectClippedToRoI.x2, (GLfloat)rectClippedToRoI.y1, //10
(GLfloat)rod.right(), (GLfloat)rectClippedToRoI.y1, //11
(GLfloat)rod.left(), (GLfloat)rod.bottom(), //12
(GLfloat)rectClippedToRoI.x1, (GLfloat)rod.bottom(), //13
(GLfloat)rectClippedToRoI.x2, (GLfloat)rod.bottom(), //14
(GLfloat)rod.right(), (GLfloat)rod.bottom() //15
};
GLfloat texBottom = (GLfloat)(rectClippedToRoI.y1 - canonicalRoIRoundedToTileSize.y1) / canonicalRoIRoundedToTileSize.height();
GLfloat texTop = (GLfloat)(rectClippedToRoI.y2 - canonicalRoIRoundedToTileSize.y1) / canonicalRoIRoundedToTileSize.height();
GLfloat texLeft = (GLfloat)(rectClippedToRoI.x1 - canonicalRoIRoundedToTileSize.x1) / canonicalRoIRoundedToTileSize.width();
GLfloat texRight = (GLfloat)(rectClippedToRoI.x2 - canonicalRoIRoundedToTileSize.x1) / canonicalRoIRoundedToTileSize.width();
GLfloat renderingTextureCoordinates[32] = {
texLeft, texTop, //0
texLeft, texTop, //1
texRight, texTop, //2
texRight, texTop, //3
texLeft, texTop, //4
texLeft, texTop, //5
texRight, texTop, //6
texRight, texTop, //7
texLeft, texBottom, //8
texLeft, texBottom, //9
texRight, texBottom, //10
texRight, texBottom, //11
texLeft, texBottom, // 12
texLeft, texBottom, //13
texRight, texBottom, //14
texRight, texBottom //15
};
if ( background && internalNode->isCheckerboardEnabled() && (polygonMode != eDrawPolygonModeWipeRight) ) {
bool isblend = GL_GPU::IsEnabled(GL_BLEND);
if (isblend) {
GL_GPU::Disable(GL_BLEND);
}
this->drawCheckerboardTexture(rod);
if (isblend) {
GL_GPU::Enable(GL_BLEND);
}
}
assert(displayTextures[textureIndex].texture);
GL_GPU::ActiveTexture(GL_TEXTURE0);
GL_GPU::GetIntegerv(GL_TEXTURE_BINDING_2D, (GLint*)&prevBoundTexture);
GL_GPU::BindTexture( GL_TEXTURE_2D, displayTextures[textureIndex].texture->getTexID() );
glCheckError(GL_GPU);
GL_GPU::BindBuffer(GL_ARRAY_BUFFER, this->vboVerticesId);
GL_GPU::BufferSubData(GL_ARRAY_BUFFER, 0, 32 * sizeof(GLfloat), vertices);
GL_GPU::EnableClientState(GL_VERTEX_ARRAY);
GL_GPU::VertexPointer(2, GL_FLOAT, 0, 0);
GL_GPU::BindBuffer(GL_ARRAY_BUFFER, this->vboTexturesId);
GL_GPU::BufferSubData(GL_ARRAY_BUFFER, 0, 32 * sizeof(GLfloat), renderingTextureCoordinates);
GL_GPU::ClientActiveTexture(GL_TEXTURE0);
GL_GPU::EnableClientState(GL_TEXTURE_COORD_ARRAY);
GL_GPU::TexCoordPointer(2, GL_FLOAT, 0, 0);
GL_GPU::DisableClientState(GL_COLOR_ARRAY);
GL_GPU::BindBuffer(GL_ARRAY_BUFFER, 0);
GL_GPU::BindBuffer(GL_ELEMENT_ARRAY_BUFFER, this->iboTriangleStripId);
GL_GPU::DrawElements(GL_TRIANGLE_STRIP, 28, GL_UNSIGNED_BYTE, 0);
glCheckErrorIgnoreOSXBug(GL_GPU);
GL_GPU::BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
GL_GPU::DisableClientState(GL_VERTEX_ARRAY);
GL_GPU::DisableClientState(GL_TEXTURE_COORD_ARRAY);
GL_GPU::BindTexture( GL_TEXTURE_2D, prevBoundTexture);
glCheckError(GL_GPU);
}
} // drawRenderingVAO