本文整理汇总了C++中Missile::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Missile::draw方法的具体用法?C++ Missile::draw怎么用?C++ Missile::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Missile
的用法示例。
在下文中一共展示了Missile::draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintGL
void Engine::paintGL() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f, 2.0f, -15.0f);
glRotatef(xAngle, 1.0f, 0.0f, 0.0f);
glRotatef(yAngle, 0.0f, 1.0f, 0.0f);
glScalef(scale, scale, scale);
drawSea(SEA_SIZE);
glColor3f(1,0,0);
this->renderText(-23, 2, -15.0f, QString("Player 1"));
this->renderText(-24, 1.1f, -15.0f, getHitpoints(&player1));
glColor3f(0,0,1);
this->renderText(19, 2, -15.0f, QString("Player 2"));
this->renderText(20, 1.1f, -15.0f, getHitpoints(&player2));
glColor3f(1,1,0);
this->renderText(-0.5d, 1.0d, 1.0d, pauseText);
glColor3f(0,1,0);
this->renderText(-2.5d, 1.0d, -1.0d, checkForWinner());
this->renderText(-4.5d, 1.0d, 1.0d, newGameText);
glPushMatrix();
glTranslatef(player1.xPos, 0, player1.zPos);
glRotatef(player1.yAngle, 0, 1, 0);
player1.draw(1, 0, 0);
glPopMatrix();
glPushMatrix();
glTranslatef(player2.xPos, 0, player2.zPos);
glRotatef(player2.yAngle, 0, 1, 0);
player2.draw(0, 0, 1);
glPopMatrix();
Missile* m;
foreach(m, missilesList) {
glPushMatrix();
glTranslatef(m->x, 0.4, m->z);
glRotatef(m->angle, 0, 1, 0);
m->draw();
glPopMatrix();
}