-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (30 loc) · 785 Bytes
/
main.cpp
File metadata and controls
35 lines (30 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
*
* A skeleton for a 2D game
*
* Copyright (c) 2020-2021 Oliver van Kaick <Oliver.vanKaick@carleton.ca>, David Mould <mould@scs.carleton.ca>
*
*/
#include <iostream>
#include <exception>
#include "game.h"
// Macro for printing exceptions
#define PrintException(exception_object)\
std::cerr << exception_object.what() << std::endl
// Main function that builds and runs the game
int main(void){
game::Game the_game;
try {
// Initialize graphics libraries and main window
the_game.Init();
// Setup the game (scene, game objects, etc.)
the_game.Setup();
// Run the game
the_game.MainLoop();
}
catch (std::exception &e){
// Catch and print any errors
PrintException(e);
}
return 0;
}