summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0a6ad17..9c38814 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,12 +16,9 @@ const char *getTimeSinceProgramStart(void) {
INITIALIZE_EASYLOGGINGPP
-#ifdef WIN32
-int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance,
- _In_ LPSTR lpCmdLine, _In_ int nCmdShow) {
-#else
-int main() {
-#endif
+#undef main
+
+int main(int argc, char** argv) {
el::Configurations loggerConfiguration;
el::Helpers::installCustomFormatSpecifier(
el::CustomFormatSpecifier("%startTime", std::bind(getTimeSinceProgramStart)));
@@ -37,6 +34,14 @@ int main() {
LOG(WARNING) << "Sizeof EventData is " << sizeof(EventData);
+ try {
+ if (SDL_Init(0) == -1)
+ throw std::runtime_error("SDL initialization failed: " + std::string(SDL_GetError()));
+ } catch (std::exception& e) {
+ LOG(ERROR) << e.what();
+ return -1;
+ }
+
ThreadGame game;
std::thread threadGame(&ThreadGame::Execute, game);