treewars/gamestate.cpp

25 lines
402 B
C++
Raw Normal View History

#include "gamestate.h"
GameState::GameState(stack<GameState*>* state_stack, SDL_Surface* display)
{
this->state_stack = state_stack;
this->display = display;
init_done = false;
}
void GameState::execute() throw(StateExit)
{
SDL_Event event;
while(SDL_PollEvent(&event))
handle_event(&event);
iterate();
render();
}
void GameState::on_exit()
{
throw StateExit();
}