From 03c481932efec69c916c8ee726aed5f19b0da5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sat, 22 Jun 2013 01:27:07 -0300 Subject: [PATCH] Fixed SDL2 for Windows. --- include/eepp/declares.hpp | 8 ++++- premake4.lua | 12 +++++--- projects/windows/ee.files | 58 +++++++++++++++++++++++++++++++----- projects/windows/ee.includes | 1 + 4 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 projects/windows/ee.includes diff --git a/include/eepp/declares.hpp b/include/eepp/declares.hpp index f2e31c3f1..53da2af3e 100644 --- a/include/eepp/declares.hpp +++ b/include/eepp/declares.hpp @@ -89,7 +89,7 @@ #define EE_BACKEND_SDL_ACTIVE #endif -#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS || defined( EE_COMPILER_MSVC ) +#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS || defined( EE_COMPILER_MSVC ) #if EE_PLATFORM == EE_PLATFORM_ANDROID #define EE_NO_WIDECHAR #endif @@ -119,6 +119,12 @@ #endif #endif #else + #if defined( EE_BACKEND_SDL_ACTIVE ) && EE_PLATFORM == EE_PLATFORM_WIN + #define main SDL_main + #define EE_MAIN_FUNC extern "C" + extern "C" int SDL_main(int argc, char *argv[]); + #endif + #ifndef EE_MAIN_FUNC #define EE_MAIN_FUNC #endif diff --git a/premake4.lua b/premake4.lua index 075b3b7b8..d910a0e49 100644 --- a/premake4.lua +++ b/premake4.lua @@ -261,13 +261,17 @@ function build_link_configuration( package_name ) links { get_backend_link_name( "sfml-window" ) } end else - if ( os.is_real("macosx") ) then + if ( os.is_real("macosx") or os.is_real("windows") ) then + if ( os.is_real("windows") ) then + links { "mingw32" } + end + if ( backend_is("SDL") ) then - links { "SDLmain" } + links { "SDLmain", get_backend_link_name( "SDL" ) } elseif ( backend_is("SDL2") ) then - links { "SDL2main" } + links { "SDL2main", get_backend_link_name( "SDL2" ) } elseif ( backend_is("allegro5") ) then - links { "allegro_main" } + links { "allegro_main", get_backend_link_name( "allegro" ) } elseif ( backend_is("SFML") ) then links { get_backend_link_name( "sfml-system" ) } links { get_backend_link_name( "sfml-window" ) } diff --git a/projects/windows/ee.files b/projects/windows/ee.files index fdc4bbc10..a10f3461d 100644 --- a/projects/windows/ee.files +++ b/projects/windows/ee.files @@ -1,10 +1,6 @@ ../../include/eepp/audio/tsoundmanager.hpp ../../include/eepp/audio/tsoundloader.hpp -../../include/eepp/audio/openal.hpp ../../include/eepp/audio/csoundstream.hpp -../../include/eepp/audio/csoundfileogg.hpp -../../include/eepp/audio/csoundfiledefault.hpp -../../include/eepp/audio/csoundfile.hpp ../../include/eepp/audio/csoundbuffer.hpp ../../include/eepp/audio/csound.hpp ../../include/eepp/audio/cmusic.hpp @@ -341,7 +337,7 @@ ../../include/eepp/math/quad2.hpp ../../include/eepp/math/polygon2.hpp ../../include/eepp/math/line2.hpp -../../include/eepp/math/helper.hpp +../../include/eepp/math/ease.hpp ../../include/eepp/math/easing.hpp ../../include/eepp/math/cwaypoints.hpp ../../include/eepp/math/cperlinnoise.hpp @@ -459,7 +455,6 @@ ../../src/eepp/window/platform/x11/ccursorx11.cpp ../../src/eepp/window/platform/platformimpl.hpp ../../src/eepp/graphics/pixelperfect.cpp -../../src/eepp/graphics/glhelper.cpp ../../src/eepp/graphics/cvertexbuffervbo.cpp ../../src/eepp/graphics/cvertexbufferogl.cpp ../../src/eepp/graphics/cvertexbuffermanager.cpp @@ -562,7 +557,6 @@ ../../src/eepp/graphics/cframebufferfbo.hpp ../../src/eepp/graphics/renderer/rendererhelper.hpp ../../include/eepp/graphics/packerhelper.hpp -../../src/eepp/window/backend/SDL2/cbackendsdl.cpp ../../include/eepp/system/filesystem.hpp ../../src/eepp/system/filesystem.cpp ../../include/eepp/graphics/glhelper.hpp @@ -570,3 +564,53 @@ ../../include/eepp/window/windowcontext.hpp ../../include/eepp/version.hpp ../../src/eepp/base/version.cpp +../../src/eepp/physics/moment.cpp +../../src/eepp/physics/area.cpp +../../premake4.lua +../../src/eepp/audio/csoundfileogg.hpp +../../src/eepp/audio/csoundfiledefault.hpp +../../include/eepp/gaming/cgameobjectobject.hpp +../../src/eepp/gaming/cgameobjectobject.cpp +../../src/eepp/gaming/cgameobjectpolyline.cpp +../../src/eepp/gaming/cgameobjectpolygon.cpp +../../include/eepp/gaming/cgameobjectpolyline.hpp +../../include/eepp/gaming/cgameobjectpolygon.hpp +../../src/eepp/gaming/mapeditor/cobjectproperties.hpp +../../src/eepp/gaming/mapeditor/cobjectproperties.cpp +../../include/eepp/base/noncopyable.hpp +../../include/eepp/system/clock.hpp +../../src/eepp/system/clock.cpp +../../src/eepp/ui/cuidefaulttheme.cpp +../../include/eepp/ui/cuidefaulttheme.hpp +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_pvr_c.h +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_pvr.h +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_pkm_c.h +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_pkm.h +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_DDS_c.h +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_DDS.h +../../src/eepp/helper/SOIL2/src/SOIL2/stb_image_write.h +../../src/eepp/helper/SOIL2/src/SOIL2/stb_image.h +../../src/eepp/helper/SOIL2/src/SOIL2/pvr_helper.h +../../src/eepp/helper/SOIL2/src/SOIL2/pkm_helper.h +../../src/eepp/helper/SOIL2/src/SOIL2/image_helper.h +../../src/eepp/helper/SOIL2/src/SOIL2/image_DXT.h +../../src/eepp/helper/SOIL2/src/SOIL2/etc1_utils.h +../../src/eepp/helper/SOIL2/src/SOIL2/SOIL2.h +../../src/eepp/helper/SOIL2/src/SOIL2/stb_image_write.c +../../src/eepp/helper/SOIL2/src/SOIL2/stb_image.c +../../src/eepp/helper/SOIL2/src/SOIL2/image_helper.c +../../src/eepp/helper/SOIL2/src/SOIL2/image_DXT.c +../../src/eepp/helper/SOIL2/src/SOIL2/etc1_utils.c +../../src/eepp/helper/SOIL2/src/SOIL2/SOIL2.c +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_ext_c.h +../../src/eepp/helper/SOIL2/src/SOIL2/stbi_ext.h +../../src/eepp/audio/csoundfile.hpp +../../src/eepp/audio/openal.hpp +../../src/eepp/window/backend/SDL2/cbackendsdl2.cpp +../../src/examples/sound/sound.cpp +../../src/examples/sprites/sprites.cpp +../../src/examples/fonts/fonts.cpp +../../src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +../../src/examples/physics/physics.cpp +../../src/eepp/physics/cshapepoint.cpp +../../include/eepp/physics/cshapepoint.hpp diff --git a/projects/windows/ee.includes b/projects/windows/ee.includes new file mode 100644 index 000000000..02a2a3994 --- /dev/null +++ b/projects/windows/ee.includes @@ -0,0 +1 @@ +../../src/