示例#1
0
static void display(void)
{
	// clear the scene
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glPushMatrix();
	if (tank1.GetLife() > 0 && tank2.GetLife() > 0)
	{
		tank1.Draw();
		tank2.Draw();

		tank1.DrawAllBullets();
		tank2.DrawAllBullets();

		for (list<CPrzeszkoda *>::iterator it = przeszkoda.begin(); it != przeszkoda.end(); it++)
		{
			(*it)->Draw();
		}
		boost.Draw();
	}
	else
	{
		glRasterPos2i(0, 0);
		glColor3f(1, 0, 0);
		unsigned char tekst[] = "Koniec gry";
		glutBitmapString(GLUT_BITMAP_HELVETICA_18, tekst);
	}

	glPopMatrix();
	glutSwapBuffers();
}
static void display(void)
{
	// clear the scene
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glPushMatrix();
	tank1.Draw();
	tank2.Draw();
	bullet.Draw();
	glPopMatrix();

	glutSwapBuffers();
}