Port the Windows platform backend including Makefile support to SDL3.

This also fixes a long standing bug with the Windows part of the
Makefile linking -lSDL2 into q2ded.exe.
This commit is contained in:
Yamagi 2024-04-02 18:29:31 +02:00
parent a675b654c6
commit 8cedbb0694
3 changed files with 10 additions and 2 deletions

View file

@ -725,7 +725,7 @@ set_target_properties(q2ded PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release
) )
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(q2ded ${yquake2LinkerFlags} ${yquake2SDLLinkerFlags} ${yquake2ZLibLinkerFlags} ws2_32 winmm) target_link_libraries(q2ded ${yquake2LinkerFlags}
else() else()
target_link_libraries(q2ded ${yquake2LinkerFlags} ${yquake2ServerLinkerFlags} ${yquake2ZLibLinkerFlags}) target_link_libraries(q2ded ${yquake2LinkerFlags} ${yquake2ServerLinkerFlags} ${yquake2ZLibLinkerFlags})
endif() endif()

View file

@ -1152,7 +1152,7 @@ endif
ifeq ($(YQ2_OSTYPE), Windows) ifeq ($(YQ2_OSTYPE), Windows)
release/q2ded.exe : $(SERVER_OBJS) icon release/q2ded.exe : $(SERVER_OBJS) icon
@echo "===> LD $@" @echo "===> LD $@"
${Q}$(CC) $(LDFLAGS) build/icon/icon.res $(SERVER_OBJS) $(LDLIBS) $(SDLLDFLAGS) -o $@ ${Q}$(CC) $(LDFLAGS) build/icon/icon.res $(SERVER_OBJS) $(LDLIBS) -o $@
$(Q)strip $@ $(Q)strip $@
else else
release/q2ded : $(SERVER_OBJS) release/q2ded : $(SERVER_OBJS)

View file

@ -26,8 +26,16 @@
*/ */
#include <windows.h> #include <windows.h>
#ifndef DEDICATED_ONLY
#ifdef USE_SDL3
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#else
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <SDL2/SDL_main.h> #include <SDL2/SDL_main.h>
#endif
#endif
#include "../../common/header/common.h" #include "../../common/header/common.h"