Example #1
0
void XMLScene::display()
{
	static int i=0;
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	//axis.draw();
	/*
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();

	int viewport[]={0,0,0,0};
	glGetIntegerv(GL_VIEWPORT,viewport);
	glViewport(0,0,viewport[2],viewport[3]);
	//file->sceneCameras[camera].second->updateProjectionMatrix(viewport[2],viewport[3]);
	file->sceneCameras[camera].second->applyView();
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	*/
	//activeCamera->setZ(-20);
	activeCamera->applyView();
	printScoreBoard();
	//draw lights

	selectDrawMode();
	for(unsigned int i=0;i<file->sceneLights.size();i++)
	{
		if(activeLights[i]==1)
		{

			file->sceneLights[i]->enable();
			file->sceneLights[i]->draw();
		}
		else
			file->sceneLights[i]->disable();

		file->sceneLights[i]->update();
	}

	//end of draw lights
	glPushMatrix();
	drawObjects();
	glPopMatrix();
	data->getBoard()->draw();



	//if theme is changed
	if(lastOption!=option)
	{
		data->getBoard()->setPieceOption(option);
		changeTheme();
		lastOption=option;
	}
	i++;
	glutSwapBuffers();
}
Example #2
0
void Board::printText()const
{
	for(int i=0;i<HEIGHT;++i)
	{
		for(int j=0;j<WIDTH;++j)
		{
			if((text[i][j]==PLAYER)||(text[i][j]==ARROW))
			{
				cout << ' ';
			}
			else
			{
				cout << text[i][j];
			}
		}
		cout << endl;
	}
	pList->print();
	aList->print();
	printScoreBoard(0);
}