From c5b462d5b969df4a76c37d0da575bf60c2b17e55 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Mon, 16 May 2011 20:56:57 -0300 Subject: [PATCH] win32 main --- CMakeLists.txt | 2 +- src/main.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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