EAGLView::EAGLView(QWidget *parent) :QGLWidget(parent) { d = new PrivateData; d->timer.setInterval(1000.0 / 60.0); connect(&d->timer, SIGNAL(timeout()), this, SLOT(mainGameLoop())); this->setWindowTitle("HexGame"); }
void GamePairs::play() { displayDelegate->gameBegin(); while (board.enoughCardsForNextRound()) mainGameLoop(); displayDelegate->showScore(); std::this_thread::sleep_for(kBeforeQuitDuration); displayDelegate->gameEnd(); }
int main(void){ //set up window/OpenGL WinMgr *win = new WinMgr(); Player p(640,480); Input in(p,running); //loop game glfwSetTime(0.0); while(true){ mainGameLoop(p,in); if(!running) break; } //take down window/OpenGL delete win; //exit program }