本文整理汇总了C++中CSprite::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ CSprite::Render方法的具体用法?C++ CSprite::Render怎么用?C++ CSprite::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSprite
的用法示例。
在下文中一共展示了CSprite::Render方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderRallyPoint
void CEntity::RenderRallyPoint()
{
if( !m_visible )
return;
/*
if ( !entf_get(ENTF_HAS_RALLY_POINT) ||
g_Selection.m_unitUITextures.find(m_base->m_rallyName) == g_Selection.m_unitUITextures.end() )
{
return;
}
*/
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, g_Renderer.m_Options.m_LodBias);
CSprite sprite;
CTexture tex;
// tex.SetHandle( g_Selection.m_unitUITextures[m_base->m_rallyName] );
sprite.SetTexture(&tex);
// Place the sprite slightly above ground/water level.
float terrainHeight = g_Game->GetWorld()->GetTerrain()->GetExactGroundLevel(m_rallyPoint);
float height = std::max(terrainHeight, g_Renderer.GetWaterManager()->m_WaterHeight) + 0.5f;
CVector3D rally(m_rallyPoint.x, height, m_rallyPoint.y);
sprite.SetTranslation(rally);
sprite.Render();
}
示例2: Render
void CBoard::Render()
{
if (m_pBoard)
{
m_pBoard->Render();
}
for (int i = 0; i < 9; i++)
{
int x = i / 3;
int y = i % 3;
if ( IsTileFree( x, y ) )
{
continue;
}
CSprite *pIcon = m_iMatrix[x][y] == PLAYER_X ? m_pX : m_pO;
if (!pIcon)
{
continue;
}
pIcon->SetPosition( (x-1)*DELTA_WIDTH, (y-1)*DELTA_HEIGHT );
pIcon->SetScale( SCALE );
pIcon->Render();
}
}
示例3: Render
void SampleScene::Render()
{
g_CameraManager->CameraRun() ;
Sprite.Render() ;
//UISprite.Render() ;
//Sprite2.Render() ;
//UISprite2.Render() ;
}
示例4: Render
// ----------------------------------------------------------------
// Render
// ----------------------------------------------------------------
void CAnimation::Render()
{
CSprite * sprite;
if( m_Fps == 0 )
sprite = m_Sprites[0];
else
sprite = m_Sprites[m_FrameNumber];
sprite->SetPosition( m_Position );
sprite->Render();
}