Ejemplo n.º 1
0
// 押されたマス目の描画
void displayPushedPiece(int x, int y, int num)
{
	// マス目の色をGrayにする
	displayPiece(x, y, colors[Gray]);

	// 数字描画
	glColor3dv(colors[num]);
	glRasterPos2d(sqrSize*(x + frame)+sqrSize*1.5 / 5.0, sqrSize*(y + frame)+sqrSize*4.0 / 5.0);
	glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, numbers[num]);
}
Ejemplo n.º 2
0
void Board::display() {
	for (int sq = 0; sq < 64; sq++) {
		if (color[sq] == EMPTY) {
			std::cout << "*";
		} else {
			std::cout << displayPiece(pieces[sq], color[sq]);
		}

		if (sq % 8 == 7) {
			std::cout << "\n";
		}
	}
}
Ejemplo n.º 3
0
// ボードの基礎の描画
void displayBoard()
{
	// タイトル描画
	glColor3d(1, 1, 1);
	glRasterPos2d(sqrSize*frame, sqrSize*9.0 / 5.0);
	for (char* str = title; *str; str++) {
		glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, *str);
	}

	for (int i = 0; i < sqrNum; i++) {
		for (int j = 0; j < sqrNum; j++) {
			displayPiece(i, j, colors[Blue]);
		}
	}
}