added in quitting from game if window close button pressed
This commit is contained in:
parent
5c1b18c70d
commit
4a271ee0a5
3 changed files with 10 additions and 0 deletions
|
@ -428,6 +428,8 @@ int main(int argc, char** argv)
|
|||
std::cerr << e.message << "\n";
|
||||
} catch(gui::button::error&) {
|
||||
std::cerr << "Could not create button: Image could not be found\n";
|
||||
} catch(CVideo::quit&) {
|
||||
//just means the game should quit
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -230,6 +230,12 @@ void pump_events()
|
|||
resize_dimensions.first = resize->w;
|
||||
resize_dimensions.second = resize->h;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_QUIT: {
|
||||
throw CVideo::quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,6 +51,8 @@ class CVideo {
|
|||
|
||||
struct error {};
|
||||
|
||||
struct quit {};
|
||||
|
||||
private:
|
||||
|
||||
SDL_Surface* frameBuffer;
|
||||
|
|
Loading…
Add table
Reference in a new issue