示例#1
0
void resetGame( GameModel & game, PathGraph & pathgraph, GameView & view, GameViewSound & sound ) {
	view.clearObjects( );
	view.uninitActorText( );
	view.uninitBrushes( );

	sound.uninitActors( );

	game = GameModel( );
	pathgraph = PathGraph( );

	game.addObserver( &view );
	view.setGame( &game );
	view.setThirdPerson( );

	game.addObserver( &sound );
	sound.setGame( &game );
}
示例#2
0
#define GLUT_DISABLE_ATEXIT_HACK

#include <GL\freeglut.h>
#include "GameModel.h"

GLfloat rotation = 0.0;

GameModel model = GameModel();

void init(void)
{
	glClearColor(0.0, 0.0, 0.0, 1.0);

	glEnable(GL_DEPTH_TEST);

	model.LoadModel("model/box.obj");
}

void display(void)
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glLoadIdentity();

	gluLookAt(0.0, 0.0, -3.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);

	glPushMatrix();
		glRotatef(rotation, 0.0, 1.0, 0.0);
		model.DrawModel();
	glPopMatrix();