本文整理汇总了C++中OpenGLTexture::enable方法的典型用法代码示例。如果您正苦于以下问题:C++ OpenGLTexture::enable方法的具体用法?C++ OpenGLTexture::enable怎么用?C++ OpenGLTexture::enable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenGLTexture
的用法示例。
在下文中一共展示了OpenGLTexture::enable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: texCoordOffset
void BbqGeoRefdTerrainRenderer<HeightType,
HeightDeltaType,
TextureType >::activateTextures(
const BbqTerrNode *node,
DrawEnv *pEnv)
{
// Profile( activateTextures );
Vec2f texCoordOffset( 0, 0 );
Vec2f texCoordScale( 1.0f / float( _oDatabaseInfo.heightTileSize - 1 ),
1.0f / float( _oDatabaseInfo.heightTileSize - 1 ) );
Vec2f coarserTexCoordOffset( 0, 0 );
Vec2f coarserTexCoordScale(
1.0f / float( _oDatabaseInfo.heightTileSize - 1 ),
1.0f / float( _oDatabaseInfo.heightTileSize - 1 ) );
OpenGLTexture* texture = this->uploadTexture( node, pEnv );
OpenGLTexture* coarserTexture = 0;
if( texture )
{
if( node->parent )
{
coarserTexture = this->uploadTexture( node->parent, pEnv );
if( coarserTexture )
{
calculateTextureParameters( node,
node->parent,
coarserTexCoordOffset,
coarserTexCoordScale );
}
}
else
{
coarserTexture = texture;
}
}
else
{
// find a parent with a texture:
const BbqTerrNode* parentNode = 0;
texture = findParentTexture( node, parentNode, pEnv );
if( texture )
{
calculateTextureParameters( node,
parentNode,
texCoordOffset,
texCoordScale );
}
if( parentNode && parentNode->parent )
{
const BbqTerrNode* coarserParentNode = 0;
coarserTexture = findParentTexture( parentNode,
coarserParentNode, pEnv );
if( coarserTexture )
{
calculateTextureParameters( node,
coarserParentNode,
coarserTexCoordOffset,
coarserTexCoordScale );
}
}
}
if( !coarserTexture )
{
coarserTexture = texture;
}
if( texture )
{
// todo: put these settings into a OpenGLTextureSampler class:
texture->enable( GL_TEXTURE0, pEnv );
texture0 = texture;
glTexParameteri( GL_TEXTURE_2D,
GL_TEXTURE_WRAP_S,
GL_MIRROR_CLAMP_TO_EDGE_ATI );
glTexParameteri( GL_TEXTURE_2D,
GL_TEXTURE_WRAP_T,
GL_MIRROR_CLAMP_TO_EDGE_ATI );
glTexParameteri( GL_TEXTURE_2D,
GL_TEXTURE_MIN_FILTER,
GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D,
GL_TEXTURE_MAG_FILTER,
GL_LINEAR );
coarserTexture->enable( GL_TEXTURE1, pEnv );
texture1 = coarserTexture;
glTexParameteri( GL_TEXTURE_2D,
GL_TEXTURE_WRAP_S,
//.........这里部分代码省略.........