本文整理汇总了C++中TextureManager::DrawTextured方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureManager::DrawTextured方法的具体用法?C++ TextureManager::DrawTextured怎么用?C++ TextureManager::DrawTextured使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureManager
的用法示例。
在下文中一共展示了TextureManager::DrawTextured方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Ship
//=======================================================================
// Ship
//=======================================================================
void Ship(int locX, int fPosY, float rotation)
{
glLoadIdentity();
glTranslatef(WIDTH/2, HEIGHT/2, 0);
glRotatef(rotation, 0, 0, 1);
if(!GameOver)
{
if(DEBUG)
DebugShip(locX, fPosY);
else
texManager.DrawTextured(0, 0, 64, 64, Player_Ship_Texture);
}
else
{
texManager.DrawTextured(0, 0, 512, 512, explosionTex);
GameState = GAMEOVER;
}
}
示例2: Render
void Render(float dt)
{
for(unsigned int i=0; i<entities.size(); i++)
{
glLoadIdentity();
Entity* e = entities[i];
switch(e->type)
{
case BULLET:
{
e->position += e->direction * Speed/10 * e->type * dt;
glBegin(GL_POINTS);
glVertex2f(e->position.x, e->position.y);
glEnd();
}
break;
case ENEMY:
{
Enemy* enemy = static_cast<Enemy*>(e);
enemy->position += enemy->direction * enemySpeed/10 * dt;
//Debug
//cout << enemy->position.x << " , " << enemy->position.y << endl;
if(enemy->dying)
{
texManager.DrawTextured(enemy->position.x, enemy->position.y, 60.0f, 60.0f, explosionTex);
}
else
{
glTranslatef(enemy->position.x, enemy->position.y, 0);
glRotatef(enemy->dirAngle, 0 ,0, 1);
if(enemy->level == 1)
glScalef(.5,.5,0);
if(DEBUG)
{
glColor3f(1,0,0);
DebugShip(0, 0);
}
else
{
if(enemy->level == 1)
texManager.DrawTextured(0, 0, 60.0f, 60.0f, enemyTexI);
else
texManager.DrawTextured(0, 0, 60.0f, 60.0f, enemyTexII);
}
}
}
break;
}
}
}