From 5377b8c9fec3f21d0339152bee0bb1e2892fa4ba Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 22 Jan 2019 12:09:17 +0100 Subject: [PATCH] enable to build WIN32CROSS=1 API=sdl2 --- src/Makefile | 8 ++++++++ src/input.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 6c06c211..a8bc0b19 100644 --- a/src/Makefile +++ b/src/Makefile @@ -452,6 +452,7 @@ endif CROSS_CC ?= $(shell which i686-w64-mingw32-gcc || which mingw32-gcc) CROSS_PKGCONFIG ?= $(shell which i686-w64-mingw32-pkg-config || which mingw32-pkg-config || which $(PKG_CONFIG)) CROSS_SDLCONFIG ?= $(shell which ../3rdparty/usr/bin/sdl-config || which /usr/local/cross-tools/i386-mingw32/bin/sdl-config) + CROSS_SDL2CONFIG ?= $(shell which ../3rdparty/usr/bin/sdl2-config || which /usr/local/cross-tools/i386-mingw32/bin/sdl2-config) CROSS_PKG_CONFIG_PATH ?= $(shell if [ -d ../3rdparty/usr ] ; then echo "$${PWD}/../3rdparty/usr/lib/pkgconfig" ; fi ) CC = $(CROSS_CC) CROSS_STRIP ?= $(shell which i686-w64-mingw32-strip || which mingw32-strip) @@ -463,6 +464,10 @@ endif COPT += -Dmain=SDL_main $(shell $(CROSS_SDLCONFIG) --cflags) LOPT += -lSDLmain -lSDL $(shell $(CROSS_SDLCONFIG) --libs) -lSDL_image endif + ifeq ($(API),sdl2) + COPT += $(shell $(CROSS_SDL2CONFIG) --cflags) + LOPT += $(shell $(CROSS_SDL2CONFIG) --libs) -lSDL2_image + endif ifeq (,$(CROSS_PKGCONFIG)) COPT += -D__no_pnglib__ -D__no_tifflib__ else @@ -481,6 +486,9 @@ endif ifeq ($(API),sdl) PLATFORMFILES += bin/SDL.dll bin/SDL_image.dll endif + ifeq ($(API),sdl2) + PLATFORMFILES += bin/SDL2.dll bin/SDL2_image.dll + endif else ifdef GP2XCROSS #cross compile an exec for the gp2x diff --git a/src/input.c b/src/input.c index 3278b990..c326ef11 100644 --- a/src/input.c +++ b/src/input.c @@ -1374,7 +1374,7 @@ int Get_input(int sleep_time) #endif case SDL_SYSWMEVENT: -#ifdef __WIN32__ +#if defined(USE_SDL) && defined(__WIN32__) if(event.syswm.msg->msg == WM_DROPFILES) { int file_count;