diff --git a/CMakeLists.txt b/CMakeLists.txt index 466af39a..da1dba2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,7 +111,7 @@ SET(SOURCES IF(WIN32) SET(SOURCES ${SOURCES} src/framework/platform/win32platform.cpp) SET(ADDITIONAL_LIBRARIES ws2_32) - ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) + ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501 -DWIN32_NO_CONSOLE) ELSE(WIN32) SET(SOURCES ${SOURCES} src/framework/platform/x11platform.cpp) SET(ADDITIONAL_LIBRARIES pthread GLU) diff --git a/src/main.cpp b/src/main.cpp index d38bda02..3d6ddef3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -75,8 +75,20 @@ void saveConfigs() g_configs.save(); } +#ifdef WIN32_NO_CONSOLE +#include +int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument,int nCmdShow) +{ + std::vector args; + boost::split(args, lpszArgument, boost::is_any_of(" ")); +#else int main(int argc, const char *argv[]) { + std::vector args; + for(int i=0;i