mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Add SDL 3 support to the Makefile.
This is hidden behind WITH_SDL3, which is disabled by default. Additionally rename the SDL sources files in the client to represent the SDL major version they are supporting. They will be forked for SDL 3. That isn't optimal, because it forces us to support two variants of the same code. However the changes between SDL 2 and 3 are too big to work with #ifdef and something like function pointer magic is even more confusing.
This commit is contained in:
parent
34d2ddc2a9
commit
126c2ea10b
4 changed files with 31 additions and 5 deletions
36
Makefile
36
Makefile
|
@ -53,6 +53,9 @@ WITH_OPENAL:=yes
|
||||||
# or libopenal.so. Not supported on Windows.
|
# or libopenal.so. Not supported on Windows.
|
||||||
WITH_RPATH:=yes
|
WITH_RPATH:=yes
|
||||||
|
|
||||||
|
# Builds with SDL 3 instead of SDL 2.
|
||||||
|
WITH_SDL3:=no
|
||||||
|
|
||||||
# Enable systemwide installation of game assets.
|
# Enable systemwide installation of game assets.
|
||||||
WITH_SYSTEMWIDE:=no
|
WITH_SYSTEMWIDE:=no
|
||||||
|
|
||||||
|
@ -276,7 +279,12 @@ endif
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
# Extra CFLAGS for SDL.
|
# Extra CFLAGS for SDL.
|
||||||
|
ifeq ($(WITH_SDL3),yes)
|
||||||
|
SDLCFLAGS := $(shell pkgconf --cflags sdl3)
|
||||||
|
SDLCFLAGS += -DUSE_SDL3
|
||||||
|
else
|
||||||
SDLCFLAGS := $(shell sdl2-config --cflags)
|
SDLCFLAGS := $(shell sdl2-config --cflags)
|
||||||
|
endif
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
|
@ -353,11 +361,19 @@ endif
|
||||||
# ----------
|
# ----------
|
||||||
|
|
||||||
# Extra LDFLAGS for SDL
|
# Extra LDFLAGS for SDL
|
||||||
|
ifeq ($(WITH_SDL3),yes)
|
||||||
|
ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
|
SDLLDFLAGS := -lSDL3
|
||||||
|
else
|
||||||
|
SDLLDFLAGS := $(shell pkgconf --libs sdl3)
|
||||||
|
endif
|
||||||
|
else
|
||||||
ifeq ($(YQ2_OSTYPE), Darwin)
|
ifeq ($(YQ2_OSTYPE), Darwin)
|
||||||
SDLLDFLAGS := -lSDL2
|
SDLLDFLAGS := -lSDL2
|
||||||
else # not Darwin
|
else
|
||||||
SDLLDFLAGS := $(shell sdl2-config --libs)
|
SDLLDFLAGS := $(shell sdl2-config --libs)
|
||||||
endif # Darwin
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# The renderer libs don't need libSDL2main, libmingw32 or -mwindows.
|
# The renderer libs don't need libSDL2main, libmingw32 or -mwindows.
|
||||||
ifeq ($(YQ2_OSTYPE), Windows)
|
ifeq ($(YQ2_OSTYPE), Windows)
|
||||||
|
@ -394,6 +410,7 @@ config:
|
||||||
@echo "WITH_CURL = $(WITH_CURL)"
|
@echo "WITH_CURL = $(WITH_CURL)"
|
||||||
@echo "WITH_OPENAL = $(WITH_OPENAL)"
|
@echo "WITH_OPENAL = $(WITH_OPENAL)"
|
||||||
@echo "WITH_RPATH = $(WITH_RPATH)"
|
@echo "WITH_RPATH = $(WITH_RPATH)"
|
||||||
|
@echo "WITH_SDL3 = $(WITH_SDL3)"
|
||||||
@echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)"
|
@echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)"
|
||||||
@echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)"
|
@echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)"
|
||||||
@echo "============================"
|
@echo "============================"
|
||||||
|
@ -852,17 +869,14 @@ CLIENT_OBJS_ := \
|
||||||
src/client/cl_view.o \
|
src/client/cl_view.o \
|
||||||
src/client/curl/download.o \
|
src/client/curl/download.o \
|
||||||
src/client/curl/qcurl.o \
|
src/client/curl/qcurl.o \
|
||||||
src/client/input/sdl.o \
|
|
||||||
src/client/menu/menu.o \
|
src/client/menu/menu.o \
|
||||||
src/client/menu/qmenu.o \
|
src/client/menu/qmenu.o \
|
||||||
src/client/menu/videomenu.o \
|
src/client/menu/videomenu.o \
|
||||||
src/client/sound/sdl.o \
|
|
||||||
src/client/sound/ogg.o \
|
src/client/sound/ogg.o \
|
||||||
src/client/sound/openal.o \
|
src/client/sound/openal.o \
|
||||||
src/client/sound/qal.o \
|
src/client/sound/qal.o \
|
||||||
src/client/sound/sound.o \
|
src/client/sound/sound.o \
|
||||||
src/client/sound/wave.o \
|
src/client/sound/wave.o \
|
||||||
src/client/vid/glimp_sdl.o \
|
|
||||||
src/client/vid/vid.o \
|
src/client/vid/vid.o \
|
||||||
src/common/argproc.o \
|
src/common/argproc.o \
|
||||||
src/common/clientserver.o \
|
src/common/clientserver.o \
|
||||||
|
@ -898,6 +912,18 @@ CLIENT_OBJS_ := \
|
||||||
src/server/sv_user.o \
|
src/server/sv_user.o \
|
||||||
src/server/sv_world.o
|
src/server/sv_world.o
|
||||||
|
|
||||||
|
ifeq ($(WITH_SDL3),yes)
|
||||||
|
CLIENT_OBJS_ += \
|
||||||
|
src/client/input/sdl3.o \
|
||||||
|
src/client/sound/sdl3.o \
|
||||||
|
src/client/vid/glimp_sdl3.o
|
||||||
|
else
|
||||||
|
CLIENT_OBJS_ += \
|
||||||
|
src/client/input/sdl2.o \
|
||||||
|
src/client/sound/sdl2.o \
|
||||||
|
src/client/vid/glimp_sdl2.o
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(YQ2_OSTYPE), Windows)
|
ifeq ($(YQ2_OSTYPE), Windows)
|
||||||
CLIENT_OBJS_ += \
|
CLIENT_OBJS_ += \
|
||||||
src/backends/windows/main.o \
|
src/backends/windows/main.o \
|
||||||
|
|
0
src/client/vid/glimp_sdl.c → src/client/vid/glimp_sdl2.c
Executable file → Normal file
0
src/client/vid/glimp_sdl.c → src/client/vid/glimp_sdl2.c
Executable file → Normal file
Loading…
Reference in a new issue