Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,14 @@ endif

endif

ifeq ($(HAVE_SDL2), 1)
ifeq ($(HAVE_SDL3), 1)
SDL3_CFLAGS = $(shell pkg-config sdl3 --cflags)
SDL3_LIBS = $(shell pkg-config sdl3 --libs)
DEF_FLAGS += $(SDL3_CFLAGS)
LIBS += $(SDL3_LIBS)
DEFINES += -DHAVE_SDL3
Comment on lines +1667 to +1672
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This the right way to set these configurations? https://wiki.libsdl.org/SDL3/README-migration

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks correct to me

OBJ += input/drivers_joypad/sdl3_joypad.o
else ifeq ($(HAVE_SDL2), 1)
HAVE_SDL_COMMON = 1
OBJ += gfx/drivers/sdl2_gfx.o \
gfx/common/sdl2_common.o
Expand Down
6 changes: 6 additions & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ HAVE_WINMM = 1

HAVE_SDL := 0
HAVE_SDL2 := 0
HAVE_SDL3 := 0
HAVE_RSOUND := 0

HAVE_STB_FONT := 1
Expand Down Expand Up @@ -64,6 +65,11 @@ SDL2_LIBS := -lSDL2
SDL2_CFLAGS := -ISDL2 -DHAVE_SDL2
endif

ifeq ($(HAVE_SDL3), 1)
SDL3_LIBS := -lSDL3
SDL3_CFLAGS := -ISDL3 -DHAVE_SDL3
endif

ifeq ($(HAVE_D3D8), 1)
D3D8_LIBS := -ld3d8
ifeq ($(HAVE_D3DX), 1)
Expand Down
6 changes: 6 additions & 0 deletions config.features.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
#define SUPPORTS_SDL2 false
#endif

#ifdef HAVE_SDL3
#define SUPPORTS_SDL3 true
#else
#define SUPPORTS_SDL3 false
#endif

#ifdef HAVE_THREADS
#define SUPPORTS_THREAD true
#else
Expand Down
4 changes: 3 additions & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,9 @@ const char *config_get_default_joypad(void)
case JOYPAD_ANDROID:
return "android";
case JOYPAD_SDL:
#ifdef HAVE_SDL2
#ifdef HAVE_SDL3
return "sdl3";
#elif defined(HAVE_SDL2)
return "sdl2";
#else
return "sdl";
Expand Down
4 changes: 3 additions & 1 deletion griffin/griffin.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,9 @@ AUDIO
#include "../audio/drivers/xaudio.c"
#endif

#if defined(HAVE_SDL2)
#if defined(HAVE_SDL3)
#include "../input/drivers_joypad/sdl3_joypad.c"
#elif defined(HAVE_SDL2)
#include "../audio/drivers/sdl_audio.c"
#include "../input/drivers/sdl_input.c"
#include "../input/drivers_joypad/sdl_joypad.c"
Expand Down
Loading
Loading