void render() { clear(); switch(getState()) { case MAIN_MENU: renderMainMenu(); break; case GAME: renderGame(); break; case BATTLE: renderBattle(); break; case INSTRUCTIONS: renderInstructions(); break; case OPTIONS: renderOptions(); break; case STATUS: renderStatus(); break; default: break; } refresh(); // call curses's refresh funct to update screen }
void SideScroller::Render() { glClear(GL_COLOR_BUFFER_BIT); switch (state) { case STATE_MAIN_MENU: renderMainMenu(); break; case STATE_GAME_LEVEL: renderGameLevel(); break; } SDL_GL_SwapWindow(displayWindow); }
//Update the menu every frame. void updateMenu() { for (unsigned int u = 0; u < numberOfMenuOptions; ++u) { if (u != static_cast<int>(menuStates)) { options[u].isSelected = false; } else { options[u].isSelected = true; } } menuUserInput(); renderMainMenu(); }