From 0a945baff1fbd1a037002e8ee69face6c952bf21 Mon Sep 17 00:00:00 2001 From: dhewg Date: Tue, 20 Dec 2011 16:12:17 +0100 Subject: [PATCH] Initial SDL setup Use SDL_main on all platforms. Fix main() for non-const argv so it matches with the SDL prototype. Adapt win32 WinMain() to main() and get rid of the win32 special case in Common::Init(). --- CMakeLists.txt | 5 +++++ framework/Common.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f8197d..8f86cb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,9 @@ include_directories(${OPENAL_INCLUDE_DIR}) find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) +find_package(SDL REQUIRED) +include_directories(${SDL_INCLUDE_DIR}) + if (UNIX AND NOT APPLE) find_package(X11 REQUIRED) add_definitions(-DXTHREADS) @@ -694,6 +697,7 @@ if (CORE) ${VORBIS_LIBRARIES} ${CURL_LIBRARY} ${JPEG_LIBRARY} + ${SDL_LIBRARY} ${sys_libs} ) endif() @@ -716,6 +720,7 @@ if (DEDICATED) ${VORBIS_LIBRARIES} ${CURL_LIBRARY} ${JPEG_LIBRARY} + ${SDL_LIBRARY} ${sys_libs} ) endif() diff --git a/framework/Common.h b/framework/Common.h index 7088684..3380eee 100644 --- a/framework/Common.h +++ b/framework/Common.h @@ -120,7 +120,7 @@ public: // Initialize everything. // if the OS allows, pass argc/argv directly (without executable name) // otherwise pass the command line in a single string (without executable name) - virtual void Init( int argc, const char **argv, const char *cmdline ) = 0; + virtual void Init( int argc, char **argv ) = 0; // Shuts down everything. virtual void Shutdown( void ) = 0;