Esempio n. 1
0
 void dfs(vector<vector<string> >& sol, int n, vector<int>& C) {
     if(C.size() == n) {
         // draw the chessboard
         sol.push_back(drawChessBoard(C));
         return;
     }
     
     for(int col = 0; col < n; ++col) {
         if(!isValid(C, col)) {
             continue;
         }
         C.push_back(col); // go to next row
         dfs(sol, n, C);
         C.pop_back();  // revoke current row
     }
 }
Esempio n. 2
0
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
GLvoid ChessGame::drawScene(GLvoid)
{
	chessCam();	
	drawChessBoard();

	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

	glDisable(GL_TEXTURE_2D);
	glEnable(GL_LIGHTING);

	for(int i = 0; i < (int)Lighting::lights.size(); i++)
		Lighting::lights[i]->updateLight();


	glEnable(GL_BLEND);	



	//drawGrid();	

	glEnable(GL_LIGHTING);
	glDisable(GL_TEXTURE_2D);

	//TODO:: GET EMITTER WORKING
	//emitter->Update( SDL_GetTicks() );

	glDisable(GL_LIGHTING);
	setOrtho(windowWidth, windowHeight); //ortho for 2D text

	glMatrixMode(GL_MODELVIEW); //back to 3D
	glLoadIdentity();


	displayFPS();
	drawControls();


	glFlush();

	//This line IS MODIFIED in different interfaces
	SDL_GL_SwapBuffers();

}