From c2432f8d0d569e5d90a2e22ce3207cd183293b33 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 28 Nov 2022 09:54:09 -0800 Subject: [PATCH] Rename SDLmain to SDL_main and SDLtest to SDL_test for consistency with other SDL libraries --- Android.mk | 2 +- CMakeLists.txt | 32 +++++++++---------- SDL3Config.cmake.in | 14 ++++---- VisualC-GDK/SDL.sln | 4 +-- .../SDL_main.vcxproj} | 4 +-- .../SDL_test.vcxproj} | 4 +-- .../testgamecontroller.vcxproj | 4 +-- VisualC-GDK/tests/testgdk/testgdk.vcxproj | 6 ++-- .../tests/testsprite2/testsprite2.vcxproj | 6 ++-- VisualC/SDL.sln | 4 +-- .../SDL_main.vcxproj} | 4 +-- .../SDL_test.vcxproj} | 4 +-- VisualC/pkg-support/cmake/sdl3-config.cmake | 26 +++++++-------- VisualC/tests/checkkeys/checkkeys.vcxproj | 4 +-- .../tests/controllermap/controllermap.vcxproj | 2 +- VisualC/tests/loopwave/loopwave.vcxproj | 2 +- VisualC/tests/testatomic/testatomic.vcxproj | 4 +-- .../testautomation/testautomation.vcxproj | 4 +-- VisualC/tests/testdraw2/testdraw2.vcxproj | 6 ++-- VisualC/tests/testfile/testfile.vcxproj | 4 +-- .../testgamecontroller.vcxproj | 2 +- VisualC/tests/testgesture/testgesture.vcxproj | 6 ++-- VisualC/tests/testgl2/testgl2.vcxproj | 6 ++-- VisualC/tests/testgles2/testgles2.vcxproj | 4 +-- .../tests/testjoystick/testjoystick.vcxproj | 4 +-- .../tests/testoverlay2/testoverlay2.vcxproj | 2 +- .../tests/testplatform/testplatform.vcxproj | 4 +-- VisualC/tests/testpower/testpower.vcxproj | 4 +-- .../testrendertarget/testrendertarget.vcxproj | 4 +-- VisualC/tests/testrumble/testrumble.vcxproj | 4 +-- VisualC/tests/testscale/testscale.vcxproj | 4 +-- VisualC/tests/testsensor/testsensor.vcxproj | 2 +- VisualC/tests/testshape/testshape.vcxproj | 4 +-- VisualC/tests/testsprite2/testsprite2.vcxproj | 4 +-- .../tests/testsurround/testsurround.vcxproj | 4 +-- VisualC/tests/testvulkan/testvulkan.vcxproj | 4 +-- VisualC/tests/testwm2/testwm2.vcxproj | 4 +-- VisualC/tests/testyuv/testyuv.vcxproj | 4 +-- .../resources/CMake/sdl3-config.cmake | 6 ++-- build-scripts/androidbuildlibs.sh | 2 +- cmake/test/CMakeLists.txt | 22 ++++++------- cmake/test/jni/Android.mk | 2 +- docs/README-android.md | 4 +-- docs/README-cmake.md | 15 +++++---- docs/README-gdk.md | 14 ++++---- docs/README-migration.md | 8 +++-- docs/README-n3ds.md | 2 +- docs/README-visualc.md | 4 +-- docs/README-winrt.md | 2 +- include/SDL3/SDL_main.h | 4 +-- src/main/psp/SDL_psp_main.c | 2 +- test/CMakeLists.txt | 16 +++++----- 52 files changed, 158 insertions(+), 155 deletions(-) rename VisualC-GDK/{SDLmain/SDLmain.vcxproj => SDL_main/SDL_main.vcxproj} (99%) rename VisualC-GDK/{SDLtest/SDLtest.vcxproj => SDL_test/SDL_test.vcxproj} (99%) rename VisualC/{SDLmain/SDLmain.vcxproj => SDL_main/SDL_main.vcxproj} (99%) rename VisualC/{SDLtest/SDLtest.vcxproj => SDL_test/SDL_test.vcxproj} (97%) diff --git a/Android.mk b/Android.mk index 3107e7d7a..195b2613a 100644 --- a/Android.mk +++ b/Android.mk @@ -122,7 +122,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/include LOCAL_MODULE := SDL3_main -LOCAL_MODULE_FILENAME := libSDL3main +LOCAL_MODULE_FILENAME := libSDL3_main include $(BUILD_STATIC_LIBRARY) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6334fa982..fcd0977c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -429,7 +429,7 @@ foreach(_SUB ${SDL_SUBSYSTEMS}) endforeach() # Allow some projects to be built conditionally. -set_option(SDL3_DISABLE_SDL3MAIN "Disable building/installation of SDL3main" OFF) +set_option(SDL3_DISABLE_SDL3MAIN "Disable building/installation of SDL3_main" OFF) set_option(SDL3_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT}) set_option(SDL3_DISABLE_UNINSTALL "Disable uninstallation of SDL3" OFF) @@ -2042,7 +2042,7 @@ elseif(WINDOWS) if(MINGW OR CYGWIN) if(NOT SDL3_DISABLE_SDL3MAIN) list(APPEND SDL_CFLAGS "-Dmain=SDL_main") - list(INSERT SDL_LIBS 0 "-lSDL3main") + list(INSERT SDL_LIBS 0 "-lSDL3_main") endif(NOT SDL3_DISABLE_SDL3MAIN) list(INSERT SDL_LIBS 0 "-lmingw32" "-mwindows") endif() @@ -2680,7 +2680,7 @@ elseif(PSP) psppower ) if(NOT SDL3_DISABLE_SDL3MAIN) - list(INSERT SDL_LIBS 0 "-lSDL3main") + list(INSERT SDL_LIBS 0 "-lSDL3_main") endif(NOT SDL3_DISABLE_SDL3MAIN) elseif(PS2) @@ -3191,11 +3191,11 @@ endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${EXTRA_CFLAGS_BUILD}") if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN) - # Build SDLmain - add_library(SDL3main STATIC ${SDLMAIN_SOURCES}) + # Build SDL_main + add_library(SDL3_main STATIC ${SDLMAIN_SOURCES}) # alias target for in-tree builds - add_library(SDL3::SDL3main ALIAS SDL3main) - target_include_directories(SDL3main + add_library(SDL3::SDL3_main ALIAS SDL3_main) + target_include_directories(SDL3_main PRIVATE "$>>" PUBLIC @@ -3204,18 +3204,18 @@ if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN) "$" ) if (WIN32) - target_link_libraries(SDL3main PRIVATE shell32) + target_link_libraries(SDL3_main PRIVATE shell32) endif() if(MINGW OR CYGWIN) cmake_minimum_required(VERSION 3.13) if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_link_options(SDL3main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>") + target_link_options(SDL3_main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>") else() - target_link_options(SDL3main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>") + target_link_options(SDL3_main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>") endif() endif() if (NOT ANDROID) - set_target_properties(SDL3main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") + set_target_properties(SDL3_main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() endif() @@ -3341,9 +3341,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDL_BUILD_MICRO_VERSION=${SDL_MICRO_VERSIO if(SDL_TEST) file(GLOB TEST_SOURCES ${SDL3_SOURCE_DIR}/src/test/*.c) add_library(SDL3_test STATIC ${TEST_SOURCES}) - add_library(SDL3::SDL3test ALIAS SDL3_test) + add_library(SDL3::SDL3_test ALIAS SDL3_test) set_target_properties(SDL3_test PROPERTIES - EXPORT_NAME SDL3test) + EXPORT_NAME SDL3_test) target_include_directories(SDL3_test PRIVATE "$>>" @@ -3365,7 +3365,7 @@ if(NOT SDL3_DISABLE_INSTALL) endif() if(NOT WINDOWS_STORE AND NOT SDL3_DISABLE_SDL3MAIN) - install(TARGETS SDL3main EXPORT SDL3mainTargets + install(TARGETS SDL3_main EXPORT SDL3mainTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") @@ -3425,7 +3425,7 @@ if(NOT SDL3_DISABLE_INSTALL) ) if(ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.7) install(EXPORT_ANDROID_MK SDL3mainTargets - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3main") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3_main") endif() endif() @@ -3449,7 +3449,7 @@ if(NOT SDL3_DISABLE_INSTALL) ) if(ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.7) install(EXPORT_ANDROID_MK SDL3testTargets - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3test") + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/ndk-modules/SDL3_test") endif() endif() diff --git a/SDL3Config.cmake.in b/SDL3Config.cmake.in index 792aefdc3..4a86ba7a3 100644 --- a/SDL3Config.cmake.in +++ b/SDL3Config.cmake.in @@ -23,11 +23,11 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake") endif() if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3mainTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/SDL3mainTargets.cmake") - set(SDL3_SDL3main_FOUND TRUE) + set(SDL3_SDL3_main_FOUND TRUE) endif() if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake") - set(SDL3_SDL3test_FOUND TRUE) + set(SDL3_SDL3_test_FOUND TRUE) endif() check_required_components(SDL3) @@ -56,10 +56,10 @@ set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static) set(SDL3_STATIC_PRIVATE_LIBS) set(SDL3MAIN_LIBRARY) -if(TARGET SDL3::SDL3main) - set(SDL3MAIN_LIBRARY SDL3::SDL3main) - list(INSERT SDL3_LIBRARIES 0 SDL3::SDL3main) - list(INSERT SDL3_STATIC_LIBRARIES 0 SDL3::SDL3main) +if(TARGET SDL3::SDL3_main) + set(SDL3MAIN_LIBRARY SDL3::SDL3_main) + list(INSERT SDL3_LIBRARIES 0 SDL3::SDL3_main) + list(INSERT SDL3_STATIC_LIBRARIES 0 SDL3::SDL3_main) endif() -set(SDL3TEST_LIBRARY SDL3::SDL3test) +set(SDL3TEST_LIBRARY SDL3::SDL3_test) diff --git a/VisualC-GDK/SDL.sln b/VisualC-GDK/SDL.sln index 827c9ff4b..a9d9532e2 100644 --- a/VisualC-GDK/SDL.sln +++ b/VisualC-GDK/SDL.sln @@ -6,11 +6,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_main", "SDL_main\SDL_main.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}" EndProject diff --git a/VisualC-GDK/SDLmain/SDLmain.vcxproj b/VisualC-GDK/SDL_main/SDL_main.vcxproj similarity index 99% rename from VisualC-GDK/SDLmain/SDLmain.vcxproj rename to VisualC-GDK/SDL_main/SDL_main.vcxproj index df88a7741..ffa45df25 100644 --- a/VisualC-GDK/SDLmain/SDLmain.vcxproj +++ b/VisualC-GDK/SDL_main/SDL_main.vcxproj @@ -30,9 +30,9 @@ - SDL3main + SDL3_main {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - SDLmain + SDL_main 10.0 diff --git a/VisualC-GDK/SDLtest/SDLtest.vcxproj b/VisualC-GDK/SDL_test/SDL_test.vcxproj similarity index 99% rename from VisualC-GDK/SDLtest/SDLtest.vcxproj rename to VisualC-GDK/SDL_test/SDL_test.vcxproj index 9ed131a38..9be904dd6 100644 --- a/VisualC-GDK/SDLtest/SDLtest.vcxproj +++ b/VisualC-GDK/SDL_test/SDL_test.vcxproj @@ -27,9 +27,9 @@ - SDL3test + SDL3_test {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - SDLtest + SDL_test 10.0 diff --git a/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj b/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj index ca6473c8c..12c6dd867 100644 --- a/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj +++ b/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj @@ -273,7 +273,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -441,4 +441,4 @@ - \ No newline at end of file + diff --git a/VisualC-GDK/tests/testgdk/testgdk.vcxproj b/VisualC-GDK/tests/testgdk/testgdk.vcxproj index f024a89a5..23b357775 100644 --- a/VisualC-GDK/tests/testgdk/testgdk.vcxproj +++ b/VisualC-GDK/tests/testgdk/testgdk.vcxproj @@ -297,13 +297,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false @@ -398,4 +398,4 @@ copy "%(FullPath)" "$(OutDir)\" - \ No newline at end of file + diff --git a/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj b/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj index 651a346e5..9c9b21059 100644 --- a/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj +++ b/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj @@ -297,13 +297,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false @@ -392,4 +392,4 @@ copy "%(FullPath)" "$(OutDir)\" - \ No newline at end of file + diff --git a/VisualC/SDL.sln b/VisualC/SDL.sln index ebb836d47..c628ba91b 100644 --- a/VisualC/SDL.sln +++ b/VisualC/SDL.sln @@ -4,7 +4,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_main", "SDL_main\SDL_main.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "checkkeys", "tests\checkkeys\checkkeys.vcxproj", "{26828762-C95D-4637-9CB1-7F0979523813}" EndProject @@ -40,7 +40,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testshape", "tests\testshap EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3_test", "SDL_test\SDL_test.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}" EndProject diff --git a/VisualC/SDLmain/SDLmain.vcxproj b/VisualC/SDL_main/SDL_main.vcxproj similarity index 99% rename from VisualC/SDLmain/SDLmain.vcxproj rename to VisualC/SDL_main/SDL_main.vcxproj index 6da048b69..6fccbc8fc 100644 --- a/VisualC/SDLmain/SDLmain.vcxproj +++ b/VisualC/SDL_main/SDL_main.vcxproj @@ -19,9 +19,9 @@ - SDL3main + SDL3_main {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} - SDLmain + SDL_main 10.0 diff --git a/VisualC/SDLtest/SDLtest.vcxproj b/VisualC/SDL_test/SDL_test.vcxproj similarity index 97% rename from VisualC/SDLtest/SDLtest.vcxproj rename to VisualC/SDL_test/SDL_test.vcxproj index 3faca9916..a7d641936 100644 --- a/VisualC/SDLtest/SDLtest.vcxproj +++ b/VisualC/SDL_test/SDL_test.vcxproj @@ -19,9 +19,9 @@ - SDL3test + SDL3_test {DA956FD3-E143-46F2-9FE5-C77BEBC56B1A} - SDLtest + SDL_test 10.0 diff --git a/VisualC/pkg-support/cmake/sdl3-config.cmake b/VisualC/pkg-support/cmake/sdl3-config.cmake index c35d6b873..ca63e2b8c 100644 --- a/VisualC/pkg-support/cmake/sdl3-config.cmake +++ b/VisualC/pkg-support/cmake/sdl3-config.cmake @@ -48,9 +48,9 @@ set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR}") set_and_check(SDL3_BINDIR "${SDL3_PREFIX}/lib/${_sdl_arch_subdir}") set_and_check(SDL3_LIBDIR "${SDL3_PREFIX}/lib/${_sdl_arch_subdir}") -set(SDL3_LIBRARIES SDL3::SDL3main SDL3::SDL3) -set(SDL3MAIN_LIBRARY SDL3::SDL3main) -set(SDL3TEST_LIBRARY SDL3::SDL3test) +set(SDL3_LIBRARIES SDL3::SDL3_main SDL3::SDL3) +set(SDL3MAIN_LIBRARY SDL3::SDL3_main) +set(SDL3TEST_LIBRARY SDL3::SDL3_test) # All targets are created, even when some might not be requested though COMPONENTS. @@ -77,32 +77,32 @@ endif() unset(_sdl3_library) unset(_sdl3_dll_library) -set(_sdl3main_library "${SDL3_LIBDIR}/SDL3main.lib") +set(_sdl3main_library "${SDL3_LIBDIR}/SDL3_main.lib") if(EXISTS "${_sdl3main_library}") - if(NOT TARGET SDL3::SDL3main) - add_library(SDL3::SDL3main STATIC IMPORTED) - set_target_properties(SDL3::SDL3main + if(NOT TARGET SDL3::SDL3_main) + add_library(SDL3::SDL3_main STATIC IMPORTED) + set_target_properties(SDL3::SDL3_main PROPERTIES IMPORTED_LOCATION "${_sdl3main_library}" ) endif() - set(SDL3_SDL3main_FOUND TRUE) + set(SDL3_SDL3_main_FOUND TRUE) else() set(SDL3_SDL3_FOUND FALSE) endif() unset(_sdl3main_library) -set(_sdl3test_library "${SDL3_LIBDIR}/SDL3test.lib") +set(_sdl3test_library "${SDL3_LIBDIR}/SDL3_test.lib") if(EXISTS "${_sdl3test_library}") - if(NOT TARGET SDL3::SDL3test) - add_library(SDL3::SDL3test STATIC IMPORTED) - set_target_properties(SDL3::SDL3test + if(NOT TARGET SDL3::SDL3_test) + add_library(SDL3::SDL3_test STATIC IMPORTED) + set_target_properties(SDL3::SDL3_test PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SDL3_INCLUDE_DIRS}" IMPORTED_LOCATION "${_sdl3test_library}" ) endif() - set(SDL3_SDL3test_FOUND TRUE) + set(SDL3_SDL3_test_FOUND TRUE) else() set(SDL3_SDL3_FOUND FALSE) endif() diff --git a/VisualC/tests/checkkeys/checkkeys.vcxproj b/VisualC/tests/checkkeys/checkkeys.vcxproj index 3f068377b..0c0dc6520 100644 --- a/VisualC/tests/checkkeys/checkkeys.vcxproj +++ b/VisualC/tests/checkkeys/checkkeys.vcxproj @@ -194,13 +194,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/controllermap/controllermap.vcxproj b/VisualC/tests/controllermap/controllermap.vcxproj index 66d8ef1fa..971e83d33 100644 --- a/VisualC/tests/controllermap/controllermap.vcxproj +++ b/VisualC/tests/controllermap/controllermap.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false diff --git a/VisualC/tests/loopwave/loopwave.vcxproj b/VisualC/tests/loopwave/loopwave.vcxproj index c3fbf1c54..2ecd0bef4 100644 --- a/VisualC/tests/loopwave/loopwave.vcxproj +++ b/VisualC/tests/loopwave/loopwave.vcxproj @@ -194,7 +194,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false diff --git a/VisualC/tests/testatomic/testatomic.vcxproj b/VisualC/tests/testatomic/testatomic.vcxproj index 25e89048e..7cc930881 100644 --- a/VisualC/tests/testatomic/testatomic.vcxproj +++ b/VisualC/tests/testatomic/testatomic.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testautomation/testautomation.vcxproj b/VisualC/tests/testautomation/testautomation.vcxproj index d58dc0b32..eb11891bf 100644 --- a/VisualC/tests/testautomation/testautomation.vcxproj +++ b/VisualC/tests/testautomation/testautomation.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/testdraw2/testdraw2.vcxproj b/VisualC/tests/testdraw2/testdraw2.vcxproj index 08adaddc3..7cc41590b 100644 --- a/VisualC/tests/testdraw2/testdraw2.vcxproj +++ b/VisualC/tests/testdraw2/testdraw2.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false @@ -207,4 +207,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testfile/testfile.vcxproj b/VisualC/tests/testfile/testfile.vcxproj index 718a4475d..702f50558 100644 --- a/VisualC/tests/testfile/testfile.vcxproj +++ b/VisualC/tests/testfile/testfile.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj b/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj index d3710e293..f62fe2fd9 100644 --- a/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj +++ b/VisualC/tests/testgamecontroller/testgamecontroller.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false diff --git a/VisualC/tests/testgesture/testgesture.vcxproj b/VisualC/tests/testgesture/testgesture.vcxproj index 6230336df..3883762d7 100644 --- a/VisualC/tests/testgesture/testgesture.vcxproj +++ b/VisualC/tests/testgesture/testgesture.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false @@ -207,4 +207,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testgl2/testgl2.vcxproj b/VisualC/tests/testgl2/testgl2.vcxproj index 4bf138259..352ff5b2d 100644 --- a/VisualC/tests/testgl2/testgl2.vcxproj +++ b/VisualC/tests/testgl2/testgl2.vcxproj @@ -192,13 +192,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false @@ -211,4 +211,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testgles2/testgles2.vcxproj b/VisualC/tests/testgles2/testgles2.vcxproj index 060037cc1..6437faf44 100644 --- a/VisualC/tests/testgles2/testgles2.vcxproj +++ b/VisualC/tests/testgles2/testgles2.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/testjoystick/testjoystick.vcxproj b/VisualC/tests/testjoystick/testjoystick.vcxproj index 5edad3a8b..e5b08f316 100644 --- a/VisualC/tests/testjoystick/testjoystick.vcxproj +++ b/VisualC/tests/testjoystick/testjoystick.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testoverlay2/testoverlay2.vcxproj b/VisualC/tests/testoverlay2/testoverlay2.vcxproj index e412a1dc3..44ceb2107 100644 --- a/VisualC/tests/testoverlay2/testoverlay2.vcxproj +++ b/VisualC/tests/testoverlay2/testoverlay2.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false diff --git a/VisualC/tests/testplatform/testplatform.vcxproj b/VisualC/tests/testplatform/testplatform.vcxproj index c0a700862..0f8ca7fc6 100644 --- a/VisualC/tests/testplatform/testplatform.vcxproj +++ b/VisualC/tests/testplatform/testplatform.vcxproj @@ -216,7 +216,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -229,4 +229,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testpower/testpower.vcxproj b/VisualC/tests/testpower/testpower.vcxproj index 906d4350d..a03092683 100644 --- a/VisualC/tests/testpower/testpower.vcxproj +++ b/VisualC/tests/testpower/testpower.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testrendertarget/testrendertarget.vcxproj b/VisualC/tests/testrendertarget/testrendertarget.vcxproj index e9ed5defa..9ae2e66d3 100644 --- a/VisualC/tests/testrendertarget/testrendertarget.vcxproj +++ b/VisualC/tests/testrendertarget/testrendertarget.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/testrumble/testrumble.vcxproj b/VisualC/tests/testrumble/testrumble.vcxproj index 27d6170e1..6eaed2c8a 100644 --- a/VisualC/tests/testrumble/testrumble.vcxproj +++ b/VisualC/tests/testrumble/testrumble.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testscale/testscale.vcxproj b/VisualC/tests/testscale/testscale.vcxproj index a42738bd0..0c93bca5a 100644 --- a/VisualC/tests/testscale/testscale.vcxproj +++ b/VisualC/tests/testscale/testscale.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/testsensor/testsensor.vcxproj b/VisualC/tests/testsensor/testsensor.vcxproj index 5afff777b..e0955a2eb 100644 --- a/VisualC/tests/testsensor/testsensor.vcxproj +++ b/VisualC/tests/testsensor/testsensor.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false diff --git a/VisualC/tests/testshape/testshape.vcxproj b/VisualC/tests/testshape/testshape.vcxproj index 2be438bff..662bcebcd 100644 --- a/VisualC/tests/testshape/testshape.vcxproj +++ b/VisualC/tests/testshape/testshape.vcxproj @@ -188,7 +188,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testsprite2/testsprite2.vcxproj b/VisualC/tests/testsprite2/testsprite2.vcxproj index 5ef2e117f..3df89c795 100644 --- a/VisualC/tests/testsprite2/testsprite2.vcxproj +++ b/VisualC/tests/testsprite2/testsprite2.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/testsurround/testsurround.vcxproj b/VisualC/tests/testsurround/testsurround.vcxproj index 32860525e..a6b350e09 100644 --- a/VisualC/tests/testsurround/testsurround.vcxproj +++ b/VisualC/tests/testsurround/testsurround.vcxproj @@ -194,7 +194,7 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false @@ -207,4 +207,4 @@ - \ No newline at end of file + diff --git a/VisualC/tests/testvulkan/testvulkan.vcxproj b/VisualC/tests/testvulkan/testvulkan.vcxproj index 6e90fd0a5..99446d331 100644 --- a/VisualC/tests/testvulkan/testvulkan.vcxproj +++ b/VisualC/tests/testvulkan/testvulkan.vcxproj @@ -182,11 +182,11 @@ - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false diff --git a/VisualC/tests/testwm2/testwm2.vcxproj b/VisualC/tests/testwm2/testwm2.vcxproj index 81d090241..a558b55e0 100644 --- a/VisualC/tests/testwm2/testwm2.vcxproj +++ b/VisualC/tests/testwm2/testwm2.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/VisualC/tests/testyuv/testyuv.vcxproj b/VisualC/tests/testyuv/testyuv.vcxproj index 0e9e03dcb..3773a42bb 100644 --- a/VisualC/tests/testyuv/testyuv.vcxproj +++ b/VisualC/tests/testyuv/testyuv.vcxproj @@ -188,13 +188,13 @@ false true - + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false false true - + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} false false diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake index c62043a2e..a3b926a53 100644 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake @@ -61,9 +61,9 @@ if(NOT TARGET SDL3::SDL3) endif() set(SDL3_SDL3_FOUND TRUE) -if(NOT TARGET SDL3::SDL3main) - add_library(SDL3::SDL3main INTERFACE IMPORTED) +if(NOT TARGET SDL3::SDL3_main) + add_library(SDL3::SDL3_main INTERFACE IMPORTED) endif() -set(SDL3_SDL3main_FOUND TRUE) +set(SDL3_SDL3_main_FOUND TRUE) check_required_components(SDL3) diff --git a/build-scripts/androidbuildlibs.sh b/build-scripts/androidbuildlibs.sh index 39df9e551..4aa282b20 100755 --- a/build-scripts/androidbuildlibs.sh +++ b/build-scripts/androidbuildlibs.sh @@ -11,7 +11,7 @@ # NDK_LIBS_OUT= - specify alternate destination for installable # modules. # -# Note that SDLmain is not an installable module (.so) so libSDLmain.a +# Note that SDL_main is not an installable module (.so) so libSDL_main.a # can be found in $obj/local/ along with the unstripped libSDL.so. # diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index d4e488c54..f989e15b0 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -30,11 +30,11 @@ add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library") if(TEST_SHARED) find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3) if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE)) - find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3_main) endif() add_executable(gui-shared WIN32 main_gui.c) - if(TARGET SDL3::SDL3main) - target_link_libraries(gui-shared PRIVATE SDL3::SDL3main) + if(TARGET SDL3::SDL3_main) + target_link_libraries(gui-shared PRIVATE SDL3::SDL3_main) endif() target_link_libraries(gui-shared PRIVATE SDL3::SDL3) if(WIN32) @@ -62,8 +62,8 @@ if(TEST_SHARED) endif() # SDL3_LIBRARIES does not support creating a cli SDL3 application - # (it is possible that SDL3main is a stub, but we don't know for sure) - if(NOT TARGET SDL3::SDL3main) + # (it is possible that SDL3_main is a stub, but we don't know for sure) + if(NOT TARGET SDL3::SDL3_main) add_executable(cli-shared-vars main_cli.c) target_link_libraries(cli-shared-vars PRIVATE ${SDL3_LIBRARIES}) target_include_directories(cli-shared-vars PRIVATE ${SDL3_INCLUDE_DIRS}) @@ -80,11 +80,11 @@ endif() if(TEST_STATIC) find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3-static) if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE)) - find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3_main) endif() add_executable(gui-static WIN32 main_gui.c) - if(TARGET SDL3::SDL3main) - target_link_libraries(gui-static PRIVATE SDL3::SDL3main) + if(TARGET SDL3::SDL3_main) + target_link_libraries(gui-static PRIVATE SDL3::SDL3_main) endif() target_link_libraries(gui-static PRIVATE SDL3::SDL3-static) @@ -104,9 +104,9 @@ if(TEST_STATIC) add_executable(cli-static main_cli.c) target_link_libraries(cli-static PRIVATE SDL3::SDL3-static) - # SDL3_LIBRARIES does not support creating a cli SDL3 application (when SDL3::SDL3main is available) - # (it is possible that SDL3main is a stub, but we don't know for sure) - if(NOT TARGET SDL3::SDL3main) + # SDL3_LIBRARIES does not support creating a cli SDL3 application (when SDL3::SDL3_main is available) + # (it is possible that SDL3_main is a stub, but we don't know for sure) + if(NOT TARGET SDL3::SDL3_main) add_executable(cli-static-vars main_cli.c) target_link_libraries(cli-static-vars PRIVATE ${SDL3_STATIC_LIBRARIES}) target_include_directories(cli-static-vars PRIVATE ${SDL3_INCLUDE_DIRS}) diff --git a/cmake/test/jni/Android.mk b/cmake/test/jni/Android.mk index 393498857..725a32cbd 100644 --- a/cmake/test/jni/Android.mk +++ b/cmake/test/jni/Android.mk @@ -7,5 +7,5 @@ LOCAL_SRC_FILES := ../main_gui.c LOCAL_SHARED_LIBRARIES += SDL3 include $(BUILD_SHARED_LIBRARY) -$(call import-module,SDL3main) +$(call import-module,SDL3_main) $(call import-module,SDL3) diff --git a/docs/README-android.md b/docs/README-android.md index 93624c73c..a232a3e9e 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -83,8 +83,8 @@ If you already have a project that uses CMake, the instructions change somewhat: 2. Edit "/app/build.gradle" to comment out or remove sections containing ndk-build and uncomment the cmake sections. Add arguments to the CMake invocation as needed. 3. Edit "/app/jni/CMakeLists.txt" to include your project (it defaults to - adding the "src" subdirectory). Note that you'll have SDL3, SDL3main and SDL3-static - as targets in your project, so you should have "target_link_libraries(yourgame SDL3 SDL3main)" + adding the "src" subdirectory). Note that you'll have SDL3, SDL3_main and SDL3-static + as targets in your project, so you should have "target_link_libraries(yourgame SDL3 SDL3_main)" in your CMakeLists.txt file. Also be aware that you should use add_library() instead of add_executable() for the target containing your "main" function. diff --git a/docs/README-cmake.md b/docs/README-cmake.md index 7899869f3..b84345aad 100644 --- a/docs/README-cmake.md +++ b/docs/README-cmake.md @@ -60,17 +60,17 @@ else() # 1. Look for a SDL3 package, 2. look for the SDL3 component and 3. fail if none can be found find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3) - # 1. Look for a SDL3 package, 2. Look for the SDL3maincomponent and 3. DO NOT fail when SDL3main is not available - find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) + # 1. Look for a SDL3 package, 2. Look for the SDL3_maincomponent and 3. DO NOT fail when SDL3_main is not available + find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3_main) endif() # Create your game executable target as usual add_executable(mygame WIN32 mygame.c) -# SDL3::SDL3main may or may not be available. It is e.g. required by Windows GUI applications -if(TARGET SDL3::SDL3main) +# SDL3::SDL3_main may or may not be available. It is e.g. required by Windows GUI applications +if(TARGET SDL3::SDL3_main) # It has an implicit dependency on SDL3 functions, so it MUST be added before SDL3::SDL3 (or SDL3::SDL3-static) - target_link_libraries(mygame PRIVATE SDL3::SDL3main) + target_link_libraries(mygame PRIVATE SDL3::SDL3_main) endif() # Link to the actual SDL3 library. SDL3::SDL3 is the shared SDL library, SDL3::SDL3-static is the static SDL libarary. @@ -87,8 +87,9 @@ The following components are available, to be used as an argument of `find_packa |----------------|--------------------------------------------------------------------------------------------| | SDL3 | The SDL3 shared library, available through the `SDL3::SDL3` target [^SDL_TARGET_EXCEPTION] | | SDL3-static | The SDL3 static library, available through the `SDL3::SDL3-static` target | -| SDL3main | The SDL3main static library, available through the `SDL3::SDL3main` target | -| SDL3test | The SDL3test static library, available through the `SDL3::SDL3test` target | +| SDL3_main | The SDL3_main static library, available through the `SDL3::SDL3_main` target | +| SDL3_test | The SDL3_test static library, available through the `SDL3::SDL3_test` target | + ### Using a vendored SDL diff --git a/docs/README-gdk.md b/docs/README-gdk.md index e172adf07..32ab1412c 100644 --- a/docs/README-gdk.md +++ b/docs/README-gdk.md @@ -25,7 +25,7 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers * Initializing/uninitializing the game runtime, and initializing Xbox Live services * Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue. - * An implementation on `WinMain` that performs the above GDK setup (you should link against SDL3main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. + * An implementation on `WinMain` that performs the above GDK setup (you should link against SDL3_main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. * Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`). * You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak). @@ -37,7 +37,7 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration: * SDL3 (DLL) - This is the typical SDL3.dll, but for Gaming.Desktop.x64. -* SDL3main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs. +* SDL3_main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs. * tests/testgamecontroller - Standard SDL test program demonstrating controller functionality. * tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live. *NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this. @@ -54,21 +54,21 @@ These steps assume you already have a game using SDL that runs on Windows x64 al In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration. -### 2. Build SDL3 and SDL3main for GDK ### +### 2. Build SDL3 and SDL3_main for GDK ### -Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL3 and SDL3main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL3.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL3.lib`, and `SDL3main.lib` output files for your game project. +Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL3 and SDL3_main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL3.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL3.lib`, and `SDL3_main.lib` output files for your game project. -*Alternatively*, you could setup your solution file to instead reference the SDL3/SDL3main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL3 and SDL3main would both be built when your game is built. +*Alternatively*, you could setup your solution file to instead reference the SDL3/SDL3_main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL3 and SDL3_main would both be built when your game is built. ### 3. Configuring Project Settings ### While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration: * Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced -* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL3.lib and SDL3main.lib are +* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL3.lib and SDL3_main.lib are * Under Linker > Input > Additional Dependencies, you need the following: * `SDL3.lib` - * `SDL3main.lib` (unless not using) + * `SDL3_main.lib` (unless not using) * `xgameruntime.lib` * `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib` * Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK. diff --git a/docs/README-migration.md b/docs/README-migration.md index 0eea90210..9346b3d47 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -9,9 +9,9 @@ SDL headers should now be included as `#include `. Typically that's CMake users should use this snippet to include SDL support in their project: ``` find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3) -find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main) -if(TARGET SDL3::SDL3main) - target_link_libraries(mygame PRIVATE SDL3::SDL3main) +find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3_main) +if(TARGET SDL3::SDL3_main) + target_link_libraries(mygame PRIVATE SDL3::SDL3_main) endif() target_link_libraries(mygame PRIVATE SDL3::SDL3) ``` @@ -28,6 +28,8 @@ CFLAGS += $(shell pkg-config sdl3 --cflags) LDFLAGS += $(shell pkg-config sdl3 --libs) ``` +The SDL3main and SDL3test libraries have been renamed SDL3_main and SDL3_test, respectively. + ## SDL_platform.h diff --git a/docs/README-n3ds.md b/docs/README-n3ds.md index 1fa8e15a6..647720bc8 100644 --- a/docs/README-n3ds.md +++ b/docs/README-n3ds.md @@ -22,6 +22,6 @@ cmake --install build ## Notes - Currently only software rendering is supported. -- SDL3main should be used to ensure ROMFS is enabled. +- SDL3_main should be used to ensure ROMFS is enabled. - By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function. - `SDL_GetBasePath` returns the romfs root instead of the executable's directory. diff --git a/docs/README-visualc.md b/docs/README-visualc.md index 04ab63ff8..8759843d8 100644 --- a/docs/README-visualc.md +++ b/docs/README-visualc.md @@ -29,7 +29,7 @@ Later, we will refer to the following `.lib` and `.dll` files that have just bee - `./VisualC/Win32/Debug/SDL3.dll` or `./VisualC/Win32/Release/SDL3.dll` - `./VisualC/Win32/Debug/SDL3.lib` or `./VisualC/Win32/Release/SDL3.lib` -- `./VisualC/Win32/Debug/SDL3main.lib` or `./VisualC/Win32/Release/SDL3main.lib` +- `./VisualC/Win32/Debug/SDL3_main.lib` or `./VisualC/Win32/Release/SDL3_main.lib` _Note for the `x64` versions, just replace `Win32` in the path with `x64`_ @@ -64,7 +64,7 @@ Copy the following file into your Project directory: Add the following files to your project (It is not necessary to copy them to your project directory): - `SDL3.lib` -- `SDL3main.lib` +- `SDL3_main.lib` To add them to your project, right click on your project, and select `Add files to project`. diff --git a/docs/README-winrt.md b/docs/README-winrt.md index 68271cc65..3d7cfea03 100644 --- a/docs/README-winrt.md +++ b/docs/README-winrt.md @@ -71,7 +71,7 @@ Here is a rough list of what works, and what doesn't: well as many keys with documented hardware scancodes. Converting SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs (MapVirtualKey()) in Microsoft's Windows Store / UWP APIs. - * SDLmain. WinRT uses a different signature for each app's main() function. + * SDL_main. WinRT uses a different signature for each app's main() function. SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp (in `SDL\src\main\winrt\`) directly in order for their C-style main() functions to be called. diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h index 01dfe0391..25818b820 100644 --- a/include/SDL3/SDL_main.h +++ b/include/SDL3/SDL_main.h @@ -55,7 +55,7 @@ /* On GDK, SDL provides a main function that initializes the game runtime. Please note that #include'ing SDL_main.h is not enough to get a main() - function working. You must either link against SDL3main or, if not possible, + function working. You must either link against SDL3_main or, if not possible, call the SDL_GDKRunApp function from your entry point. */ #define SDL_MAIN_NEEDED @@ -65,7 +65,7 @@ and starts the iOS application run loop. If you link with SDL dynamically on iOS, the main function can't be in a - shared library, so you need to link with libSDLmain.a, which includes a + shared library, so you need to link with libSDL_main.a, which includes a stub main function that calls into the shared library to start execution. See src/video/uikit/SDL_uikitappdelegate.m for more details. diff --git a/src/main/psp/SDL_psp_main.c b/src/main/psp/SDL_psp_main.c index c2bda9f65..a06cbbac3 100644 --- a/src/main/psp/SDL_psp_main.c +++ b/src/main/psp/SDL_psp_main.c @@ -12,7 +12,7 @@ #undef main #endif -/* If application's main() is redefined as SDL_main, and libSDLmain is +/* If application's main() is redefined as SDL_main, and libSDL_main is linked, then this file will create the standard exit callback, define the PSP_MODULE_INFO macro, and exit back to the browser when the program is finished. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 52018fa89..5ca2f19ae 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,7 +24,7 @@ macro(add_sdl_test_executable TARGET) endmacro() if(NOT TARGET SDL3::SDL3-static) - find_package(SDL3 3.0.0 REQUIRED COMPONENTS SDL3-static SDL3test) + find_package(SDL3 3.0.0 REQUIRED COMPONENTS SDL3-static SDL3_test) endif() enable_testing() @@ -34,13 +34,13 @@ if(SDL_INSTALL_TESTS) endif() if(N3DS) - link_libraries(SDL3::SDL3main) + link_libraries(SDL3::SDL3_main) endif() if(PSP) link_libraries( - SDL3::SDL3main - SDL3::SDL3test + SDL3::SDL3_main + SDL3::SDL3_test SDL3::SDL3-static GL pspvram @@ -55,7 +55,7 @@ if(PSP) ) elseif(PS2) link_libraries( - SDL3main + SDL3_main SDL3_test SDL3-static patches @@ -64,11 +64,11 @@ link_libraries( ps2_drivers ) else() - link_libraries(SDL3::SDL3test SDL3::SDL3-static) + link_libraries(SDL3::SDL3_test SDL3::SDL3-static) endif() if(WINDOWS) - # mingw32 must come before SDL3main to link successfully + # mingw32 must come before SDL3_main to link successfully if(MINGW OR CYGWIN) link_libraries(mingw32) endif() @@ -80,7 +80,7 @@ if(WINDOWS) # FIXME: Parent directory CMakeLists.txt only sets these for mingw/cygwin, # but we need them for VS as well. - link_libraries(SDL3main) + link_libraries(SDL3_main) add_definitions(-Dmain=SDL_main) endif()