// CBoard implementation // // Author: Josh Jenkins // Inertia Productions 2003 // http://homepages.ihug.com.au/~grom #include "CBoard.h" // Class declaration //////////////////////////////////////////////////////////////////// // Constructor CBoard::CBoard(): width(13.0f), // Initialize width and height height(10.0f) { color[0] = 0; // Set the board color to blue color[1] = 0; color[2] = 1; } //////////////////////////////////////////////////////////////////// // Destructor CBoard::~CBoard() { } //////////////////////////////////////////////////////////////////// // Draw to opengl screen CBoard::Draw() { glColor3fv(color); // Set the color using the rgb color set glBegin(GL_QUADS); // Draw the board with center at (0,0) glVertex3f(-width/2, -height/2, 0.0f); glVertex3f(-width/2, height/2, 0.0f); glVertex3f( width/2, height/2, 0.0f); glVertex3f( width/2, -height/2, 0.0f); glEnd(); }