summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-27 17:24:28 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-01-13 03:39:28 +0100
commit04ab1a3420b46af046a898ee5510e0d9b25ed24c (patch)
tree4e9d300bb38d434305d00337535c7c4077bc57c4 /src/main.cpp
parent2017-08-23 (diff)
downloadAltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.gz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.bz2
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.lz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.xz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.zst
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.zip
Diffstat (limited to '')
-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);