Merge commit '411251c6242b04119edc41ce83f09f0714e2d32b' as 'external/SDL'

This commit is contained in:
2026-05-13 17:47:57 +02:00
2245 changed files with 975842 additions and 0 deletions
+914
View File
@@ -0,0 +1,914 @@
#
# CMake script for building the SDL tests
#
cmake_minimum_required(VERSION 3.16)
if(NOT DEFINED CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()
set(SDL3_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake")
include(CheckIncludeFile)
include(CheckStructHasMember)
include(CMakePushCheckState)
include(sdlcompilers)
find_package(Python3 COMPONENTS Interpreter)
if(NOT PYTHON3_EXECUTABLE)
set(PYTHON3_EXECUTABLE "python3")
endif()
if(SDL_TESTS_LINK_SHARED)
set(sdl_name_component SDL3-shared)
else()
set(sdl_name_component SDL3-static)
endif()
set(HAVE_TESTS_LINK_SHARED "${SDL_TESTS_LINK_SHARED}" PARENT_SCOPE)
# CMake incorrectly detects opengl32.lib being present on MSVC ARM64
if(NOT (MSVC AND SDL_CPU_ARM64))
# Prefer GLVND, if present
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL)
endif()
add_library(sdltests_utils OBJECT
testutils.c
)
target_link_libraries(sdltests_utils PRIVATE SDL3::Headers)
file(GLOB RESOURCE_FILES *.png *.wav *.csv *.hex moose.dat utf8.txt)
option(SDLTEST_TRACKMEM "Run tests with --trackmem" OFF)
if(WIN32)
option(SDLTEST_PROCDUMP "Run tests using sdlprocdump for minidump generation" OFF)
add_executable(sdlprocdump win32/sdlprocdump.c)
SDL_AddCommonCompilerFlags(sdlprocdump)
if(SDLTEST_PROCDUMP)
set(CMAKE_TEST_LAUNCHER "$<TARGET_FILE:sdlprocdump>;--")
else()
set_property(TARGET sdlprocdump PROPERTY EXCLUDE_FROM_ALL "1")
endif()
else()
option(SDLTEST_GDB "Run tests using headless gdb" OFF)
find_program(GDB_BIN NAMES "gdb")
if(SDLTEST_GDB AND GDB_BIN)
set(CMAKE_TEST_LAUNCHER "${GDB_BIN};-batch;-nx;-x;${CMAKE_CURRENT_SOURCE_DIR}/unix/gdbcmds.txt;--args")
endif()
endif()
if(EMSCRIPTEN)
set(SDLTEST_BROWSER "firefox" CACHE STRING "Browser in which to run SDL unit tests (chrome or firefox)")
set(SDLTEST_PORT "8080" CACHE STRING "Port on which to serve the tests")
set(SDLTEST_CHROME_BINARY "" CACHE STRING "Chrome/Chromium browser binary (optional)")
if(TARGET Python3::Interpreter)
add_custom_target(serve-sdl-tests
COMMAND Python3::Interpreter "${CMAKE_CURRENT_SOURCE_DIR}/emscripten/server.py"
"${SDLTEST_PORT}"
-d "${CMAKE_CURRENT_BINARY_DIR}"
--map "${SDL3_SOURCE_DIR}:/SDL")
endif()
endif()
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(test_bin_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
if(NOT IS_ABSOLUTE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
endif()
else()
set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}")
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.20)
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set(test_bin_dir "${test_bin_dir}$<$<BOOL:${is_multi_config}>:/$<CONFIG>>")
endif()
if(DOS)
set(NAME83_LONG "unifont-15.1.05.hex;unifont-15.1.05-license.txt;physaudiodev.png;logaudiodev.png;audiofile.png;soundboard.png;soundboard_levels.png;trashcan.png;msdf_font.png;msdf_font.csv;gamepad_front.png;gamepad_back.png;gamepad_face_abxy.png;gamepad_face_axby.png;gamepad_face_bayx.png;gamepad_face_sony.png;gamepad_battery.png;gamepad_battery_unknown.png;gamepad_battery_wired.png;gamepad_touchpad.png;gamepad_button.png;gamepad_button_small.png;gamepad_button_background.png;gamepad_axis.png;gamepad_axis_arrow.png;gamepad_wired.png;gamepad_wireless.png;sdl-test_round.png")
set(DOS83_SHORT "UNIFONT.HEX;UNIFONTL.TXT;PHYSADEV.PNG;LOGADEV.PNG;AUDIOFIL.PNG;SNDBRD.PNG;SNDLVL.PNG;TRASHCAN.PNG;MSDFFONT.PNG;MSDFFONT.CSV;GP_FRONT.PNG;GP_BACK.PNG;GP_FABXY.PNG;GP_FAXBY.PNG;GP_FBAYX.PNG;GP_FSONY.PNG;GP_BATT.PNG;GP_BATTX.PNG;GP_BATTW.PNG;GP_TOUCH.PNG;GP_BTN.PNG;GP_BTNSM.PNG;GP_BTNBG.PNG;GP_AXIS.PNG;GP_AXARW.PNG;GP_WIRED.PNG;GP_WLESS.PNG;SDLROUND.PNG")
endif()
set(RESOURCE_FILE_NAMES)
set(RESOURCE_FILES_BINDIR)
foreach(resource_file IN LISTS RESOURCE_FILES)
get_filename_component(res_file_name ${resource_file} NAME)
set(output_name "${res_file_name}")
if(DOS)
list(FIND DOS83_LONG "${res_file_name}" _dos83_idx)
if(NOT _dos83_idx EQUAL -1)
list(GET DOS83_SHORT ${_dos83_idx} output_name)
endif()
endif()
list(APPEND RESOURCE_FILE_NAMES "${output_name}")
set(resource_file_bindir "${test_bin_dir}/${output_name}")
set(depends_resource_file "${resource_file}")
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
set(depends_resource_file "${CMAKE_CURRENT_LIST_FILE}")
endif()
add_custom_command(OUTPUT "${resource_file_bindir}"
COMMAND "${CMAKE_COMMAND}" -E copy "${resource_file}" "${resource_file_bindir}"
DEPENDS "${depends_resource_file}"
)
list(APPEND RESOURCE_FILES_BINDIR "${resource_file_bindir}")
endforeach()
add_custom_target(copy-sdl-test-resources
DEPENDS "${RESOURCE_FILES_BINDIR}"
)
define_property(TARGET PROPERTY SDL_NONINTERACTIVE BRIEF_DOCS "If true, target is a non-interactive test executable." FULL_DOCS "If true, target is a noninteractive test executable.")
define_property(TARGET PROPERTY SDL_NONINTERACTIVE_ARGUMENTS BRIEF_DOCS "Argument(s) to run executable in non-interactive mode." FULL_DOCS "Argument(s) to run executable in non-interactive mode.")
define_property(TARGET PROPERTY SDL_NONINTERACTIVE_TIMEOUT BRIEF_DOCS "Timeout for noninteractive executable." FULL_DOCS "Timeout for noninteractive executable.")
if(HAVE_X11)
find_package(X11 QUIET)
if(NOT TARGET X11::X11)
set(HAVE_X11 OFF)
endif()
endif()
if(HAVE_WAYLAND)
find_package(PkgConfig QUIET)
pkg_check_modules(PkgWaylandClient QUIET IMPORTED_TARGET wayland-client)
if(NOT TARGET PkgConfig::PkgWaylandClient)
set(HAVE_WAYLAND OFF)
endif()
endif()
function(add_sdl_test_executable TARGET)
cmake_parse_arguments(AST "BUILD_DEPENDENT;NONINTERACTIVE;NEEDS_RESOURCES;TESTUTILS;THREADS;MAIN_CALLBACKS;NOTRACKMEM" "NAME83" "DEPENDS;DISABLE_THREADS_ARGS;NONINTERACTIVE_TIMEOUT;NONINTERACTIVE_ARGS;INSTALLED_ARGS;SOURCES" ${ARGN})
if(AST_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown argument(s): ${AST_UNPARSED_ARGUMENTS}")
endif()
if(NOT AST_SOURCES)
message(FATAL_ERROR "add_sdl_test_executable needs at least one source")
endif()
if(AST_TESTUTILS)
list(APPEND AST_SOURCES $<TARGET_OBJECTS:sdltests_utils>)
endif()
set(EXTRA_SOURCES "")
if(AST_NEEDS_RESOURCES)
list(APPEND EXTRA_SOURCES ${RESOURCE_FILES})
endif()
if(ANDROID)
add_library(${TARGET} SHARED ${AST_SOURCES} ${EXTRA_SOURCES})
else()
add_executable(${TARGET} ${AST_SOURCES} ${EXTRA_SOURCES})
endif()
target_compile_definitions(${TARGET} PRIVATE HAVE_BUILD_CONFIG)
SDL_AddCommonCompilerFlags(${TARGET})
target_include_directories(${TARGET} PRIVATE "${SDL3_SOURCE_DIR}/src/video/khronos")
target_link_libraries(${TARGET} PRIVATE SDL3::SDL3_test SDL3::${sdl_name_component})
if(AST_DEPENDS)
add_dependencies(${TARGET} ${AST_DEPENDS})
endif()
set_propertY(TARGET ${TARGET} PROPERTY SDL_INSTALL "1")
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY SDL_TEST_EXECUTABLES "${TARGET}")
set_property(TARGET ${TARGET} PROPERTY SDL_NOTRACKMEM ${AST_NOTRACKMEM})
if(AST_NONINTERACTIVE)
set_property(TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE 1)
endif()
set_property(TARGET ${TARGET} PROPERTY SDL_DISABLE_THREADS_ARGS "${AST_DISABLE_THREADS_ARGS}")
set_property(TARGET ${TARGET} PROPERTY SDL_THREADS "${AST_THREADS}")
if(AST_NONINTERACTIVE_ARGS)
set_property(TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE_ARGUMENTS "${AST_NONINTERACTIVE_ARGS}")
endif()
if(AST_INSTALLED_ARGS)
set_property(TARGET ${TARGET} PROPERTY SDL_INSTALLED_ARGUMENTS "${AST_INSTALLED_ARGS}")
elseif(AST_NONINTERACTIVE_ARGS)
set_property(TARGET ${TARGET} PROPERTY SDL_INSTALLED_ARGUMENTS "${AST_NONINTERACTIVE_ARGS}")
endif()
if(AST_NONINTERACTIVE_TIMEOUT)
set_property(TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE_TIMEOUT "${AST_NONINTERACTIVE_TIMEOUT}")
endif()
if(AST_NEEDS_RESOURCES)
if(PSP OR PS2 OR N3DS)
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory $<TARGET_FILE_DIR:${TARGET}>/sdl-${TARGET}
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILES} $<TARGET_FILE_DIR:${TARGET}>/sdl-${TARGET})
else()
add_dependencies(${TARGET} copy-sdl-test-resources)
endif()
if(APPLE)
# Make sure resource files get installed into macOS/iOS .app bundles.
set_target_properties(${TARGET} PROPERTIES RESOURCE "${RESOURCE_FILES}")
endif()
if(EMSCRIPTEN)
foreach(res IN LISTS RESOURCE_FILES)
get_filename_component(res_name "${res}" NAME)
target_link_options(${TARGET} PRIVATE "SHELL:--embed-file ${res}@${res_name}")
set_property(TARGET ${TARGET} APPEND PROPERTY LINK_DEPENDS "${res}")
endforeach()
endif()
set_property(TARGET ${TARGET} APPEND PROPERTY ADDITIONAL_CLEAN_FILES "$<TARGET_FILE_DIR:${TARGET}>/$<JOIN:${RESOURCE_FILE_NAMES},$<SEMICOLON>$<TARGET_FILE_DIR:${TARGET}>/>")
endif()
if(AST_BUILD_DEPENDENT)
target_include_directories(${TARGET} BEFORE PRIVATE $<TARGET_PROPERTY:SDL3::${sdl_name_component},INCLUDE_DIRECTORIES>)
target_include_directories(${TARGET} BEFORE PRIVATE ${SDL3_SOURCE_DIR}/src)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
target_include_directories(${TARGET} AFTER PRIVATE "${SDL3_SOURCE_DIR}/include/build_config")
endif()
endif()
if(WINDOWS)
# CET support was added in VS 16.7
if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64")
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -CETCOMPAT")
endif()
elseif(PSP)
target_link_libraries(${TARGET} PRIVATE GL)
elseif(EMSCRIPTEN)
set_property(TARGET ${TARGET} PROPERTY SUFFIX ".html")
target_link_options(${TARGET} PRIVATE "SHELL:--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/emscripten/pre.js")
target_link_options(${TARGET} PRIVATE "-sEXIT_RUNTIME=1")
set_property(TARGET ${TARGET} APPEND PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/emscripten/pre.js")
set_property(TARGET ${TARGET} APPEND PROPERTY EXTRA_INSTALL
"$<TARGET_FILE_DIR:${TARGET}>/$<TARGET_FILE_BASE_NAME:${TARGET}>.js"
"$<TARGET_FILE_DIR:${TARGET}>/$<TARGET_FILE_BASE_NAME:${TARGET}>.wasm"
"$<TARGET_FILE_DIR:${TARGET}>/$<TARGET_FILE_BASE_NAME:${TARGET}>.wasm.map")
elseif(NGAGE)
string(MD5 TARGET_MD5 "${TARGET}")
string(SUBSTRING "${TARGET_MD5}" 0 8 TARGET_MD5_8)
target_link_options(${TARGET} PRIVATE "SHELL:-s UID3=0x${TARGET_MD5_8}")
if(NOT AST_MAIN_CALLBACKS)
set_property(TARGET ${TARGET} PROPERTY "EXCLUDE_FROM_ALL" "1")
set_propertY(TARGET ${TARGET} PROPERTY SDL_INSTALL "0")
endif()
elseif(DOS)
if(AST_NAME83)
set_property(TARGET ${TARGET} PROPERTY OUTPUT_NAME "${AST_NAME83}")
endif()
endif()
if(OPENGL_FOUND)
target_compile_definitions(${TARGET} PRIVATE HAVE_OPENGL)
endif()
# FIXME: only add "${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>" + include paths of external dependencies
target_include_directories(${TARGET} PRIVATE "$<TARGET_PROPERTY:SDL3::${sdl_name_component},INCLUDE_DIRECTORIES>")
endfunction()
check_include_file(signal.h LIBC_HAS_SIGNAL_H)
if(LIBC_HAS_SIGNAL_H)
add_definitions(-DHAVE_SIGNAL_H)
endif()
check_include_file(libudev.h HAVE_LIBUDEV_H)
if(HAVE_LIBUDEV_H)
add_definitions(-DHAVE_LIBUDEV_H)
endif()
function(files2headers OUTPUT)
set(xxd "${SDL3_SOURCE_DIR}/cmake/xxd.py")
set(inputs ${ARGN})
set(outputs )
foreach(input IN LISTS inputs)
get_filename_component(file_we "${input}" NAME_WE)
set(intermediate "${CMAKE_CURRENT_BINARY_DIR}/${file_we}.h")
set(output "${CMAKE_CURRENT_SOURCE_DIR}/${file_we}.h")
list(APPEND outputs "${output}")
if(TARGET Python3::Interpreter AND NOT CMAKE_CROSSCOMPILING)
list(APPEND outputs "${intermediate}")
# Don't add the 'output' header to the output, to avoid marking them as GENERATED
# (generated files are removed when running the CLEAN target)
add_custom_command(OUTPUT "${intermediate}"
COMMAND Python3::Interpreter "${xxd}" -i "${CMAKE_CURRENT_SOURCE_DIR}/${input}" "-o" "${intermediate}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${intermediate}" "${output}"
DEPENDS "${xxd}" "${png}"
)
endif()
endforeach()
set(${OUTPUT} "${outputs}" PARENT_SCOPE)
add_custom_target(generate-${OUTPUT} DEPENDS ${outputs})
endfunction()
files2headers(gamepad_image_headers
gamepad_axis_arrow.png
gamepad_axis.png
gamepad_back.png
gamepad_battery.png
gamepad_battery_wired.png
gamepad_button_background.png
gamepad_button.png
gamepad_button_small.png
gamepad_face_abxy.png
gamepad_face_axby.png
gamepad_face_bayx.png
gamepad_face_sony.png
gamepad_front.png
gamepad_touchpad.png
gamepad_wired.png
gamepad_wireless.png
)
files2headers(icon_png_header icon.png)
files2headers(glass_png_header glass.png)
set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE)
include("${CMAKE_CURRENT_LIST_DIR}/../cmake/FindFFmpeg.cmake")
if(FFmpeg_FOUND)
cmake_push_check_state()
list(APPEND CMAKE_REQUIRED_INCLUDES "${FFmpeg_AVUTIL_INCLUDE_DIRS}")
list(APPEND CMAKE_REQUIRED_INCLUDES "${SDL3_SOURCE_DIR}/src/video/khronos")
check_struct_has_member("AVFrame" "ch_layout" "libavutil/frame.h" LIBAVUTIL_AVFRAME_HAS_CH_LAYOUT)
check_struct_has_member("AVVulkanFramesContext" "format" "libavutil/hwcontext_vulkan.h" LIBAVUTIL_AVFULKANFRAMESCONTEXT_HAS_FORMAT)
cmake_pop_check_state()
endif()
if(FFmpeg_FOUND AND LIBAVUTIL_AVFRAME_HAS_CH_LAYOUT)
add_sdl_test_executable(testffmpeg SOURCES testffmpeg.c testffmpeg_vulkan.c ${icon_png_header} DEPENDS generate-icon_png_header)
if(LIBAVUTIL_AVFULKANFRAMESCONTEXT_HAS_FORMAT)
target_compile_definitions(testffmpeg PRIVATE FFMPEG_VULKAN_SUPPORT)
endif()
if(APPLE)
target_link_options(testffmpeg PRIVATE "-Wl,-framework,CoreVideo")
endif()
if(TARGET OpenGL::EGL)
message(DEBUG "Enabling EGL support in testffmpeg")
target_link_libraries(testffmpeg PRIVATE OpenGL::EGL)
target_compile_definitions(testffmpeg PRIVATE HAVE_EGL)
endif()
target_include_directories(testffmpeg SYSTEM BEFORE PRIVATE ${SDL3_SOURCE_DIR}/src/video/khronos)
target_link_libraries(testffmpeg PRIVATE ${FFMPEG_LIBRARIES})
else()
message(STATUS "Can't find ffmpeg 5.1.3 or newer, skipping testffmpeg")
endif()
add_sdl_test_executable(checkkeys SOURCES checkkeys.c NAME83 chkkeys)
add_sdl_test_executable(loopwave NEEDS_RESOURCES TESTUTILS MAIN_CALLBACKS SOURCES loopwave.c)
add_sdl_test_executable(testsurround SOURCES testsurround.c NAME83 surround)
add_sdl_test_executable(testresample NEEDS_RESOURCES SOURCES testresample.c NAME83 resample)
add_sdl_test_executable(testaudioinfo SOURCES testaudioinfo.c NAME83 audioinf)
add_sdl_test_executable(testaudiostreamdynamicresample NEEDS_RESOURCES TESTUTILS SOURCES testaudiostreamdynamicresample.c NAME83 audynres)
file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c)
add_sdl_test_executable(testautomation NONINTERACTIVE NONINTERACTIVE_TIMEOUT 120 NEEDS_RESOURCES BUILD_DEPENDENT SOURCES ${TESTAUTOMATION_SOURCE_FILES} NAME83 automat)
if(EMSCRIPTEN)
target_link_options(testautomation PRIVATE -sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb)
endif()
add_sdl_test_executable(testmultiaudio NEEDS_RESOURCES TESTUTILS SOURCES testmultiaudio.c NAME83 multaudi)
add_sdl_test_executable(testaudiohotplug NEEDS_RESOURCES TESTUTILS SOURCES testaudiohotplug.c NAME83 audhotpl)
add_sdl_test_executable(testaudiorecording MAIN_CALLBACKS SOURCES testaudiorecording.c NAME83 aurecord)
add_sdl_test_executable(testatomic NONINTERACTIVE DISABLE_THREADS_ARGS "--no-threads" SOURCES testatomic.c NAME83 atomic)
add_sdl_test_executable(testintersections SOURCES testintersections.c NAME83 intersec)
add_sdl_test_executable(testrelative SOURCES testrelative.c NAME83 relative)
add_sdl_test_executable(testhittesting SOURCES testhittesting.c NAME83 hittest)
add_sdl_test_executable(testdraw SOURCES testdraw.c NAME83 draw)
add_sdl_test_executable(testdrawchessboard SOURCES testdrawchessboard.c NAME83 drawches)
add_sdl_test_executable(testdropfile MAIN_CALLBACKS SOURCES testdropfile.c NAME83 dropfile)
add_sdl_test_executable(testerror NONINTERACTIVE DISABLE_THREADS_ARGS "--no-threads" SOURCES testerror.c NAME83 error)
add_sdl_test_executable(testsymbols NONINTERACTIVE NOTRACKMEM NONINTERACTIVE_ARGS 0 10 20 40 80 160 320 640 SOURCES testsymbols.c NAME83 symbols)
set(build_options_dependent_tests )
add_sdl_test_executable(testevdev BUILD_DEPENDENT NONINTERACTIVE SOURCES testevdev.c NAME83 evdev)
if(MACOS)
add_sdl_test_executable(testnative BUILD_DEPENDENT NEEDS_RESOURCES TESTUTILS
SOURCES
testnative.c
testnativecocoa.m
testnativex11.c
)
elseif(WINDOWS)
add_sdl_test_executable(testnative BUILD_DEPENDENT NEEDS_RESOURCES TESTUTILS SOURCES testnative.c testnativew32.c)
elseif(HAVE_X11 OR HAVE_WAYLAND)
add_sdl_test_executable(testnative BUILD_DEPENDENT NEEDS_RESOURCES TESTUTILS SOURCES testnative.c)
if(HAVE_X11)
target_sources(testnative PRIVATE testnativex11.c)
target_link_libraries(testnative PRIVATE X11::X11)
endif()
if(HAVE_WAYLAND)
set_property(SOURCE ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c PROPERTY GENERATED 1)
target_sources(testnative PRIVATE testnativewayland.c "${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c")
# Needed to silence the documentation warning in the generated header file
target_compile_options(testnative PRIVATE -Wno-documentation-unknown-command)
target_link_libraries(testnative PRIVATE PkgConfig::PkgWaylandClient)
endif ()
endif()
add_sdl_test_executable(testasyncio MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testasyncio.c NAME83 asyncio)
add_sdl_test_executable(testaudio MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testaudio.c NAME83 audio)
add_sdl_test_executable(testcolorspace SOURCES testcolorspace.c NAME83 colorspc)
add_sdl_test_executable(testfile NONINTERACTIVE SOURCES testfile.c)
add_sdl_test_executable(testcontroller TESTUTILS SOURCES testcontroller.c gamepadutils.c ${gamepad_image_headers} DEPENDS generate-gamepad_image_headers NAME83 control)
add_sdl_test_executable(testdlopennote TESTUTILS SOURCES testdlopennote.c NAME83 dlnote)
add_sdl_test_executable(testgeometry TESTUTILS SOURCES testgeometry.c NAME83 geometry)
add_sdl_test_executable(testgl SOURCES testgl.c NAME83 gl)
add_sdl_test_executable(testgles SOURCES testgles.c NAME83 tstgles NAME83 gles)
add_sdl_test_executable(testgpu_simple_clear SOURCES testgpu_simple_clear.c NAME83 gpuclear)
add_sdl_test_executable(testgpu_spinning_cube SOURCES testgpu_spinning_cube.c ${icon_png_header} DEPENDS generate-icon_png_header NAME83 gpucube)
add_sdl_test_executable(testgpurender_effects MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testgpurender_effects.c NAME83 gpufx)
add_sdl_test_executable(testgpurender_msdf MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testgpurender_msdf.c NAME83 gpumsdf)
add_sdl_test_executable(testgpu_spinning_cube_xr SOURCES testgpu_spinning_cube_xr.c NAME83 gpucubxr)
if(ANDROID)
target_link_libraries(testgles PRIVATE GLESv1_CM)
elseif(IOS OR TVOS)
find_library(GLES_LIB OpenGLES REQUIRED)
target_link_libraries(testgles PRIVATE "${GLES_LIB}")
endif()
add_sdl_test_executable(testgles2 SOURCES testgles2.c NAME83 gles2)
add_sdl_test_executable(testhaptic SOURCES testhaptic.c NAME83 haptic)
add_sdl_test_executable(testhotplug SOURCES testhotplug.c NAME83 hotplug)
add_sdl_test_executable(testpen SOURCES testpen.c NAME83 pen)
add_sdl_test_executable(testrumble SOURCES testrumble.c NAME83 rumble)
add_sdl_test_executable(testthread NONINTERACTIVE THREADS NONINTERACTIVE_TIMEOUT 40 SOURCES testthread.c NAME83 thread)
add_sdl_test_executable(testiconv NEEDS_RESOURCES TESTUTILS SOURCES testiconv.c NAME83 iconv)
add_sdl_test_executable(testime NEEDS_RESOURCES TESTUTILS SOURCES testime.c NAME83 ime)
add_sdl_test_executable(testkeys SOURCES testkeys.c NAME83 keys)
add_sdl_test_executable(testloadso SOURCES testloadso.c NAME83 loadso)
add_sdl_test_executable(testlocale NONINTERACTIVE SOURCES testlocale.c NAME83 locale)
add_sdl_test_executable(testlock SOURCES testlock.c NAME83 lock)
add_sdl_test_executable(testrwlock SOURCES testrwlock.c NONINTERACTIVE NONINTERACTIVE_TIMEOUT 20 NAME83 rwlock)
add_sdl_test_executable(testmouse SOURCES testmouse.c NAME83 mouse)
add_sdl_test_executable(testoverlay NEEDS_RESOURCES TESTUTILS SOURCES testoverlay.c NAME83 overlay)
add_sdl_test_executable(testplatform NONINTERACTIVE SOURCES testplatform.c NAME83 platform)
add_sdl_test_executable(testpower NONINTERACTIVE SOURCES testpower.c NAME83 power)
add_sdl_test_executable(testfilesystem NONINTERACTIVE SOURCES testfilesystem.c NAME83 filesyst)
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
add_sdl_test_executable(pretest SOURCES pretest.c NONINTERACTIVE NONINTERACTIVE_TIMEOUT 60)
endif()
add_sdl_test_executable(testrendertarget NEEDS_RESOURCES TESTUTILS SOURCES testrendertarget.c NAME83 rendrtgt)
add_sdl_test_executable(testrotate SOURCES testrotate.c NAME83 rotate)
add_sdl_test_executable(testscale NEEDS_RESOURCES TESTUTILS SOURCES testscale.c NAME83 scale)
add_sdl_test_executable(testsem NONINTERACTIVE DISABLE_THREADS_ARGS "--no-threads" NONINTERACTIVE_ARGS 10 NONINTERACTIVE_TIMEOUT 30 SOURCES testsem.c NAME83 sem)
add_sdl_test_executable(testsensor SOURCES testsensor.c NAME83 sensor)
add_sdl_test_executable(testshader NEEDS_RESOURCES TESTUTILS SOURCES testshader.c NAME83 shader)
if(EMSCRIPTEN)
target_link_options(testshader PRIVATE "-sLEGACY_GL_EMULATION")
endif()
add_sdl_test_executable(testshape NEEDS_RESOURCES SOURCES testshape.c ${glass_png_header} DEPENDS generate-glass_png_header NAME83 shape)
add_sdl_test_executable(testsoftwaretransparent SOURCES testsoftwaretransparent.c NAME83 swtransp)
add_sdl_test_executable(testsprite MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testsprite.c NAME83 sprite)
add_sdl_test_executable(testspriteminimal SOURCES testspriteminimal.c ${icon_png_header} DEPENDS generate-icon_png_header NAME83 spritmin)
add_sdl_test_executable(testspritesurface SOURCES testspritesurface.c ${icon_png_header} DEPENDS generate-icon_png_header NAME83 spritsrf)
add_sdl_test_executable(testpalette SOURCES testpalette.c NAME83 palette)
add_sdl_test_executable(testtimer NONINTERACTIVE NONINTERACTIVE_ARGS --no-interactive NONINTERACTIVE_TIMEOUT 60 SOURCES testtimer.c NAME83 timer)
add_sdl_test_executable(testurl SOURCES testurl.c NAME83 url)
add_sdl_test_executable(testver NONINTERACTIVE NOTRACKMEM SOURCES testver.c NAME83 versdl)
set_property(TARGET testver PROPERTY C_STANDARD 90)
add_sdl_test_executable(testcamera MAIN_CALLBACKS SOURCES testcamera.c NAME83 camera)
add_sdl_test_executable(testclipboard MAIN_CALLBACKS SOURCES testclipboard.c ${icon_png_header} DEPENDS generate-icon_png_header NAME83 clipbrd)
add_sdl_test_executable(testviewport NEEDS_RESOURCES TESTUTILS SOURCES testviewport.c NAME83 viewport)
add_sdl_test_executable(testwm SOURCES testwm.c NAME83 wm)
add_sdl_test_executable(testyuv NONINTERACTIVE NONINTERACTIVE_ARGS "--automated" NEEDS_RESOURCES TESTUTILS SOURCES testyuv.c testyuv_cvt.c NAME83 yuv)
add_sdl_test_executable(torturethread NONINTERACTIVE THREADS NONINTERACTIVE_TIMEOUT 30 SOURCES torturethread.c NAME83 tortthrd)
add_sdl_test_executable(testrendercopyex NEEDS_RESOURCES TESTUTILS SOURCES testrendercopyex.c NAME83 rndcopex)
add_sdl_test_executable(testmessage SOURCES testmessage.c NAME83 message)
add_sdl_test_executable(testdisplayinfo SOURCES testdisplayinfo.c NAME83 dispinfo)
add_sdl_test_executable(testqsort NONINTERACTIVE SOURCES testqsort.c NAME83 qsort)
if(EMSCRIPTEN)
target_link_options(testqsort PRIVATE -sALLOW_MEMORY_GROWTH)
endif()
add_sdl_test_executable(testbounds NONINTERACTIVE SOURCES testbounds.c NAME83 bounds)
add_sdl_test_executable(testcustomcursor SOURCES testcustomcursor.c NAME83 custcurs)
add_sdl_test_executable(testvulkan SOURCES testvulkan.c NAME83 vulkan)
add_sdl_test_executable(testoffscreen SOURCES testoffscreen.c NAME83 offscrn)
add_sdl_test_executable(testpopup SOURCES testpopup.c NAME83 popup)
add_sdl_test_executable(testdialog SOURCES testdialog.c NAME83 dialog)
add_sdl_test_executable(testtime SOURCES testtime.c NAME83 timesdl)
add_sdl_test_executable(testmanymouse SOURCES testmanymouse.c NAME83 manymous)
add_sdl_test_executable(testmodal SOURCES testmodal.c NAME83 modal)
add_sdl_test_executable(testtray NEEDS_RESOURCES TESTUTILS SOURCES testtray.c NAME83 tray)
add_sdl_test_executable(testprocess
NONINTERACTIVE THREADS
NONINTERACTIVE_ARGS $<TARGET_FILE:childprocess>
INSTALLED_ARGS "${CMAKE_INSTALL_FULL_LIBEXECDIR}/installed-tests/SDL3/childprocess${CMAKE_EXECUTABLE_SUFFIX}"
SOURCES testprocess.c
NAME83 process
)
add_sdl_test_executable(childprocess SOURCES childprocess.c NAME83 chldproc)
add_dependencies(testprocess childprocess)
get_property(SDL_TEST_EXECUTABLES DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY SDL_TEST_EXECUTABLES)
if (HAVE_WAYLAND)
# Set the GENERATED property on the protocol file, since it is first created at build time
set_property(SOURCE ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c PROPERTY GENERATED 1)
add_sdl_test_executable(testwaylandcustom NEEDS_RESOURCES SOURCES testwaylandcustom.c ${SDL3_BINARY_DIR}/wayland-generated-protocols/xdg-shell-protocol.c)
# Needed to silence the documentation warning in the generated header file
target_compile_options(testwaylandcustom PRIVATE -Wno-documentation-unknown-command)
target_link_libraries(testwaylandcustom PRIVATE PkgConfig::PkgWaylandClient)
endif()
check_c_compiler_flag(-Wformat-overflow HAVE_WFORMAT_OVERFLOW)
if(HAVE_WFORMAT_OVERFLOW)
target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT_OVERFLOW)
endif()
check_c_compiler_flag(-Wformat HAVE_WFORMAT)
if(HAVE_WFORMAT)
target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT)
endif()
cmake_push_check_state()
if(HAVE_WFORMAT)
# Some compilers ignore -Wformat-extra-args without -Wformat
string(APPEND CMAKE_REQUIRED_FLAGS " -Wformat")
endif()
check_c_compiler_flag(-Wformat-extra-args HAVE_WFORMAT_EXTRA_ARGS)
cmake_pop_check_state()
if(HAVE_WFORMAT_EXTRA_ARGS)
target_compile_definitions(testautomation PRIVATE HAVE_WFORMAT_EXTRA_ARGS)
endif()
if(SDL_DUMMYAUDIO)
set_property(TARGET testaudioinfo PROPERTY SDL_NONINTERACTIVE 1)
endif()
if(SDL_DUMMYVIDEO)
set_property(TARGET testkeys PROPERTY SDL_NONINTERACTIVE 1)
set_property(TARGET testbounds PROPERTY SDL_NONINTERACTIVE 1)
set_property(TARGET testdisplayinfo PROPERTY SDL_NONINTERACTIVE 1)
endif()
if(OPENGL_FOUND)
if(TARGET OpenGL::GL)
target_link_libraries(testshader PRIVATE OpenGL::GL)
target_link_libraries(testgl PRIVATE OpenGL::GL)
else()
if(EMSCRIPTEN AND OPENGL_gl_LIBRARY STREQUAL "nul")
set(OPENGL_gl_LIBRARY GL)
endif()
# emscripten's FindOpenGL.cmake does not create OpenGL::GL
target_link_libraries(testshader PRIVATE ${OPENGL_gl_LIBRARY})
target_link_libraries(testgl PRIVATE ${OPENGL_gl_LIBRARY})
endif()
endif()
if(MACOS)
target_link_options(testnative PRIVATE "-Wl,-framework,Cocoa")
endif()
if(APPLE)
cmake_push_check_state()
check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
cmake_pop_check_state()
if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
set_property(SOURCE "testnativecocoa.m" APPEND PROPERTY COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
set_property(TARGET testgles APPEND PROPERTY COMPILE_OPTIONS "-Wno-error=deprecated-declarations")
endif()
endif()
if(PSP)
# Build EBOOT files if building for PSP
foreach(APP ${SDL_TEST_EXECUTABLES})
create_pbp_file(
TARGET ${APP}
TITLE SDL-${APP}
ICON_PATH NULL
BACKGROUND_PATH NULL
PREVIEW_PATH NULL
OUTPUT_DIR $<TARGET_FILE_DIR:${APP}>/sdl-${APP}
)
endforeach()
endif()
if(N3DS)
foreach(APP ${SDL_TEST_EXECUTABLES})
get_target_property(TARGET_BINARY_DIR ${APP} BINARY_DIR)
set(ROMFS_DIR "${TARGET_BINARY_DIR}/sdl-${APP}")
set(SMDH_FILE "${TARGET_BINARY_DIR}/${APP}.smdh")
file(MAKE_DIRECTORY ${ROMFS_DIR})
ctr_generate_smdh("${SMDH_FILE}"
NAME "SDL-${APP}"
DESCRIPTION "SDL3 Test suite"
AUTHOR "SDL3 Contributors"
ICON "${CMAKE_CURRENT_SOURCE_DIR}/n3ds/logo48x48.png"
)
ctr_create_3dsx(
${APP}
ROMFS "${ROMFS_DIR}"
SMDH "${SMDH_FILE}"
)
endforeach()
endif()
if(RISCOS)
set(SDL_TEST_EXECUTABLES_AIF)
foreach(APP ${SDL_TEST_EXECUTABLES})
set_property(TARGET ${APP} APPEND_STRING PROPERTY LINK_FLAGS " -static")
add_custom_command(
OUTPUT ${APP},ff8
COMMAND elf2aif ${APP} ${APP},ff8
DEPENDS ${APP}
)
add_custom_target(${APP}-aif ALL DEPENDS ${APP},ff8)
list(APPEND SDL_TEST_EXECUTABLES_AIF ${CMAKE_CURRENT_BINARY_DIR}/${APP},ff8)
endforeach()
endif()
# Set Apple App ID / Bundle ID. This is needed to launch apps on some Apple
# platforms (iOS, for example).
if(APPLE)
foreach(CURRENT_TARGET ${SDL_TEST_EXECUTABLES})
set_target_properties("${CURRENT_TARGET}" PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER "org.libsdl.${CURRENT_TARGET}"
MACOSX_BUNDLE_BUNDLE_VERSION "${SDL3_VERSION}"
MACOSX_BUNDLE_SHORT_VERSION_STRING "${SDL3_VERSION}"
)
endforeach()
endif()
set(SDLTEST_TIMEOUT_MULTIPLIER "1" CACHE STRING "SDL test time-out multiplier")
set(SDLTEST_AUDIO_DRIVER_DEFAULT "dummy")
set(SDLTEST_VIDEO_DRIVER_DEFAULT "dummy")
if(EMSCRIPTEN)
set(SDLTEST_AUDIO_DRIVER_DEFAULT "emscripten")
set(SDLTEST_VIDEO_DRIVER_DEFAULT "emscripten")
endif()
set(SDLTEST_AUDIO_DRIVER "${SDLTEST_AUDIO_DRIVER_DEFAULT}" CACHE STRING "SDL audio driver for CTest")
set(SDLTEST_VIDEO_DRIVER "${SDLTEST_VIDEO_DRIVER_DEFAULT}" CACHE STRING "SDL video driver for CTest")
set(TESTS_ENVIRONMENT
"SDL_AUDIO_DRIVER=${SDLTEST_AUDIO_DRIVER}"
"SDL_VIDEO_DRIVER=${SDLTEST_VIDEO_DRIVER}"
"SDL_ASSERT=abort"
)
function(add_sdl_test TEST TARGET)
cmake_parse_arguments(ast "INSTALL" "" "" ${ARGN})
get_property(noninteractive TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE)
if(noninteractive)
if(EMSCRIPTEN)
set(command "${PYTHON3_EXECUTABLE};${CMAKE_CURRENT_SOURCE_DIR}/emscripten/driver.py;--server;http://localhost:${SDLTEST_PORT};--browser;${SDLTEST_BROWSER}")
if(SDLTEST_CHROME_BINARY)
list(APPEND command "--chrome-binary;${SDLTEST_CHROME_BINARY}")
endif()
list(APPEND command "--;${TARGET}")
else()
set(command ${TARGET})
endif()
get_property(noninteractive_arguments TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE_ARGUMENTS)
get_property(installed_arguments_list TARGET ${TARGET} PROPERTY SDL_INSTALLED_ARGUMENTS)
# This assumes that none of the arguments need quoting
list(JOIN installed_arguments_list " " installed_arguments)
get_property(disable_threads_args TARGET ${TARGET} PROPERTY SDL_DISABLE_THREADS_ARGS)
get_property(uses_threads TARGET ${TARGET} PROPERTY SDL_THREADS)
if(noninteractive_arguments)
list(APPEND command ${noninteractive_arguments})
endif()
if(SDLTEST_TRACKMEM)
get_property(notrackmem TARGET ${TARGET} PROPERTY SDL_NOTRACKMEM)
if(NOT notrackmem)
list(APPEND command --trackmem)
endif()
endif()
if(EMSCRIPTEN)
list(APPEND command ${disable_threads_args})
endif()
add_test(
NAME ${TEST}
COMMAND ${command}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
if(WIN32 AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
set_property(TEST ${TEST} APPEND PROPERTY ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_RUNTIME_DLL_DIRS:${TARGET}>")
endif()
if(NOT notrackmem)
set_property(TEST ${TEST} PROPERTY FAIL_REGULAR_EXPRESSION "Total: [0-9]+\\.[0-9]+ Kb in [1-9][0-9]* allocations")
endif()
set_tests_properties(${TEST} PROPERTIES ENVIRONMENT "${TESTS_ENVIRONMENT}")
if(EMSCRIPTEN AND uses_threads)
set_tests_properties(${TEST} PROPERTIES DISABLED 1)
endif()
get_property(noninteractive_timeout TARGET ${TARGET} PROPERTY SDL_NONINTERACTIVE_TIMEOUT)
if(NOT noninteractive_timeout)
set(noninteractive_timeout 10)
endif()
math(EXPR noninteractive_timeout "${noninteractive_timeout}*${SDLTEST_TIMEOUT_MULTIPLIER}")
set_tests_properties(${TEST} PROPERTIES TIMEOUT "${noninteractive_timeout}")
if(ast_INSTALL AND SDL_INSTALL_TESTS)
set(exe ${TARGET})
set(installedtestsdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/installed-tests/SDL3")
configure_file(template.test.in "${exe}.test" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${exe}.test"
DESTINATION ${CMAKE_INSTALL_DATADIR}/installed-tests/SDL3
)
endif()
if(TARGET pretest AND NOT "${TARGET}" MATCHES "pretest")
set_property(TEST ${TEST} APPEND PROPERTY DEPENDS pretest)
endif()
endif()
endfunction()
foreach(TARGET ${SDL_TEST_EXECUTABLES})
add_sdl_test(${TARGET} ${TARGET} INSTALL)
endforeach()
if(NOT EMSCRIPTEN)
add_sdl_test(testautomation-no-simd testautomation)
add_sdl_test(testplatform-no-simd testplatform)
set_property(TEST testautomation-no-simd testplatform-no-simd APPEND PROPERTY ENVIRONMENT "SDL_CPU_FEATURE_MASK=-all")
# testautomation creates temporary files which might conflict
set_property(TEST testautomation-no-simd testautomation PROPERTY RUN_SERIAL TRUE)
endif()
if(SDL_INSTALL_TESTS)
if(RISCOS)
install(
FILES ${SDL_TEST_EXECUTABLES_AIF}
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
)
else()
foreach(test IN LISTS SDL_TEST_EXECUTABLES)
get_property(install_target TARGET ${test} PROPERTY "SDL_INSTALL")
if(install_target)
install(
TARGETS ${test}
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
)
get_property(extra_install TARGET ${test} PROPERTY "EXTRA_INSTALL")
if(extra_install)
install(
FILES ${extra_install}
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
OPTIONAL
)
endif()
endif()
endforeach()
endif()
if(MSVC)
foreach(test IN LISTS SDL_TEST_EXECUTABLES)
SDL_install_pdb(${test} "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3")
endforeach()
endif()
install(
FILES ${RESOURCE_FILES}
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
)
endif()
if(ANDROID AND TARGET SDL3::Jar)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake/android")
find_package(SdlAndroid MODULE)
if(SdlAndroid_FOUND)
set(apks "")
set(packages "")
include(SdlAndroidFunctions)
sdl_create_android_debug_keystore(SDL_test-debug-keystore)
sdl_android_compile_resources(SDL_test-resources RESFOLDER android/res)
add_custom_target(sdl-test-apks)
foreach(TEST ${SDL_TEST_EXECUTABLES})
set(ANDROID_MANIFEST_APP_NAME "${TEST}")
set(ANDROID_MANIFEST_LABEL "${TEST}")
set(ANDROID_MANIFEST_LIB_NAME "$<TARGET_FILE_BASE_NAME:${TEST}>")
set(ANDROID_MANIFEST_PACKAGE "org.libsdl.sdl.test.${TEST}")
set(generated_manifest_path "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-src/AndroidManifest.xml")
string(REPLACE "." "/" JAVA_PACKAGE_DIR "${ANDROID_MANIFEST_PACKAGE}")
set(GENERATED_SRC_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-src")
set(GENERATED_RES_FOLDER "${GENERATED_SRC_FOLDER}/res")
set(JAVA_PACKAGE_DIR "${GENERATED_SRC_FOLDER}/${JAVA_PACKAGE_DIR}")
configure_file(android/cmake/SDLEntryTestActivity.java.cmake "${JAVA_PACKAGE_DIR}/SDLEntryTestActivity.java" @ONLY)
configure_file(android/cmake/SDLTestActivity.java.cmake "${JAVA_PACKAGE_DIR}/SDLTestActivity.java" @ONLY)
configure_file(android/cmake/res/values/strings.xml.cmake android/res/values/strings-${TEST}.xml @ONLY)
configure_file(android/cmake/res/xml/shortcuts.xml.cmake "${GENERATED_RES_FOLDER}/xml/shortcuts.xml" @ONLY)
# Use XR-specific manifest for XR tests, standard manifest for others
if("${TEST}" MATCHES "_xr$")
# Meta Quest-specific manifest sections (enabled by default, set to empty to disable)
# These are ignored by non-Meta runtimes but required for proper Quest integration
if(NOT DEFINED SDL_ANDROID_XR_META_SUPPORT OR SDL_ANDROID_XR_META_SUPPORT)
set(ANDROID_XR_META_FEATURES
" <!-- Meta Quest hand tracking support -->
<uses-feature android:name=\"oculus.software.handtracking\" android:required=\"false\" />
")
set(ANDROID_XR_META_METADATA
" <!-- Meta Quest supported devices -->
<meta-data android:name=\"com.oculus.supportedDevices\" android:value=\"quest|quest2|questpro|quest3|quest3s\" />
<meta-data android:name=\"com.oculus.vr.focusaware\" android:value=\"true\" />
<!-- Hand tracking support level (V2 allows launching without controllers) -->
<meta-data android:name=\"com.oculus.handtracking.version\" android:value=\"V2.0\" />
<meta-data android:name=\"com.oculus.handtracking.frequency\" android:value=\"HIGH\" />
")
set(ANDROID_XR_META_INTENT_CATEGORY
" <!-- VR intent category for Meta Quest -->
<category android:name=\"com.oculus.intent.category.VR\" />")
else()
set(ANDROID_XR_META_FEATURES "")
set(ANDROID_XR_META_METADATA "")
set(ANDROID_XR_META_INTENT_CATEGORY "")
endif()
configure_file(android/cmake/AndroidManifest.xr.xml.cmake "${generated_manifest_path}" @ONLY)
else()
configure_file(android/cmake/AndroidManifest.xml.cmake "${generated_manifest_path}" @ONLY)
endif()
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-$<CONFIG>/res/values/strings.xml"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/android/res/values/strings-${TEST}.xml"
)
sdl_android_compile_resources(${TEST}-resources
RESOURCES
"${CMAKE_CURRENT_BINARY_DIR}/android/${TEST}-$<CONFIG>/res/values/strings.xml"
"${GENERATED_RES_FOLDER}/xml/shortcuts.xml"
)
sdl_android_link_resources(${TEST}-apk-linked
MANIFEST "${generated_manifest_path}"
PACKAGE ${ANDROID_MANIFEST_PACKAGE}
RES_TARGETS SDL_test-resources ${TEST}-resources
TARGET_SDK_VERSION 31
)
set(CMAKE_JAVA_COMPILE_FLAGS "-encoding;utf-8")
set(classes_path "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TEST}-java.dir/classes")
# Some CMake versions have a slow `cmake -E make_directory` implementation
if(NOT IS_DIRECTORY "${classes_path}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${classes_path}")
endif()
set(OUT_JAR "${CMAKE_CURRENT_BINARY_DIR}/${TEST}.jar")
add_custom_command(
OUTPUT "${OUT_JAR}"
COMMAND ${CMAKE_COMMAND} -E rm -rf "${classes_path}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${classes_path}"
COMMAND ${Java_JAVAC_EXECUTABLE}
-source 1.8 -target 1.8
-bootclasspath "$<TARGET_PROPERTY:SDL3::Jar,JAR_FILE>"
"${JAVA_PACKAGE_DIR}/SDLEntryTestActivity.java"
"${JAVA_PACKAGE_DIR}/SDLTestActivity.java"
$<TARGET_PROPERTY:${TEST}-apk-linked,JAVA_R>
-cp "$<TARGET_PROPERTY:SDL3::Jar,JAR_FILE>:${SDL_ANDROID_PLATFORM_ANDROID_JAR}"
-d "${classes_path}"
COMMAND ${Java_JAR_EXECUTABLE} cf "${OUT_JAR}" -C "${classes_path}" .
DEPENDS $<TARGET_PROPERTY:${TEST}-apk-linked,OUTPUTS> "$<TARGET_PROPERTY:SDL3::Jar,JAR_FILE>" "${JAVA_PACKAGE_DIR}/SDLTestActivity.java" "${JAVA_PACKAGE_DIR}/SDLEntryTestActivity.java"
)
add_custom_target(${TEST}-jar DEPENDS "${OUT_JAR}")
set_property(TARGET ${TEST}-jar PROPERTY OUTPUT "${OUT_JAR}")
set(dexworkdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TEST}-dex.dir")
# Some CMake versions have a slow `cmake -E make_directory` implementation
if(NOT IS_DIRECTORY "${dexworkdir}")
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${dexworkdir}")
endif()
set(classes_dex_base_name "classes.dex")
set(classes_dex "${dexworkdir}/${classes_dex_base_name}")
add_custom_command(
OUTPUT "${classes_dex}"
COMMAND SdlAndroid::d8
$<TARGET_PROPERTY:${TEST}-jar,OUTPUT>
$<TARGET_PROPERTY:SDL3::Jar,JAR_FILE>
--lib "${SDL_ANDROID_PLATFORM_ANDROID_JAR}"
--output "${dexworkdir}"
DEPENDS $<TARGET_PROPERTY:${TEST}-jar,OUTPUT> $<TARGET_PROPERTY:SDL3::Jar,JAR_FILE>
)
add_custom_target(${TEST}-dex DEPENDS "${classes_dex}")
set_property(TARGET ${TEST}-dex PROPERTY OUTPUT "${classes_dex}")
set_property(TARGET ${TEST}-dex PROPERTY OUTPUT_BASE_NAME "${classes_dex_base_name}")
sdl_add_to_apk_unaligned(${TEST}-unaligned-apk
APK_IN ${TEST}-apk-linked
OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/intermediates"
ASSETS ${RESOURCE_FILES}
NATIVE_LIBS SDL3::SDL3-shared ${TEST}
DEX ${TEST}-dex
)
sdl_apk_align(${TEST}-aligned-apk ${TEST}-unaligned-apk
OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/intermediates"
)
sdl_apk_sign(${TEST}-apk ${TEST}-aligned-apk
KEYSTORE SDL_test-debug-keystore
)
add_dependencies(sdl-test-apks ${TEST}-apk)
if(TARGET SdlAndroid::adb)
add_custom_target(install-${TEST}
COMMAND "${CMAKE_COMMAND}" -DACTION=install "-DAPKS=$<TARGET_PROPERTY:${TEST}-apk,OUTPUT>" -P "${SDL3_SOURCE_DIR}/cmake/android/SdlAndroidScript.cmake"
DEPENDS "${TEST}-apk"
)
add_custom_target(start-${TEST}
COMMAND "${ADB_BIN}" shell am start-activity -S "${ANDROID_MANIFEST_PACKAGE}/.SDLTestActivity"
)
add_custom_target(build-install-start-${TEST}
COMMAND "${CMAKE_COMMAND}" -DACTION=build-install-run "-DEXECUTABLES=${TEST}" "-DBUILD_FOLDER=${CMAKE_BINARY_DIR}" -P "${SDL3_SOURCE_DIR}/cmake/android/SdlAndroidScript.cmake"
)
endif()
list(APPEND packages "${ANDROID_MANIFEST_PACKAGE}")
list(APPEND install_targets install-${TEST})
endforeach()
if(TARGET SdlAndroid::adb)
add_custom_target(install-sdl-test-apks
DEPENDS ${install_targets}
VERBATIM
)
add_custom_target(uninstall-sdl-test-apks
COMMAND "${CMAKE_COMMAND}" "-DADB=$<TARGET_FILE:SdlAndroid::adb>" -DACTION=uninstall "-DPACKAGES=${packages}" -P "${SDL3_SOURCE_DIR}/cmake/android/SdlAndroidScript.cmake"
VERBATIM
)
endif()
endif()
endif()
+8
View File
@@ -0,0 +1,8 @@
The test programs in this directory tree are for demonstrating and
testing the functionality of the SDL library, and are placed in the
public domain.
October 28, 1997
--
Sam Lantinga (slouken@libsdl.org)
+49
View File
@@ -0,0 +1,49 @@
Source code in this directory, unless otherwise noted, falls under the
following license, which is different (more permissive) than SDL's usual
license.
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
This directory contains sample.wav, which is a sample from Will Provost's
song, The Living Proof:
From the album The Living Proof
Publisher: 5 Guys Named Will
Copyright 1996 Will Provost
You can get a copy of the full song (and album!) from iTunes...
https://itunes.apple.com/us/album/the-living-proof/id4153978
or Amazon...
http://www.amazon.com/The-Living-Proof-Will-Provost/dp/B00004R8RH
Thanks to Will for permitting us to distribute this sample with SDL!
This directory contains sword.wav:
sword04.wav by Erdie
Original: https://freesound.org/s/27858/
License: https://creativecommons.org/licenses/by/4.0/
The .bmp files used by testaudio.c were made by AlDraw:
https://linktr.ee/AlexDraw
These bitmaps may be distributed as public domain files!
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="@ANDROID_MANIFEST_PACKAGE@">
<!-- OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" />
<!-- Touchscreen support -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<!-- Game controller support -->
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
<uses-feature
android:name="android.hardware.gamepad"
android:required="false" />
<uses-feature
android:name="android.hardware.usb.host"
android:required="false" />
<!-- External mouse input events -->
<uses-feature
android:name="android.hardware.type.pc"
android:required="false" />
<!-- Allow access to the vibrator -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Allow access to the microphone -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Allow access to the camera -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<application
android:allowBackup="true"
android:icon="@mipmap/sdl-test"
android:roundIcon="@mipmap/sdl-test_round"
android:label="@string/label"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:enableOnBackInvokedCallback="false"
android:hardwareAccelerated="true">
<activity
android:name="@ANDROID_MANIFEST_PACKAGE@.SDLTestActivity"
android:exported="true"
android:label="@string/label"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
android:preferMinimalPostProcessing="true"
android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity
android:name="@ANDROID_MANIFEST_PACKAGE@.SDLEntryTestActivity"
android:exported="false"
android:label="@string/label">
</activity>
</application>
</manifest>
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="@ANDROID_MANIFEST_PACKAGE@"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<!-- OpenGL ES 3.2 for Vulkan fallback on XR devices -->
<uses-feature android:glEsVersion="0x00030002" android:required="true" />
<!-- Vulkan requirements -->
<uses-feature android:name="android.hardware.vulkan.level" android:required="true" android:version="1" />
<uses-feature android:name="android.hardware.vulkan.version" android:required="true" android:version="0x00401000" />
<!-- VR Head Tracking (standard OpenXR requirement) -->
<uses-feature android:name="android.hardware.vr.headtracking" android:required="true" android:version="1" />
<!-- Touchscreen not required for VR -->
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
@ANDROID_XR_META_FEATURES@
<!-- Game controller support -->
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
<uses-feature
android:name="android.hardware.gamepad"
android:required="false" />
<uses-feature
android:name="android.hardware.usb.host"
android:required="false" />
<!-- Allow access to the vibrator (for controller haptics) -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- OpenXR permissions (for runtime broker communication) -->
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />
<!-- OpenXR runtime/layer queries -->
<queries>
<provider android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
<intent>
<action android:name="org.khronos.openxr.OpenXRRuntimeService" />
</intent>
<intent>
<action android:name="org.khronos.openxr.OpenXRApiLayerService" />
</intent>
</queries>
<application
android:allowBackup="true"
android:icon="@mipmap/sdl-test"
android:roundIcon="@mipmap/sdl-test_round"
android:label="@string/label"
android:supportsRtl="true"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:enableOnBackInvokedCallback="false"
android:hardwareAccelerated="true">
@ANDROID_XR_META_METADATA@
<activity
android:name="@ANDROID_MANIFEST_PACKAGE@.SDLTestActivity"
android:exported="true"
android:label="@string/label"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"
android:configChanges="density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:excludeFromRecents="false"
android:resizeableActivity="false"
tools:ignore="NonResizeableActivity">
<!-- Standard launcher intent -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@ANDROID_XR_META_INTENT_CATEGORY@
<!-- Khronos OpenXR category (for broader compatibility) -->
<category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />
</intent-filter>
</activity>
<activity
android:name="@ANDROID_MANIFEST_PACKAGE@.SDLEntryTestActivity"
android:exported="false"
android:label="@string/label">
</activity>
</application>
</manifest>
@@ -0,0 +1,120 @@
package @ANDROID_MANIFEST_PACKAGE@;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import org.libsdl.app.SDLActivity;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.view.View;
import android.view.ViewGroup;
import android.view.LayoutInflater;
public class SDLEntryTestActivity extends Activity {
public String MODIFY_ARGUMENTS = "@ANDROID_MANIFEST_PACKAGE@.MODIFY_ARGUMENTS";
boolean isModifyingArguments;
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.v("SDL", "SDLEntryTestActivity onCreate");
super.onCreate(savedInstanceState);
String intent_action = getIntent().getAction();
Log.v("SDL", "SDLEntryTestActivity intent.action = " + intent_action);
if (intent_action == MODIFY_ARGUMENTS) {
isModifyingArguments = true;
createArgumentLayout();
} else {
startChildActivityAndFinish();
}
}
protected void createArgumentLayout() {
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.arguments_layout, null);
setContentView(view);
Button button = (Button)requireViewById(R.id.arguments_start_button);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startChildActivityAndFinish();
}
});
}
protected String[] getArguments() {
if (!isModifyingArguments) {
return new String[0];
}
EditText editText = (EditText)findViewById(R.id.arguments_edit);
String text = editText.getText().toString();
String new_text = text.replace("[ \t]*[ \t\n]+[ \t]+", "\n").strip();
Log.v("SDL", "text = " + text + "\n becomes \n" + new_text);
return new_text.split("\n", 0);
}
@Override
protected void onStart() {
Log.v("SDL", "SDLEntryTestActivity onStart");
super.onStart();
}
@Override
protected void onResume() {
Log.v("SDL", "SDLEntryTestActivity onResume");
super.onResume();
}
@Override
protected void onPause() {
Log.v("SDL", "SDLEntryTestActivity onPause");
super.onPause();
}
@Override
protected void onStop() {
Log.v("SDL", "SDLEntryTestActivity onStop");
super.onStop();
}
@Override
protected void onDestroy() {
Log.v("SDL", "SDLEntryTestActivity onDestroy");
super.onDestroy();
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
Log.v("SDL", "SDLEntryTestActivity onRestoreInstanceState");
super.onRestoreInstanceState(savedInstanceState);
EditText editText = (EditText)findViewById(R.id.arguments_edit);
editText.setText(savedInstanceState.getCharSequence("args", ""), TextView.BufferType.EDITABLE);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
Log.v("SDL", "SDLEntryTestActivity onSaveInstanceState");
EditText editText = (EditText)findViewById(R.id.arguments_edit);
outState.putCharSequence("args", editText.getText());
super.onSaveInstanceState(outState);
}
private void startChildActivityAndFinish() {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setClassName("@ANDROID_MANIFEST_PACKAGE@", "@ANDROID_MANIFEST_PACKAGE@.SDLTestActivity");
intent.putExtra("arguments", getArguments());
startActivity(intent);
finish();
}
}
@@ -0,0 +1,33 @@
package @ANDROID_MANIFEST_PACKAGE@;
import org.libsdl.app.SDLActivity;
import android.os.Bundle;
import android.util.Log;
public class SDLTestActivity extends SDLActivity {
private String[] m_arguments;
@Override
protected void onCreate(Bundle savedInstanceState) {
m_arguments = getIntent().getStringArrayExtra("arguments");
if (m_arguments == null) {
m_arguments = new String[0];
}
super.onCreate(savedInstanceState);
}
@Override
protected String[] getLibraries() {
return new String[] { getString(R.string.lib_name) };
}
@Override
protected String[] getArguments() {
Log.v("SDLTest", "#arguments = " + m_arguments.length);
for(int i = 0; i < m_arguments.length; i++) {
Log.v("SDLTest", "argument[" + i + "] = " + m_arguments[i]);
}
return m_arguments;
}
}
@@ -0,0 +1,5 @@
<resources>
<string name="app_name">@ANDROID_MANIFEST_APP_NAME@</string>
<string name="lib_name">@ANDROID_MANIFEST_LIB_NAME@</string>
<string name="label">@ANDROID_MANIFEST_LABEL@</string>
</resources>
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="modifyArguments"
android:enabled="true"
android:icon="@drawable/sdl-test_foreground"
android:shortcutShortLabel="@string/shortcutModifyArgumentsShortLabel">
<intent
android:action="@ANDROID_MANIFEST_PACKAGE@.MODIFY_ARGUMENTS"
android:targetPackage="@ANDROID_MANIFEST_PACKAGE@"
android:targetClass="@ANDROID_MANIFEST_PACKAGE@.SDLEntryTestActivity" />
</shortcut>
<shortcut
android:shortcutId="intermediateActivity"
android:enabled="true"
android:icon="@drawable/sdl-test_foreground"
android:shortcutShortLabel="@string/shortcutIntermediateActivityShortLabel">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="@ANDROID_MANIFEST_PACKAGE@"
android:targetClass="@ANDROID_MANIFEST_PACKAGE@.SDLEntryTestActivity" />
</shortcut>
<!-- Specify more shortcuts here. -->
</shortcuts>
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:inputType="textImeMultiLine|textNoSuggestions"
android:text="@string/label_enter_arguments" />
<EditText
android:id="@+id/arguments_edit"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="top"
android:hint="@string/hint_enter_arguments_here" />
<Button
android:id="@+id/arguments_start_button"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/button_start_app" />
</LinearLayout>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/sdl-test_background"/>
<foreground android:drawable="@drawable/sdl-test_foreground"/>
</adaptive-icon>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/sdl-test_background"/>
<foreground android:drawable="@drawable/sdl-test_foreground"/>
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+7
View File
@@ -0,0 +1,7 @@
<resources>
<string name="label_enter_arguments">Arguments</string>
<string name="hint_enter_arguments_here">One argument per line.\ne.g.\n--track-mem\n--windows\n3</string>
<string name="button_start_app">Start</string>
<string name="shortcutModifyArgumentsShortLabel">Modify arguments</string>
<string name="shortcutIntermediateActivityShortLabel">Pass through activity</string>
</resources>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="sdl-test_background">#FFFFFF</color>
</resources>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.NoTitleBar.Fullscreen">
<!-- Customize your theme here. -->
</style>
</resources>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e
make-header() {
xxd -i "$1" | sed \
-e 's/^unsigned /const unsigned /g' \
-e 's,^const,static const,' \
> "$1.h"
}
# Requires shadercross CLI installed from SDL_shadercross
for filename in *.hlsl; do
if [ -f "$filename" ]; then
shadercross "$filename" -o "${filename/.hlsl/.spv}"
make-header "${filename/.hlsl/.spv}"
shadercross "$filename" -o "${filename/.hlsl/.msl}"
make-header "${filename/.hlsl/.msl}"
shadercross "$filename" -o "${filename/.hlsl/.dxil}"
make-header "${filename/.hlsl/.dxil}"
fi
done
rm -f *.spv *.msl *.dxil
+537
View File
@@ -0,0 +1,537 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
/* Simple program: Loop, watching keystrokes
Note that you need to call SDL_PollEvent() or SDL_WaitEvent() to
pump the event loop and catch keystrokes.
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
#ifdef SDL_PLATFORM_EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
#define TEXT_WINDOW_OFFSET_X 2.0f
#define TEXT_WINDOW_OFFSET_Y (2.0f + FONT_LINE_HEIGHT)
#define CURSOR_BLINK_INTERVAL_MS 500
typedef struct
{
SDLTest_TextWindow *textwindow;
char *edit_text;
int edit_cursor;
int edit_length;
} TextWindowState;
static SDLTest_CommonState *state;
static TextWindowState *windowstates;
static bool escape_pressed;
static bool cursor_visible;
static Uint64 last_cursor_change;
static int done;
static TextWindowState *GetTextWindowStateForWindowID(SDL_WindowID id)
{
int i;
for (i = 0; i < state->num_windows; ++i) {
if (id == SDL_GetWindowID(state->windows[i])) {
return &windowstates[i];
}
}
return NULL;
}
static SDLTest_TextWindow *GetTextWindowForWindowID(SDL_WindowID id)
{
TextWindowState *windowstate = GetTextWindowStateForWindowID(id);
if (windowstate) {
return windowstate->textwindow;
}
return NULL;
}
static void UpdateTextWindowInputRect(SDL_WindowID id)
{
int i;
for (i = 0; i < state->num_windows; ++i) {
if (id == SDL_GetWindowID(state->windows[i])) {
SDLTest_TextWindow *textwindow = windowstates[i].textwindow;
int w, h;
SDL_Rect rect;
int cursor = 0;
int current = textwindow->current;
const char *current_line = textwindow->lines[current];
SDL_GetWindowSize(state->windows[i], &w, &h);
if (current_line) {
cursor = (int)SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE;
}
rect.x = (int)TEXT_WINDOW_OFFSET_X;
rect.y = (int)TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT;
rect.w = (int)(w - (2 * TEXT_WINDOW_OFFSET_X));
rect.h = FONT_CHARACTER_SIZE;
SDL_SetTextInputArea(state->windows[i], &rect, cursor);
return;
}
}
}
static void print_string(char **text, size_t *maxlen, const char *fmt, ...)
{
int len;
va_list ap;
va_start(ap, fmt);
len = SDL_vsnprintf(*text, *maxlen, fmt, ap);
if (len > 0) {
*text += len;
if (((size_t)len) < *maxlen) {
*maxlen -= (size_t)len;
} else {
*maxlen = 0;
}
}
va_end(ap);
}
static void print_modifiers(char **text, size_t *maxlen, SDL_Keymod mod)
{
print_string(text, maxlen, " modifiers:");
if (mod == SDL_KMOD_NONE) {
print_string(text, maxlen, " (none)");
return;
}
if ((mod & SDL_KMOD_SHIFT) == SDL_KMOD_SHIFT) {
print_string(text, maxlen, " SHIFT");
} else {
if (mod & SDL_KMOD_LSHIFT) {
print_string(text, maxlen, " LSHIFT");
}
if (mod & SDL_KMOD_RSHIFT) {
print_string(text, maxlen, " RSHIFT");
}
}
if ((mod & SDL_KMOD_CTRL) == SDL_KMOD_CTRL) {
print_string(text, maxlen, " CTRL");
} else {
if (mod & SDL_KMOD_LCTRL) {
print_string(text, maxlen, " LCTRL");
}
if (mod & SDL_KMOD_RCTRL) {
print_string(text, maxlen, " RCTRL");
}
}
if ((mod & SDL_KMOD_ALT) == SDL_KMOD_ALT) {
print_string(text, maxlen, " ALT");
} else {
if (mod & SDL_KMOD_LALT) {
print_string(text, maxlen, " LALT");
}
if (mod & SDL_KMOD_RALT) {
print_string(text, maxlen, " RALT");
}
}
if ((mod & SDL_KMOD_GUI) == SDL_KMOD_GUI) {
print_string(text, maxlen, " GUI");
} else {
if (mod & SDL_KMOD_LGUI) {
print_string(text, maxlen, " LGUI");
}
if (mod & SDL_KMOD_RGUI) {
print_string(text, maxlen, " RGUI");
}
}
if (mod & SDL_KMOD_NUM) {
print_string(text, maxlen, " NUM");
}
if (mod & SDL_KMOD_CAPS) {
print_string(text, maxlen, " CAPS");
}
if (mod & SDL_KMOD_MODE) {
print_string(text, maxlen, " MODE");
}
if (mod & SDL_KMOD_LEVEL5) {
print_string(text, maxlen, " LEVEL5");
}
if (mod & SDL_KMOD_SCROLL) {
print_string(text, maxlen, " SCROLL");
}
}
static void PrintModifierState(void)
{
char message[512];
char *spot;
size_t left;
spot = message;
left = sizeof(message);
print_modifiers(&spot, &left, SDL_GetModState());
SDL_Log("Initial state:%s", message);
}
static void PrintKey(SDL_KeyboardEvent *event)
{
char message[512];
char *spot;
size_t left;
spot = message;
left = sizeof(message);
/* Print the keycode, name and state */
if (event->key) {
print_string(&spot, &left,
"Key %s: raw 0x%.2x, scancode %d = %s, keycode 0x%08X = %s ",
event->down ? "pressed " : "released",
event->raw,
event->scancode,
event->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(event->scancode),
event->key, SDL_GetKeyName(event->key));
} else {
print_string(&spot, &left,
"Unknown Key (raw 0x%.2x, scancode %d = %s) %s ",
event->raw,
event->scancode,
event->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(event->scancode),
event->down ? "pressed " : "released");
}
print_modifiers(&spot, &left, event->mod);
if (event->repeat) {
print_string(&spot, &left, " (repeat)");
}
SDL_Log("%s", message);
}
static void PrintText(const char *eventtype, const char *text)
{
const char *spot;
char expanded[1024];
expanded[0] = '\0';
for (spot = text; *spot; ++spot) {
size_t length = SDL_strlen(expanded);
(void)SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot);
}
SDL_Log("%s Text (%s): \"%s%s\"", eventtype, expanded, *text == '"' ? "\\" : "", text);
}
static void CountKeysDown(void)
{
int i, count = 0, max_keys = 0;
const bool *keystate = SDL_GetKeyboardState(&max_keys);
for (i = 0; i < max_keys; ++i) {
if (keystate[i]) {
++count;
}
}
SDL_Log("Keys down: %d", count);
}
static void DrawCursor(int i)
{
SDL_FRect rect;
TextWindowState *windowstate = &windowstates[i];
SDLTest_TextWindow *textwindow = windowstate->textwindow;
int current = textwindow->current;
const char *current_line = textwindow->lines[current];
rect.x = TEXT_WINDOW_OFFSET_X;
if (current_line) {
rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE;
}
if (windowstate->edit_cursor > 0) {
rect.x += (float)windowstate->edit_cursor * FONT_CHARACTER_SIZE;
}
rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT;
rect.w = FONT_CHARACTER_SIZE * 0.75f;
rect.h = (float)FONT_CHARACTER_SIZE;
SDL_SetRenderDrawColor(state->renderers[i], 0xAA, 0xAA, 0xAA, 255);
SDL_RenderFillRect(state->renderers[i], &rect);
}
static void DrawEditText(int i)
{
SDL_FRect rect;
TextWindowState *windowstate = &windowstates[i];
SDLTest_TextWindow *textwindow = windowstate->textwindow;
int current = textwindow->current;
const char *current_line = textwindow->lines[current];
if (windowstate->edit_text == NULL) {
return;
}
/* Draw the highlight under the selected text */
if (windowstate->edit_length > 0) {
rect.x = TEXT_WINDOW_OFFSET_X;
if (current_line) {
rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE;
}
if (windowstate->edit_cursor > 0) {
rect.x += (float)windowstate->edit_cursor * FONT_CHARACTER_SIZE;
}
rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT;
rect.w = (float)windowstate->edit_length * FONT_CHARACTER_SIZE;
rect.h = (float)FONT_CHARACTER_SIZE;
SDL_SetRenderDrawColor(state->renderers[i], 0xAA, 0xAA, 0xAA, 255);
SDL_RenderFillRect(state->renderers[i], &rect);
}
/* Draw the edit text */
rect.x = TEXT_WINDOW_OFFSET_X;
if (current_line) {
rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE;
}
rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT;
SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 0, 255);
SDLTest_DrawString(state->renderers[i], rect.x, rect.y, windowstate->edit_text);
}
static void loop(void)
{
SDL_Event event;
Uint64 now;
int i;
char line[1024];
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_EVENT_KEY_DOWN:
case SDL_EVENT_KEY_UP:
PrintKey(&event.key);
if (event.type == SDL_EVENT_KEY_DOWN) {
switch (event.key.key) {
case SDLK_BACKSPACE:
SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.key.windowID), "\b");
UpdateTextWindowInputRect(event.key.windowID);
break;
case SDLK_RETURN:
SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.key.windowID), "\n");
UpdateTextWindowInputRect(event.key.windowID);
break;
default:
break;
}
if (event.key.key == SDLK_ESCAPE) {
/* Pressing escape twice will stop the application */
if (escape_pressed) {
done = 1;
} else {
escape_pressed = true;
}
} else {
escape_pressed = true;
}
}
CountKeysDown();
break;
case SDL_EVENT_TEXT_EDITING:
{
TextWindowState *windowstate = GetTextWindowStateForWindowID(event.edit.windowID);
if (windowstate->edit_text) {
SDL_free(windowstate->edit_text);
windowstate->edit_text = NULL;
}
if (event.edit.text && *event.edit.text) {
windowstate->edit_text = SDL_strdup(event.edit.text);
}
windowstate->edit_cursor = event.edit.start;
windowstate->edit_length = event.edit.length;
SDL_snprintf(line, sizeof(line), "EDIT %" SDL_PRIs32 ":%" SDL_PRIs32, event.edit.start, event.edit.length);
PrintText(line, event.edit.text);
break;
}
case SDL_EVENT_TEXT_INPUT:
PrintText("INPUT", event.text.text);
SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.text.windowID), "%s", event.text.text);
UpdateTextWindowInputRect(event.text.windowID);
break;
case SDL_EVENT_FINGER_DOWN:
{
SDL_Window *window = SDL_GetWindowFromEvent(&event);
if (SDL_TextInputActive(window)) {
SDL_Log("Stopping text input for window %" SDL_PRIu32, event.tfinger.windowID);
SDL_StopTextInput(window);
} else {
SDL_Log("Starting text input for window %" SDL_PRIu32, event.tfinger.windowID);
SDL_StartTextInput(window);
}
break;
}
case SDL_EVENT_MOUSE_BUTTON_DOWN:
if (event.button.button == SDL_BUTTON_RIGHT) {
SDL_Window *window = SDL_GetWindowFromEvent(&event);
if (SDL_TextInputActive(window)) {
SDL_Log("Stopping text input for window %" SDL_PRIu32, event.button.windowID);
SDL_StopTextInput(window);
} else {
SDL_Log("Starting text input for window %" SDL_PRIu32, event.button.windowID);
SDL_StartTextInput(window);
}
}
break;
case SDL_EVENT_KEYMAP_CHANGED:
SDL_Log("Keymap changed!");
break;
case SDL_EVENT_QUIT:
done = 1;
break;
default:
break;
}
}
now = SDL_GetTicks();
for (i = 0; i < state->num_windows; i++) {
char caption[1024];
/* Clear the window */
SDL_SetRenderDrawColor(state->renderers[i], 0, 0, 0, 255);
SDL_RenderClear(state->renderers[i]);
/* Draw the text */
SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 255, 255);
SDL_snprintf(caption, sizeof(caption), "Text input %s (click right mouse button to toggle)\n", SDL_TextInputActive(state->windows[i]) ? "enabled" : "disabled");
SDLTest_DrawString(state->renderers[i], TEXT_WINDOW_OFFSET_X, TEXT_WINDOW_OFFSET_X, caption);
SDLTest_TextWindowDisplay(windowstates[i].textwindow, state->renderers[i]);
/* Draw the cursor */
if ((now - last_cursor_change) >= CURSOR_BLINK_INTERVAL_MS) {
cursor_visible = !cursor_visible;
last_cursor_change = now;
}
if (cursor_visible) {
DrawCursor(i);
}
/* Draw the composition text */
DrawEditText(i);
SDL_RenderPresent(state->renderers[i]);
}
/* Slow down framerate */
SDL_Delay(10);
#ifdef SDL_PLATFORM_EMSCRIPTEN
if (done) {
emscripten_cancel_main_loop();
}
#endif
}
int main(int argc, char *argv[])
{
int i;
/* This is not necessary for text input handling, we just
* want to verify that input works with raw keyboard enabled.
*/
SDL_SetHint(SDL_HINT_WINDOWS_RAW_KEYBOARD, "1");
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
if (!state) {
return 1;
}
state->window_title = "CheckKeys Test";
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
}
/* Disable mouse emulation */
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
/* Enable text editing events and tell SDL that we'll handle rendering compositions. */
SDL_SetHint(SDL_HINT_IME_IMPLEMENTED_UI, "composition");
/* Initialize SDL */
if (!SDLTest_CommonInit(state)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
return 1;
}
windowstates = (TextWindowState *)SDL_calloc(state->num_windows, sizeof(*windowstates));
if (!windowstates) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't allocate text windows: %s", SDL_GetError());
goto done;
}
for (i = 0; i < state->num_windows; ++i) {
int w, h;
SDL_FRect rect;
SDL_GetWindowSize(state->windows[i], &w, &h);
rect.x = TEXT_WINDOW_OFFSET_X;
rect.y = TEXT_WINDOW_OFFSET_Y;
rect.w = w - (2 * TEXT_WINDOW_OFFSET_X);
rect.h = h - TEXT_WINDOW_OFFSET_Y;
windowstates[i].textwindow = SDLTest_TextWindowCreate(rect.x, rect.y, rect.w, rect.h);
}
#ifdef SDL_PLATFORM_IOS
{
/* Creating the context creates the view, which we need to show keyboard */
for (i = 0; i < state->num_windows; i++) {
SDL_GL_CreateContext(state->windows[i]);
}
}
#endif
for (i = 0; i < state->num_windows; ++i) {
UpdateTextWindowInputRect(SDL_GetWindowID(state->windows[i]));
SDL_StartTextInput(state->windows[i]);
}
/* Print initial state */
SDL_PumpEvents();
PrintModifierState();
/* Watch keystrokes */
done = 0;
#ifdef SDL_PLATFORM_EMSCRIPTEN
emscripten_set_main_loop(loop, 0, 1);
#else
while (!done) {
loop();
}
#endif
done:
if (windowstates) {
for (i = 0; i < state->num_windows; ++i) {
SDLTest_TextWindowDestroy(windowstates[i].textwindow);
}
SDL_free(windowstates);
}
SDLTest_CleanupTextDrawing();
SDLTest_CommonQuit(state);
return 0;
}
+180
View File
@@ -0,0 +1,180 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
#ifdef SDL_PLATFORM_WINDOWS
#include <io.h>
#include <fcntl.h>
#endif
#include <stdio.h>
#include <errno.h>
int main(int argc, char *argv[]) {
SDLTest_CommonState *state;
int i;
bool print_arguments = false;
bool print_environment = false;
bool stdin_to_stdout = false;
bool read_stdin = false;
bool stdin_to_stderr = false;
SDL_IOStream *log_stdin = NULL;
int exit_code = 0;
state = SDLTest_CommonCreateState(argv, 0);
for (i = 1; i < argc;) {
int consumed = SDLTest_CommonArg(state, i);
if (!consumed) {
if (SDL_strcmp(argv[i], "--print-arguments") == 0) {
print_arguments = true;
consumed = 1;
} else if (SDL_strcmp(argv[i], "--print-environment") == 0) {
print_environment = true;
consumed = 1;
} else if (SDL_strcmp(argv[i], "--stdin-to-stdout") == 0) {
stdin_to_stdout = true;
consumed = 1;
} else if (SDL_strcmp(argv[i], "--stdin-to-stderr") == 0) {
stdin_to_stderr = true;
consumed = 1;
} else if (SDL_strcmp(argv[i], "--stdin") == 0) {
read_stdin = true;
consumed = 1;
} else if (SDL_strcmp(argv[i], "--stdout") == 0) {
if (i + 1 < argc) {
fprintf(stdout, "%s", argv[i + 1]);
consumed = 2;
}
} else if (SDL_strcmp(argv[i], "--stderr") == 0) {
if (i + 1 < argc) {
fprintf(stderr, "%s", argv[i + 1]);
consumed = 2;
}
} else if (SDL_strcmp(argv[i], "--log-stdin") == 0) {
if (i + 1 < argc) {
log_stdin = SDL_IOFromFile(argv[i + 1], "w");
if (!log_stdin) {
fprintf(stderr, "Couldn't open %s\n", argv[i + 1]);
return 2;
}
consumed = 2;
}
} else if (SDL_strcmp(argv[i], "--exit-code") == 0) {
if (i + 1 < argc) {
char *endptr = NULL;
exit_code = SDL_strtol(argv[i + 1], &endptr, 0);
if (endptr && *endptr == '\0') {
consumed = 2;
}
}
} else if (SDL_strcmp(argv[i], "--version") == 0) {
int version = SDL_GetVersion();
fprintf(stdout, "SDL version %d.%d.%d",
SDL_VERSIONNUM_MAJOR(version),
SDL_VERSIONNUM_MINOR(version),
SDL_VERSIONNUM_MICRO(version));
fprintf(stderr, "SDL version %d.%d.%d",
SDL_VERSIONNUM_MAJOR(version),
SDL_VERSIONNUM_MINOR(version),
SDL_VERSIONNUM_MICRO(version));
consumed = 1;
break;
} else if (SDL_strcmp(argv[i], "--") == 0) {
i++;
break;
}
}
if (consumed <= 0) {
const char *args[] = {
"[--print-arguments]",
"[--print-environment]",
"[--stdin]",
"[--log-stdin FILE]",
"[--stdin-to-stdout]",
"[--stdout TEXT]",
"[--stdin-to-stderr]",
"[--stderr TEXT]",
"[--exit-code EXIT_CODE]",
"[--] [ARG [ARG ...]]",
NULL
};
SDLTest_CommonLogUsage(state, argv[0], args);
return 1;
}
i += consumed;
}
if (print_arguments) {
int print_i;
#ifdef SDL_PLATFORM_WINDOWS
/* reopen stdout as binary to prevent newline conversion */
_setmode(_fileno(stdout), _O_BINARY);
#endif
for (print_i = 0; i + print_i < argc; print_i++) {
fprintf(stdout, "|%d=%s|\r\n", print_i, argv[i + print_i]);
}
fflush(stdout);
}
if (print_environment) {
char **env = SDL_GetEnvironmentVariables(SDL_GetEnvironment());
if (env) {
for (i = 0; env[i]; ++i) {
fprintf(stdout, "%s\n", env[i]);
}
SDL_free(env);
}
fflush(stdout);
}
if (stdin_to_stdout || stdin_to_stderr || read_stdin) {
for (;;) {
char buffer[4 * 4096];
size_t result;
result = fread(buffer, 1, sizeof(buffer), stdin);
if (result == 0) {
if (!feof(stdin)) {
char error[128];
if (errno == EAGAIN) {
clearerr(stdin);
SDL_Delay(20);
continue;
}
#ifdef SDL_PLATFORM_WINDOWS
if (strerror_s(error, sizeof(error), errno) != 0) {
SDL_strlcpy(error, "Unknown error", sizeof(error));
}
#else
SDL_strlcpy(error, strerror(errno), sizeof(error));
#endif
SDL_Log("Error reading from stdin: %s", error);
}
break;
}
if (log_stdin) {
SDL_WriteIO(log_stdin, buffer, result);
SDL_FlushIO(log_stdin);
}
if (stdin_to_stdout) {
fwrite(buffer, 1, result, stdout);
fflush(stdout);
}
if (stdin_to_stderr) {
fwrite(buffer, 1, result, stderr);
}
}
}
if (log_stdin) {
SDL_CloseIO(log_stdin);
}
SDLTest_CommonDestroyState(state);
return exit_code;
}
+184
View File
@@ -0,0 +1,184 @@
#!/usr/bin/env python
import argparse
import contextlib
import logging
import os
import pathlib
import shlex
import sys
import time
from typing import Optional
import urllib.parse
from selenium import webdriver
import selenium.common.exceptions
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
logger = logging.getLogger(__name__)
class SDLSeleniumTestDriver:
def __init__(self, server: str, test: str, arguments: list[str], browser: str, firefox_binary: Optional[str]=None, chrome_binary: Optional[str]=None):
self. server = server
self.test = test
self.arguments = arguments
self.chrome_binary = chrome_binary
self.firefox_binary = firefox_binary
self.driver = None
self.stdout_printed = False
self.failed_messages: list[str] = []
self.return_code = None
options = [
"--headless",
]
driver_contructor = None
match browser:
case "firefox":
driver_contructor = webdriver.Firefox
driver_options = webdriver.FirefoxOptions()
if self.firefox_binary:
driver_options.binary_location = self.firefox_binary
case "chrome":
driver_contructor = webdriver.Chrome
driver_options = webdriver.ChromeOptions()
if self.chrome_binary:
driver_options.binary_location = self.chrome_binary
options.append("--no-sandbox")
if driver_contructor is None:
raise ValueError(f"Invalid {browser=}")
for o in options:
driver_options.add_argument(o)
logger.debug("About to create driver")
self.driver = driver_contructor(options=driver_options)
@property
def finished(self):
return len(self.failed_messages) > 0 or self.return_code is not None
def __del__(self):
if self.driver:
self.driver.quit()
@property
def url(self):
req = {
"loghtml": "1",
"SDL_ASSERT": "abort",
}
for key, value in os.environ.items():
if key.startswith("SDL_"):
req[key] = value
req.update({f"arg_{i}": a for i, a in enumerate(self.arguments, 1) })
req_str = urllib.parse.urlencode(req)
return f"{self.server}/{self.test}.html?{req_str}"
@contextlib.contextmanager
def _selenium_catcher(self):
try:
yield
success = True
except selenium.common.exceptions.UnexpectedAlertPresentException as e:
# FIXME: switch context, verify text of dialog and answer "a" for abort
wait = WebDriverWait(self.driver, timeout=2)
try:
alert = wait.until(lambda d: d.switch_to.alert)
except selenium.common.exceptions.NoAlertPresentException:
self.failed_messages.append(e.msg)
return False
self.failed_messages.append(alert)
if "Assertion failure" in e.msg and "[ariA]" in e.msg:
alert.send_keys("a")
alert.accept()
else:
self.failed_messages.append(e.msg)
success = False
return success
def get_stdout_and_print(self):
if self.stdout_printed:
return
with self._selenium_catcher():
div_terminal = self.driver.find_element(by=By.ID, value="terminal")
assert div_terminal
text = div_terminal.text
print(text)
self.stdout_printed = True
def update_return_code(self):
with self._selenium_catcher():
div_process_quit = self.driver.find_element(by=By.ID, value="process-quit")
if not div_process_quit:
return
if div_process_quit.text != "":
try:
self.return_code = int(div_process_quit.text)
except ValueError:
raise ValueError(f"process-quit element contains invalid data: {div_process_quit.text:r}")
def loop(self):
print(f"Connecting to \"{self.url}\"", file=sys.stderr)
self.driver.get(url=self.url)
self.driver.implicitly_wait(0.2)
while True:
self.update_return_code()
if self.finished:
break
time.sleep(0.1)
self.get_stdout_and_print()
if not self.stdout_printed:
self.failed_messages.append("Failed to get stdout/stderr")
def main() -> int:
parser = argparse.ArgumentParser(allow_abbrev=False, description="Selenium SDL test driver")
parser.add_argument("--browser", default="firefox", choices=["firefox", "chrome"], help="browser")
parser.add_argument("--server", default="http://localhost:8080", help="Server where SDL tests live")
parser.add_argument("--verbose", action="store_true", help="Verbose logging")
parser.add_argument("--chrome-binary", help="Chrome binary")
parser.add_argument("--firefox-binary", help="Firefox binary")
index_double_dash = sys.argv.index("--")
if index_double_dash < 0:
parser.error("Missing test arguments. Need -- <FILENAME> <ARGUMENTS>")
driver_arguments = sys.argv[1:index_double_dash]
test = pathlib.Path(sys.argv[index_double_dash+1]).name
test_arguments = sys.argv[index_double_dash+2:]
args = parser.parse_args(args=driver_arguments)
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
logger.debug("driver_arguments=%r test=%r test_arguments=%r", driver_arguments, test, test_arguments)
sdl_test_driver = SDLSeleniumTestDriver(
server=args.server,
test=test,
arguments=test_arguments,
browser=args.browser,
chrome_binary=args.chrome_binary,
firefox_binary=args.firefox_binary,
)
sdl_test_driver.loop()
rc = sdl_test_driver.return_code
if sdl_test_driver.failed_messages:
for msg in sdl_test_driver.failed_messages:
print(f"FAILURE MESSAGE: {msg}", file=sys.stderr)
if rc == 0:
print(f"Test signaled success (rc=0) but a failure happened", file=sys.stderr)
rc = 1
sys.stdout.flush()
logger.info("Exit code = %d", rc)
return rc
if __name__ == "__main__":
raise SystemExit(main())
+25
View File
@@ -0,0 +1,25 @@
Module['arguments'] = ['0'];
//Gamepads don't appear until a button is pressed and the joystick/gamepad tests expect one to be connected
Module['preRun'].push(function()
{
Module['print']("Waiting for gamepad...");
Module['addRunDependency']("gamepad");
window.addEventListener('gamepadconnected', function()
{
//OK, got one
Module['removeRunDependency']("gamepad");
}, false);
//chrome
if(!!navigator.webkitGetGamepads)
{
var timeout = function()
{
if(navigator.webkitGetGamepads()[0] !== undefined)
Module['removeRunDependency']("gamepad");
else
setTimeout(timeout, 100);
}
setTimeout(timeout, 100);
}
});
+54
View File
@@ -0,0 +1,54 @@
const searchParams = new URLSearchParams(window.location.search);
Module.preRun = () => {
};
const arguments = [];
for (let i = 1; true; i++) {
const arg_i = searchParams.get(`arg_${i}`);
if (arg_i == null) {
break;
}
arguments.push(arg_i);
}
Module.arguments = arguments;
if (searchParams.get("loghtml") === "1") {
const divTerm = document.createElement("div");
divTerm.id = "terminal";
document.body.append(divTerm);
function printToStdOut(msg, id) {
const divMsg = document.createElement("div", {class: "stdout"});
divMsg.id = id;
divMsg.append(document.createTextNode(msg));
divTerm.append(divMsg);
return divMsg;
}
Module.print = (msg) => {
console.log(msg);
printToStdOut(msg, "stdout");
}
Module.printErr = (msg) => {
console.error(msg);
const e = printToStdOut(msg, "stderr");
e.style = "color:red";
}
const divQuit = document.createElement("div");
divQuit.id = "process-quit";
document.body.append(divQuit);
Module.quit = (msg) => {
divQuit.innerText = msg;
console.log(`QUIT: ${msg}`)
}
Module.onabort = (msg) => {
printToStdOut(`ABORT: ${msg}`, "stderr");
console.log(`ABORT: ${msg}`);
}
}
+105
View File
@@ -0,0 +1,105 @@
#!/usr/bin/env python
# Based on http/server.py from Python
from argparse import ArgumentParser
import contextlib
from http.server import SimpleHTTPRequestHandler
from http.server import ThreadingHTTPServer
import os
import socket
class MyHTTPRequestHandler(SimpleHTTPRequestHandler):
extensions_map = {
".manifest": "text/cache-manifest",
".html": "text/html",
".cmake": "text/cmake",
".pc": "text/pkg-config",
".png": "image/png",
".jpg": "image/jpg",
".svg": "image/svg+xml",
".css": "text/css",
".js": "application/x-javascript",
".map": "application/json",
".wasm": "application/wasm",
"": "application/octet-stream",
}
def __init__(self, *args, maps=None, **kwargs):
self.maps = maps or []
SimpleHTTPRequestHandler.__init__(self, *args, **kwargs)
def end_headers(self):
self.send_my_headers()
SimpleHTTPRequestHandler.end_headers(self)
def send_my_headers(self):
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate")
self.send_header("Pragma", "no-cache")
self.send_header("Expires", "0")
def translate_path(self, path):
for map_path, map_prefix in self.maps:
if path.startswith(map_prefix):
res = os.path.join(map_path, path.removeprefix(map_prefix).lstrip("/"))
break
else:
res = super().translate_path(path)
return res
def serve_forever(port: int, ServerClass):
handler = MyHTTPRequestHandler
addr = ("0.0.0.0", port)
with ServerClass(addr, handler) as httpd:
host, port = httpd.socket.getsockname()[:2]
url_host = f"[{host}]" if ":" in host else host
print(f"Serving HTTP on {host} port {port} (http://{url_host}:{port}/) ...")
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt received, exiting.")
return 0
def main():
parser = ArgumentParser(allow_abbrev=False)
parser.add_argument("port", nargs="?", type=int, default=8080)
parser.add_argument("-d", dest="directory", type=str, default=None)
parser.add_argument("--map", dest="maps", nargs="+", default=[], type=str, help="Mappings, used as e.g. \"$HOME/projects/SDL:/sdl\"")
args = parser.parse_args()
maps = []
for m in args.maps:
try:
path, uri = m.split(":", 1)
except ValueError:
parser.error(f"Invalid mapping: \"{m}\"")
maps.append((path, uri))
class DualStackServer(ThreadingHTTPServer):
def server_bind(self):
# suppress exception when protocol is IPv4
with contextlib.suppress(Exception):
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
return super().server_bind()
def finish_request(self, request, client_address):
self.RequestHandlerClass(
request,
client_address,
self,
directory=args.directory,
maps=maps,
)
return serve_forever(
port=args.port,
ServerClass=DualStackServer,
)
if __name__ == "__main__":
raise SystemExit(main())
+35
View File
@@ -0,0 +1,35 @@
unsigned char gamepad_axis_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x32,
0x08, 0x06, 0x00, 0x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 0x65, 0xf6, 0x92,
0x66, 0x43, 0x64, 0x38, 0x50, 0xe8, 0x0d, 0xc0, 0x2d, 0x00, 0x0d, 0x3c,
0x1b, 0x02, 0x78, 0x27, 0x79, 0x37, 0x24, 0x41, 0xaa, 0xc4, 0x0b, 0x80,
0x7b, 0x00, 0x1f, 0x00, 0x26, 0x51, 0xbe, 0xae, 0x17, 0xf7, 0x18, 0x1d,
0x40, 0x05, 0xe0, 0x06, 0xc0, 0x2b, 0xc9, 0x87, 0x8b, 0x89, 0x84, 0x36,
0x78, 0x6a, 0x99, 0x2e, 0x23, 0xb1, 0x36, 0x2a, 0x00, 0x57, 0x2d, 0x73,
0x8f, 0x24, 0x9f, 0x2f, 0x25, 0xc2, 0xa6, 0x8d, 0x90, 0xfc, 0x94, 0xa4,
0x0e, 0xad, 0x46, 0x92, 0x94, 0x34, 0x6d, 0x3a, 0x08, 0x92, 0xbd, 0x5b,
0x75, 0x9a, 0x54, 0x46, 0x52, 0x92, 0xca, 0x33, 0xbc, 0x1b, 0x65, 0x53,
0xee, 0x94, 0x44, 0xd3, 0xe4, 0xcb, 0x95, 0xf8, 0xc1, 0x73, 0xe7, 0xa8,
0x19, 0xd7, 0xbf, 0x81, 0x45, 0x2c, 0x62, 0x11, 0x8b, 0x58, 0xc4, 0x22,
0x16, 0xb1, 0x88, 0x45, 0x8c, 0x31, 0xc6, 0x18, 0x63, 0x8c, 0x31, 0xc6,
0x18, 0x63, 0xbe, 0xf9, 0x02, 0xf4, 0x44, 0x2a, 0xe4, 0x3d, 0x63, 0x4f,
0x03, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60,
0x82
};
unsigned int gamepad_axis_png_len = 373;
Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

+15
View File
@@ -0,0 +1,15 @@
unsigned char gamepad_axis_arrow_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0c,
0x08, 0x06, 0x00, 0x00, 0x00, 0x41, 0x57, 0xcc, 0x2e, 0x00, 0x00, 0x00,
0x4d, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x6d, 0x8f, 0x51, 0x0a, 0x40,
0x21, 0x08, 0x04, 0x47, 0xe9, 0xde, 0xf9, 0xea, 0x70, 0x1d, 0xab, 0xf7,
0x53, 0x61, 0xda, 0x82, 0xb0, 0xec, 0xe0, 0x8a, 0x32, 0xc6, 0x30, 0xe0,
0xe3, 0x96, 0x28, 0x50, 0xd7, 0x78, 0x4d, 0x5d, 0x26, 0x41, 0x75, 0xfe,
0x82, 0x1a, 0x2a, 0x0e, 0x2c, 0x64, 0xd5, 0xd7, 0x46, 0x3a, 0xee, 0x65,
0x40, 0x2f, 0x8f, 0xb0, 0xc5, 0xaa, 0x13, 0x7a, 0x60, 0x40, 0x8f, 0x7f,
0xec, 0x70, 0x02, 0xb2, 0xc1, 0x0f, 0x75, 0x68, 0x0f, 0xf5, 0xfa, 0x22,
0xae, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82
};
unsigned int gamepad_axis_arrow_png_len = 134;
Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

+1006
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+20
View File
@@ -0,0 +1,20 @@
unsigned char gamepad_battery_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10,
0x08, 0x06, 0x00, 0x00, 0x00, 0xee, 0xf8, 0xa4, 0xec, 0x00, 0x00, 0x00,
0x8f, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0xe0, 0xe5, 0xe5, 0x5d,
0xcf, 0xc0, 0xc0, 0xf0, 0x9f, 0x4e, 0xf8, 0x2b, 0x17, 0x17, 0x57, 0x10,
0x03, 0x14, 0x30, 0x42, 0x05, 0xbf, 0x31, 0x30, 0x30, 0x5c, 0x67, 0xa0,
0x2d, 0xe0, 0x62, 0x60, 0x60, 0xd0, 0x64, 0x60, 0x60, 0x98, 0xc5, 0xc0,
0xc0, 0x90, 0xce, 0xc0, 0xc0, 0xc0, 0xc0, 0x02, 0x95, 0xb8, 0xce, 0xc0,
0xc0, 0x60, 0x42, 0x63, 0xcb, 0x8d, 0x19, 0x18, 0x18, 0xce, 0x20, 0x0b,
0x30, 0x31, 0x0c, 0x20, 0x60, 0x19, 0x00, 0x3b, 0x83, 0xa0, 0xa1, 0xf0,
0x6d, 0x20, 0x2c, 0x17, 0x81, 0xe2, 0x81, 0x0d, 0xf6, 0x51, 0xcb, 0x47,
0x9e, 0xe5, 0x03, 0x91, 0xda, 0xdf, 0x30, 0x30, 0x30, 0x3c, 0x1c, 0xa8,
0xac, 0xb6, 0x0e, 0x56, 0xbc, 0x0e, 0x8a, 0x60, 0xd7, 0x44, 0x2f, 0x77,
0x69, 0x54, 0xb1, 0xa0, 0x02, 0x35, 0x35, 0xb5, 0x3d, 0xf4, 0xaa, 0x52,
0xa5, 0xa4, 0xa4, 0x7e, 0x1b, 0x18, 0x18, 0x44, 0xc2, 0xec, 0x06, 0x00,
0x42, 0x20, 0x46, 0x13, 0x33, 0x17, 0x16, 0x03, 0x00, 0x00, 0x00, 0x00,
0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_battery_png_len = 200;
Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

+179
View File
@@ -0,0 +1,179 @@
unsigned char gamepad_battery_unknown_bmp[] = {
0x42, 0x4d, 0x3a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x00,
0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x03, 0x00, 0x00, 0x00, 0xc0, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x20, 0x6e,
0x69, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x26, 0x26, 0x26, 0xbc, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x1a, 0x1a, 0x1a, 0xfb, 0x30, 0x30, 0x30, 0x59, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xf5, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0x99, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0x99, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00,
0x00, 0xed, 0x00, 0x00, 0x00, 0x2a, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x99, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x56, 0x56,
0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0xd5, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, 0x00, 0x2a, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xeb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06,
0x06, 0x00, 0x4a, 0x4a, 0x4a, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x23, 0x23, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
0x02, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x01,
0x01, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x95, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xf2, 0x00, 0x00,
0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00,
0x00, 0xac, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00,
0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x00, 0x23, 0x23, 0x23, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00,
0x00, 0xeb, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf3, 0x00, 0x00,
0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x3e, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00,
0x00, 0x1d, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xac, 0xff, 0xff, 0xff, 0x00, 0x01, 0x01,
0x01, 0x00, 0x32, 0x32, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x92, 0x92, 0x92, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x42, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x02, 0x02, 0x02, 0x00, 0x1a, 0x1a, 0x1a, 0x00, 0x45, 0x45,
0x45, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xc2, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xcc, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x53, 0x00, 0x00, 0x00, 0xb3, 0x00, 0x00, 0x00, 0xe5, 0x00, 0x00,
0x00, 0xf3, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x49, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x99, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xcc, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0x99, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xf5, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00,
0x00, 0xcc, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0x99, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff,
0xff, 0x00, 0x0d, 0x0d, 0x0d, 0xaf, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0xf5, 0x0a, 0x0a, 0x0a, 0x52, 0xff, 0xff,
0xff, 0x00, 0xff, 0xff, 0xff, 0x00
};
unsigned int gamepad_battery_unknown_bmp_len = 2106;
Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

+37
View File
@@ -0,0 +1,37 @@
unsigned char gamepad_battery_wired_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x10,
0x08, 0x06, 0x00, 0x00, 0x00, 0xee, 0xf8, 0xa4, 0xec, 0x00, 0x00, 0x01,
0x5a, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0xcd, 0x95, 0x3f, 0x48, 0x02,
0x51, 0x1c, 0xc7, 0x3f, 0xbf, 0xf7, 0xc2, 0xe1, 0x1d, 0x0e, 0x17, 0x07,
0xc2, 0x2d, 0x37, 0x1c, 0x48, 0x2e, 0x26, 0xda, 0xea, 0x94, 0x42, 0x38,
0x3a, 0x08, 0x41, 0x73, 0xad, 0x6e, 0x0d, 0xce, 0xcd, 0xc2, 0x6d, 0xb6,
0x36, 0x47, 0x63, 0x12, 0x4d, 0xce, 0x36, 0x0b, 0x4d, 0xee, 0xad, 0xd9,
0xd2, 0xf0, 0x5c, 0xce, 0x38, 0x2e, 0xbc, 0x4e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x78,
0x00, 0xa5, 0x52, 0xe9, 0x29, 0x29, 0x1c, 0x4a, 0xa9, 0x8b, 0x9c, 0xab,
0x96, 0x0d, 0x57, 0x4a, 0x19, 0x60, 0x08, 0x8c, 0x45, 0xe4, 0x0b, 0x98,
0xaa, 0xc8, 0x00, 0xb0, 0x85, 0x42, 0xe1, 0xa5, 0xd3, 0xe9, 0x1c, 0x6d,
0xb0, 0xe7, 0xd9, 0xf0, 0x5e, 0xaf, 0xd7, 0x04, 0xbc, 0xac, 0x28, 0x22,
0x12, 0x00, 0x43, 0xad, 0xb5, 0xd9, 0x50, 0x64, 0x2c, 0xf0, 0xb6, 0xd5,
0xaa, 0xfd, 0x82, 0xc2, 0x59, 0x60, 0xf4, 0x2f, 0x14, 0x6e, 0xa5, 0xed,
0x95, 0x3d, 0xbc, 0xfe, 0x7b, 0x8b, 0xca, 0xe5, 0xf2, 0xf3, 0xbe, 0x7e,
0xa9, 0xbe, 0xef, 0x7f, 0xd6, 0x6a, 0xb5, 0xf3, 0x15, 0x7b, 0x09, 0xc4,
0x22, 0xa6, 0xf6, 0x7e, 0x89, 0x28, 0x57, 0x00, 0x00, 0x00, 0x00, 0x49,
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_battery_wired_png_len = 403;
Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

+255
View File
@@ -0,0 +1,255 @@
unsigned char gamepad_button_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x32,
0x08, 0x06, 0x00, 0x00, 0x00, 0x1e, 0x3f, 0x88, 0xb1, 0x00, 0x00, 0x0b,
0x91, 0x49, 0x44, 0x41, 0x54, 0x68, 0xde, 0xed, 0x9a, 0x49, 0x6f, 0x1c,
0xd5, 0x16, 0xc7, 0x7f, 0xd5, 0x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 0x03,
0x5b, 0xcf, 0x6b, 0xfd, 0xc5, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_button_png_len = 3018;
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+53
View File
@@ -0,0 +1,53 @@
unsigned char gamepad_button_background_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x20,
0x08, 0x02, 0x00, 0x00, 0x00, 0xc2, 0x3d, 0x82, 0xed, 0x00, 0x00, 0x02,
0x1a, 0x49, 0x44, 0x41, 0x54, 0x58, 0xc3, 0xd5, 0x98, 0x3b, 0xaf, 0x82,
0x30, 0x14, 0xc7, 0xa9, 0x39, 0x31, 0x06, 0x8d, 0x4e, 0x6a, 0x22, 0x71,
0x72, 0x62, 0x34, 0x71, 0xf3, 0x6b, 0xf8, 0x7d, 0x9d, 0xdc, 0xdc, 0x8c,
0xb3, 0x89, 0x8b, 0x0e, 0x3e, 0x22, 0x49, 0x1d, 0x4c, 0x3c, 0xdc, 0xa1,
0x37, 0xbd, 0xa5, 0xf4, 0xc2, 0x69, 0x01, 0x05, 0x06, 0xd3, 0x87, 0x94,
0x5f, 0xe9, 0xff, 0x3c, 0x38, 0x2c, 0x08, 0x82, 0x30, 0x0c, 0xa7, 0xd3,
0xe9, 0x64, 0x32, 0x69, 0xb7, 0xdb, 0x9e, 0xe7, 0xc5, 0x71, 0xec, 0x79,
0x9e, 0x55, 0x43, 0x76, 0x8d, 0x6d, 0xe2, 0x6c, 0x46, 0x23, 0x3d, 0x88,
0x88, 0xf7, 0xfb, 0xfd, 0x78, 0x3c, 0x9e, 0xcf, 0x67, 0x98, 0xcd, 0x66,
0xf3, 0xf9, 0x7c, 0xb5, 0x5a, 0x05, 0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 0x98, 0x58, 0xc4, 0xb5, 0x3d, 0x37, 0xe2, 0x26,
0xff, 0x1b, 0x47, 0x44, 0xce, 0xf9, 0x6e, 0xb7, 0xbb, 0x5e, 0xaf, 0x70,
0x38, 0x1c, 0x00, 0xe0, 0x76, 0xbb, 0x8d, 0xc7, 0x63, 0x00, 0x48, 0x17,
0xcd, 0xad, 0x8a, 0xec, 0x19, 0xd5, 0xf6, 0xdc, 0x6a, 0x3e, 0x71, 0x11,
0xb9, 0x87, 0x28, 0x8a, 0x4e, 0xa7, 0xd3, 0xe5, 0x72, 0xf9, 0x01, 0xc4,
0xc7, 0x93, 0xca, 0x48, 0xca, 0xb8, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x49,
0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_button_background_png_len = 595;
Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

+21
View File
@@ -0,0 +1,21 @@
unsigned char gamepad_button_small_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c,
0x08, 0x02, 0x00, 0x00, 0x00, 0xd9, 0x17, 0xcb, 0xb0, 0x00, 0x00, 0x00,
0x96, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x7d, 0x51, 0xc1, 0x09, 0xc4,
0x30, 0x0c, 0x23, 0x57, 0x3f, 0x43, 0xbb, 0x4d, 0x16, 0xc8, 0x1c, 0x9d,
0x20, 0xab, 0x76, 0x96, 0x40, 0xbf, 0x45, 0x92, 0xef, 0xe1, 0xbb, 0x10,
0x7a, 0x47, 0xf3, 0x30, 0x02, 0x2b, 0x92, 0x2d, 0xa7, 0xd6, 0xda, 0xb2,
0x2c, 0xee, 0x4e, 0x52, 0x92, 0xbb, 0xbb, 0xbb, 0xa4, 0x81, 0x01, 0x58,
0xad, 0xb5, 0x94, 0x22, 0x09, 0x00, 0xc9, 0xa0, 0x02, 0x00, 0x20, 0x89,
0xe4, 0x71, 0x1c, 0xb6, 0xae, 0xeb, 0xb6, 0x6d, 0x24, 0x83, 0x34, 0xd7,
0x00, 0x39, 0xe7, 0x57, 0x88, 0xf3, 0xfb, 0x02, 0x87, 0xdd, 0x18, 0xc0,
0x82, 0x3e, 0x7f, 0xfd, 0xd5, 0xb3, 0x07, 0xa3, 0x51, 0xed, 0xb9, 0xfd,
0x51, 0x1a, 0x7b, 0xdd, 0x48, 0x77, 0xbb, 0x67, 0x47, 0x49, 0x06, 0xe0,
0xba, 0xae, 0xbf, 0x1a, 0x11, 0x15, 0x00, 0xeb, 0xbd, 0xf7, 0xde, 0x47,
0x2f, 0x36, 0x9f, 0xc3, 0x3c, 0xcf, 0x33, 0xed, 0xfb, 0x9e, 0x52, 0x8a,
0xb4, 0x00, 0x8c, 0xb3, 0xcc, 0xe0, 0x0d, 0x2c, 0x79, 0x93, 0xbb, 0x6d,
0x9c, 0x9f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82
};
unsigned int gamepad_button_small_png_len = 207;
Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

+182
View File
@@ -0,0 +1,182 @@
unsigned char gamepad_face_abxy_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x50,
0x08, 0x06, 0x00, 0x00, 0x00, 0x04, 0x3e, 0x6b, 0xec, 0x00, 0x00, 0x08,
0x25, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x9d, 0x6b, 0x8c, 0x9c,
0x55, 0x19, 0xc7, 0x7f, 0xff, 0x33, 0xef, 0x4e, 0xbb, 0x4b, 0x29, 0xb5,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x98, 0x59, 0xb6,
0x72, 0xe5, 0xca, 0x7a, 0x74, 0x8c, 0x91, 0x48, 0x24, 0x12, 0x89, 0x44,
0x22, 0x91, 0x48, 0x24, 0x12, 0x89, 0x44, 0x22, 0x91, 0x48, 0x24, 0x12,
0x89, 0x1c, 0x29, 0x8a, 0x53, 0x30, 0x3b, 0xa4, 0x69, 0x9a, 0xd0, 0xa8,
0x44, 0x3d, 0x09, 0x68, 0x3f, 0xe8, 0x69, 0xa3, 0x51, 0x29, 0x34, 0x61,
0x66, 0x4f, 0x03, 0x23, 0x5d, 0x5d, 0x5d, 0x2f, 0x44, 0x71, 0x8e, 0x9e,
0x38, 0x0b, 0x81, 0x07, 0x80, 0x15, 0xaf, 0x70, 0xda, 0x1e, 0x60, 0x04,
0xe8, 0x97, 0x74, 0x3b, 0x30, 0x5a, 0x28, 0x14, 0xf6, 0x55, 0x0c, 0x25,
0x00, 0xc3, 0xc3, 0xc3, 0x4e, 0x92, 0x79, 0xef, 0xd5, 0x14, 0xac, 0xbb,
0xbb, 0x7b, 0xc6, 0x9e, 0x97, 0x6d, 0xdb, 0xb6, 0x35, 0xbf, 0x02, 0x56,
0x92, 0x24, 0x02, 0xb4, 0x64, 0xc9, 0x92, 0x5a, 0x94, 0x63, 0x46, 0xea,
0xe1, 0xcf, 0x80, 0x7f, 0x02, 0xcf, 0x85, 0xc7, 0x02, 0xe6, 0x01, 0xcb,
0x80, 0xd3, 0x81, 0x6e, 0x33, 0x3b, 0x01, 0xf8, 0x22, 0xf0, 0xe2, 0x3e,
0xcb, 0xd9, 0xb6, 0x6d, 0x9b, 0x02, 0xa7, 0x00, 0x1f, 0xa6, 0x51, 0x35,
0x39, 0x25, 0xe9, 0x4f, 0x92, 0x46, 0x96, 0x2c, 0x59, 0xe2, 0x01, 0xaa,
0xd5, 0x6a, 0x0e, 0x28, 0x98, 0xd9, 0x39, 0xd3, 0xce, 0xf9, 0x23, 0x30,
0x66, 0x66, 0xbe, 0x58, 0x2c, 0x5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x92, 0xc6, 0x4a,
0xa5, 0xd2, 0x8b, 0x51, 0x9c, 0x59, 0x60, 0x60, 0x60, 0xa0, 0xf9, 0xdb,
0x38, 0x02, 0xb2, 0x57, 0xdb, 0xd8, 0xac, 0x54, 0x2a, 0x2e, 0xcb, 0xb2,
0x5c, 0xf3, 0xc6, 0x3e, 0x07, 0xbb, 0xbf, 0x56, 0xe0, 0xbf, 0x6e, 0x55,
0x51, 0x1b, 0x27, 0x06, 0x19, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_face_abxy_png_len = 2142;
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+173
View File
@@ -0,0 +1,173 @@
unsigned char gamepad_face_axby_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x50,
0x08, 0x06, 0x00, 0x00, 0x00, 0x04, 0x3e, 0x6b, 0xec, 0x00, 0x00, 0x07,
0xb8, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x9d, 0x7b, 0x8c, 0x5c,
0x55, 0x1d, 0xc7, 0x3f, 0xbf, 0x7b, 0x6f, 0xa7, 0xdd, 0xed, 0x83, 0x5a,
0xc0, 0x5a, 0x2d, 0x8f, 0x34, 0x9d, 0x5d, 0x4a, 0x55, 0x6c, 0xb6, 0x76,
0x67, 0xdb, 0x15, 0xe5, 0xa1, 0x15, 0x45, 0x52, 0x9f, 0x09, 0xb1, 0x46,
0x7c, 0x25, 0x46, 0x05, 0x15, 0xa2, 0x06, 0x83, 0x25, 0x22, 0x2a, 0x90,
0x10, 0xdb, 0x14, 0xf1, 0x2f, 0x51, 0x08, 0xa6, 0x3e, 0x22, 0x6a, 0x54,
0x54, 0x04, 0xc4, 0x6d, 0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 0xb1, 0x7f, 0xb9, 0x5f, 0x23, 0x54, 0x2a, 0x95, 0xd3, 0x25, 0xad,
0x03, 0xde, 0x0f, 0x14, 0xfc, 0xe1, 0x11, 0x60, 0x43, 0x9a, 0xa6, 0xd7,
0x76, 0x76, 0x76, 0x0e, 0xe4, 0xb5, 0x6f, 0x11, 0xf9, 0x67, 0xbf, 0x99,
0xdd, 0xe2, 0xe7, 0x9f, 0x14, 0x68, 0x00, 0x5b, 0x81, 0xdb, 0x92, 0x24,
0x39, 0x90, 0xe7, 0x8e, 0xe5, 0x5e, 0x9c, 0x52, 0xa9, 0xe4, 0x9c, 0x73,
0xbb, 0x24, 0x95, 0xbd, 0xc5, 0xd4, 0x25, 0xf5, 0x48, 0xda, 0x5d, 0x2a,
0x95, 0x5c, 0xd8, 0x21, 0x38, 0x39, 0x18, 0x02, 0x34, 0xe6, 0x79, 0xee,
0x89, 0x08, 0x04, 0x71, 0x02, 0xff, 0xdf, 0x6e, 0x2d, 0x02, 0xa6, 0x78,
0xd7, 0x16, 0x05, 0x71, 0x4e, 0x96, 0xf5, 0x80, 0xd9, 0x30, 0xf0, 0x2b,
0x33, 0xdb, 0xe3, 0x0f, 0xfd, 0xd9, 0x07, 0x07, 0xf9, 0xee, 0xd7, 0xa9,
0x62, 0x36, 0x5b, 0xb6, 0x6c, 0x49, 0x80, 0x58, 0x12, 0x92, 0xd2, 0xf6,
0xf6, 0xf6, 0x46, 0x70, 0x8c, 0x81, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02,
0x81, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x81, 0x40, 0x20, 0x10, 0x08,
0x1c, 0x2f, 0x16, 0x86, 0x60, 0x72, 0xa8, 0x56, 0xab, 0xe7, 0x02, 0xef,
0x24, 0x4b, 0xd7, 0x1a, 0x31, 0xb3, 0xdf, 0x9b, 0x59, 0xdf, 0xc2, 0x85,
0x0b, 0x1d, 0x40, 0xad, 0x56, 0x8b, 0x81, 0xa2, 0xa4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0xdf, 0xbc, 0x79, 0x73, 0x53, 0x9a,
0xa6, 0xab, 0xc8, 0x6e, 0x69, 0xd2, 0x00, 0x2a, 0x66, 0xd6, 0x5f, 0x2a,
0x95, 0x0e, 0x06, 0x71, 0x26, 0x81, 0xee, 0xee, 0xee, 0xd1, 0xff, 0xc6,
0x31, 0x20, 0x3d, 0xd6, 0xc6, 0x66, 0xa5, 0x52, 0x89, 0xd2, 0x34, 0x8d,
0x7d, 0xf5, 0x84, 0x8d, 0x77, 0x7f, 0x79, 0xe0, 0x3f, 0xad, 0x97, 0x1b,
0xc1, 0x0a, 0xea, 0xec, 0x90, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_face_axby_png_len = 2033;
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+178
View File
@@ -0,0 +1,178 @@
unsigned char gamepad_face_bayx_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x50,
0x08, 0x06, 0x00, 0x00, 0x00, 0x04, 0x3e, 0x6b, 0xec, 0x00, 0x00, 0x07,
0xf3, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x9d, 0x6d, 0x8c, 0x5c,
0x55, 0x19, 0xc7, 0x7f, 0xcf, 0xb9, 0x77, 0x76, 0xcb, 0xb6, 0x85, 0xca,
0x9b, 0xa9, 0x22, 0xba, 0x9b, 0xdd, 0xd9, 0x5d, 0x24, 0x22, 0x36, 0xed,
0x3a, 0xb3, 0xad, 0x06, 0x44, 0x2b, 0x88, 0xd8, 0x28, 0x31, 0x41, 0x9a,
0x88, 0x6f, 0x09, 0x51, 0x04, 0x49, 0xf0, 0x03, 0x44, 0x20, 0x1a, 0x34,
0x48, 0x62, 0x84, 0x80, 0x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
0x6d, 0x40, 0xf0, 0x6c, 0x18, 0x53, 0xa6, 0xf6, 0xb9, 0x16, 0xda, 0x26,
0xe9, 0x37, 0xc0, 0x49, 0xc1, 0xf5, 0x95, 0xc9, 0xe7, 0x34, 0x88, 0x96,
0xd3, 0x62, 0x97, 0xbc, 0xc8, 0xcc, 0xde, 0x5e, 0xa9, 0x54, 0xa6, 0x4b,
0xf9, 0x2c, 0x44, 0x69, 0x2b, 0xc9, 0x4b, 0x2a, 0x9a, 0x40, 0x2d, 0x2c,
0xa3, 0x38, 0x2d, 0xa4, 0x0b, 0xb8, 0x00, 0xf8, 0xdc, 0xf4, 0x45, 0x28,
0x79, 0x89, 0x5f, 0x4f, 0x88, 0xd6, 0x0c, 0x18, 0x37, 0xb3, 0x5b, 0x69,
0xd3, 0xda, 0xa2, 0xb4, 0x4d, 0x8f, 0x39, 0x0d, 0xd1, 0xd9, 0x92, 0x19,
0xf6, 0x4f, 0x85, 0x30, 0xfa, 0x09, 0xe0, 0x26, 0x49, 0xbf, 0x2b, 0x95,
0x4a, 0x8d, 0x28, 0xce, 0xc1, 0xe7, 0x65, 0xf2, 0xa9, 0x27, 0xe7, 0xba,
0xf1, 0xd9, 0x04, 0x5e, 0x96, 0xb4, 0x3d, 0x4d, 0xd3, 0xfa, 0xb2, 0x65,
0xcb, 0x62, 0xf2, 0x7d, 0xe4, 0x8d, 0xe7, 0xdf, 0x3c, 0x59, 0x2a, 0xf3,
0x47, 0x3b, 0xea, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_face_bayx_png_len = 2092;
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+173
View File
@@ -0,0 +1,173 @@
unsigned char gamepad_face_sony_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x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 0xf6,
0xf6, 0xf6, 0xa1, 0x44, 0xb8, 0xa6, 0x44, 0xb8, 0x0d, 0xc9, 0xb3, 0x5f,
0x93, 0xb4, 0x15, 0x38, 0x16, 0x4c, 0xe9, 0x19, 0xa2, 0xa7, 0xa7, 0xc7,
0x01, 0x6f, 0x30, 0xb3, 0x95, 0xc0, 0xe7, 0x80, 0x3f, 0x9a, 0xd9, 0x57,
0x80, 0xd2, 0x2b, 0x87, 0xae, 0xc4, 0x31, 0xed, 0x02, 0xd6, 0x01, 0x17,
0x03, 0x9b, 0x25, 0x6d, 0x01, 0x9e, 0xe9, 0xe8, 0xe8, 0xa8, 0x2b, 0x23,
0xa1, 0x5e, 0x66, 0xce, 0x46, 0x6a, 0x87, 0xfb, 0x5c, 0x07, 0x6c, 0x03,
0x6e, 0x70, 0xce, 0x15, 0xc7, 0x9b, 0x53, 0xf2, 0xf9, 0x7c, 0xd5, 0x39,
0xb7, 0x4b, 0xd2, 0xf5, 0xc9, 0xaa, 0xc2, 0xe7, 0xcd, 0x6c, 0x49, 0x72,
0xc5, 0x4b, 0x58, 0xbe, 0x99, 0x01, 0x46, 0x81, 0x3d, 0xc0, 0x8d, 0x92,
0x56, 0x3b, 0xe7, 0x9e, 0x9a, 0xa8, 0x17, 0xb4, 0xb7, 0xb7, 0x7b, 0xe0,
0x4f, 0xc9, 0x45, 0x46, 0x37, 0x99, 0x59, 0xd1, 0xcc, 0xea, 0xda, 0x38,
0xa8, 0x87, 0x79, 0x67, 0xca, 0xa6, 0xff, 0xde, 0xbd, 0x7b, 0xeb, 0xd6,
0x5d, 0xf8, 0x0f, 0xeb, 0xe3, 0x37, 0xe6, 0x9d, 0x87, 0x34, 0x96, 0x00,
0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_face_sony_png_len = 2039;
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+2142
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+52
View File
@@ -0,0 +1,52 @@
unsigned char gamepad_touchpad_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x9f,
0x08, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xbc, 0x3e, 0x99, 0x00, 0x00, 0x02,
0x11, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0xda, 0xb1, 0x2e, 0x43,
0x51, 0x18, 0xc0, 0xf1, 0x7b, 0xb4, 0xc2, 0x20, 0xa6, 0xa6, 0x9e, 0xa0,
0x8b, 0xc1, 0x64, 0x6a, 0xa4, 0x31, 0x1a, 0x49, 0xc4, 0x03, 0x78, 0x00,
0x7d, 0x00, 0x8b, 0x45, 0xcc, 0xbc, 0x82, 0xad, 0x91, 0x18, 0x59, 0x1a,
0x86, 0x8e, 0x9d, 0x74, 0x64, 0x17, 0x06, 0x83, 0x48, 0x90, 0xe2, 0x7a,
0x85, 0x13, 0x89, 0xe4, 0xf8, 0xfc, 0x7e, 0x4f, 0xf0, 0xdd, 0x73, 0xfe,
0x39, 0x3d, 0xf7, 0xa6, 0xa9, 0xae, 0xf8, 0xcf, 0x66, 0x2c, 0x81, 0x00,
0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80,
0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04,
0x80, 0x00, 0x10, 0x00, 0x51, 0x34, 0xcb, 0x1c, 0x6b, 0x7a, 0x33, 0x38,
0x7e, 0x0f, 0xb4, 0xcc, 0x73, 0xfd, 0x9d, 0x95, 0xd9, 0x22, 0x27, 0x4b,
0x45, 0xfe, 0x29, 0xf4, 0xf9, 0xf0, 0xfc, 0xf6, 0xbc, 0xdd, 0x08, 0xb3,
0xff, 0x9f, 0x8f, 0x5b, 0x9d, 0xad, 0xfd, 0x45, 0x01, 0x64, 0x7a, 0x3b,
0x18, 0xef, 0xb5, 0x83, 0x1d, 0xb5, 0x8f, 0x27, 0xab, 0x07, 0xf3, 0xee,
0x00, 0x79, 0xc6, 0x57, 0xfd, 0x68, 0xfb, 0x5f, 0xb5, 0xfb, 0x57, 0x63,
0x97, 0xc0, 0xbc, 0xf3, 0xb2, 0xba, 0xd8, 0x6c, 0xc5, 0xbb, 0x6d, 0xb5,
0x36, 0x2f, 0x04, 0x90, 0xe5, 0xab, 0x9a, 0x2c, 0xa7, 0x78, 0x01, 0xa4,
0xe5, 0x89, 0x3b, 0x40, 0xde, 0x1b, 0xc0, 0x6c, 0xba, 0x9e, 0x0b, 0xf8,
0xc2, 0xf5, 0xbe, 0x5e, 0x3b, 0x01, 0x32, 0x35, 0x02, 0xee, 0x7f, 0xa1,
0x0f, 0xe5, 0x43, 0xd0, 0x3f, 0x27, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80,
0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04,
0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00,
0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20,
0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01,
0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00,
0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08,
0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00,
0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40,
0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02,
0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00,
0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10,
0x00, 0x02, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20, 0x00,
0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00, 0x08, 0x00, 0x01, 0x20,
0x00, 0x04, 0x80, 0x00, 0x10, 0xc0, 0xef, 0xeb, 0xbc, 0x46, 0x5c, 0xea,
0xd7, 0x8e, 0x00, 0xb2, 0xa4, 0xaa, 0x7b, 0x1f, 0x31, 0x80, 0xfb, 0xae,
0x00, 0x32, 0x47, 0xea, 0x0d, 0xa7, 0xf1, 0xf6, 0x7f, 0x3a, 0xec, 0x09,
0x20, 0x73, 0xa4, 0xdd, 0xbb, 0x51, 0x1d, 0x6d, 0xff, 0xeb, 0xd1, 0xdd,
0x6e, 0x89, 0x73, 0x35, 0x8b, 0x5c, 0xac, 0xa3, 0x9d, 0xa7, 0x8d, 0x85,
0x48, 0x0d, 0xa4, 0x97, 0xcb, 0xd3, 0x41, 0x9d, 0x4a, 0x9c, 0xac, 0xd0,
0x65, 0xde, 0x1e, 0x3d, 0x84, 0x3a, 0x00, 0x96, 0xd6, 0xce, 0x0a, 0x4d,
0xb3, 0xcc, 0x00, 0x3e, 0x9a, 0x55, 0x2c, 0xc5, 0x3e, 0x50, 0x0a, 0xf7,
0x63, 0xcb, 0xdf, 0xff, 0x0e, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40, 0x00,
0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x02, 0x40,
0x00, 0x08, 0x00, 0x01, 0x20, 0x00, 0x04, 0x80, 0x00, 0x10, 0x00, 0x3f,
0xf1, 0x0d, 0xad, 0x48, 0x43, 0x0c, 0x80, 0x83, 0x4d, 0x10, 0x00, 0x00,
0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_touchpad_png_len = 586;
Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

+31
View File
@@ -0,0 +1,31 @@
unsigned char gamepad_wired_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10,
0x08, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x31, 0x94, 0x5f, 0x00, 0x00, 0x01,
0x11, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0xad, 0xd2, 0xbd, 0x4a, 0x43,
0x41, 0x10, 0x86, 0xe1, 0x27, 0x89, 0x49, 0x21, 0xa2, 0xa8, 0x9d, 0x85,
0x28, 0x12, 0xbc, 0x02, 0x0b, 0xb1, 0x11, 0xc4, 0x4e, 0x0c, 0x76, 0x21,
0x42, 0x4a, 0xab, 0x08, 0xe6, 0x1e, 0xec, 0xc4, 0xd2, 0xce, 0x46, 0x3b,
0xaf, 0xc0, 0x46, 0xb4, 0x12, 0xbc, 0x00, 0x3b, 0x0b, 0x41, 0x1b, 0x11,
0x6c, 0x34, 0xa8, 0xf8, 0x77, 0x6c, 0xf6, 0x40, 0x3c, 0x6c, 0x4c, 0x0c,
0x0e, 0x2c, 0xbb, 0x3b, 0xfb, 0xed, 0x3b, 0xb3, 0xb3, 0x93, 0x43, 0x05,
0x25, 0x4c, 0x63, 0x07, 0x89, 0x3f, 0x5a, 0x1e, 0x43, 0x38, 0xc1, 0x1d,
0x8a, 0xfa, 0xb4, 0xf7, 0x10, 0x3d, 0x41, 0xe3, 0x17, 0xdd, 0x14, 0x6a,
0x58, 0xc3, 0x58, 0xf6, 0x30, 0x69, 0x1b, 0xcd, 0xc8, 0xe5, 0x1c, 0xb6,
0xf1, 0x88, 0x53, 0x5c, 0xe0, 0x21, 0x00, 0x7b, 0x86, 0x6c, 0xe1, 0x1a,
0x33, 0x6d, 0xbe, 0x45, 0x3c, 0x61, 0xa1, 0x17, 0x48, 0x21, 0x44, 0xad,
0x46, 0xe0, 0xbb, 0x38, 0x4e, 0x37, 0xf5, 0x20, 0xdc, 0x47, 0x39, 0x23,
0x9c, 0x08, 0xf0, 0xd9, 0x08, 0xa4, 0x86, 0x9b, 0xf4, 0x77, 0x0e, 0xd1,
0x0a, 0xef, 0xbd, 0x8a, 0x64, 0x92, 0x16, 0x3f, 0x6b, 0x1f, 0xe9, 0x79,
0xde, 0x3f, 0x58, 0xbf, 0x90, 0x32, 0x96, 0x30, 0x88, 0xfa, 0x40, 0x70,
0x3e, 0x63, 0x38, 0x22, 0x1e, 0x09, 0x73, 0x2b, 0xe3, 0x5f, 0xc1, 0x46,
0x58, 0x1f, 0xa4, 0x99, 0x9c, 0x61, 0x35, 0x02, 0xa9, 0xe0, 0x12, 0xf7,
0xbd, 0xa4, 0x37, 0x8e, 0x5b, 0xec, 0x61, 0x32, 0x74, 0xe4, 0x66, 0xe8,
0x85, 0xf9, 0x88, 0xbe, 0x99, 0x69, 0x8d, 0x1f, 0xdf, 0x79, 0x84, 0x57,
0x7c, 0xe1, 0x1c, 0x73, 0x1d, 0x82, 0x36, 0xda, 0x00, 0x6f, 0x9d, 0x8a,
0x5d, 0xea, 0x92, 0x79, 0x31, 0xf4, 0xd7, 0x28, 0xd6, 0x0b, 0x11, 0x41,
0x82, 0xcf, 0x2e, 0x90, 0x04, 0xcb, 0xa1, 0x0c, 0x2f, 0xdf, 0x50, 0x7e,
0x3f, 0xf6, 0xd5, 0xcb, 0x86, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_wired_png_len = 330;
Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

+30
View File
@@ -0,0 +1,30 @@
unsigned char gamepad_wireless_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10,
0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x61, 0x00, 0x00, 0x01,
0x09, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0xb5, 0xd3, 0x21, 0x48, 0xc3,
0x41, 0x14, 0x06, 0xf0, 0x9f, 0x13, 0x83, 0x73, 0x9a, 0x56, 0x0c, 0x26,
0x99, 0x18, 0x44, 0x10, 0x11, 0x74, 0xa0, 0x55, 0x34, 0x2f, 0x0a, 0x66,
0xab, 0x20, 0x06, 0xab, 0x4d, 0x41, 0xb0, 0xcd, 0xa2, 0x98, 0x2d, 0x2b,
0x82, 0x55, 0xb1, 0x29, 0x58, 0x6c, 0x0a, 0x1a, 0x05, 0xc1, 0x85, 0xcd,
0x60, 0x70, 0x96, 0x37, 0x38, 0xc6, 0x7f, 0x43, 0x26, 0x7e, 0xf0, 0xb8,
0x77, 0xef, 0x7d, 0xef, 0xee, 0xdd, 0x77, 0x77, 0xfc, 0x11, 0x03, 0x3d,
0xe2, 0xb3, 0x18, 0x8a, 0xf9, 0x37, 0x1e, 0x62, 0xec, 0x89, 0x75, 0xd4,
0xf0, 0x89, 0x56, 0x87, 0x7d, 0xe1, 0x12, 0x95, 0xac, 0x0e, 0xa6, 0x71,
0x8a, 0x45, 0x34, 0x70, 0x85, 0x1b, 0x34, 0x23, 0x9f, 0xc7, 0x0a, 0x56,
0x51, 0xc0, 0x3d, 0x36, 0xf1, 0x28, 0x82, 0xcd, 0xb0, 0xdd, 0x20, 0xb4,
0x91, 0xc3, 0x60, 0x32, 0x2f, 0x04, 0xa7, 0xcd, 0x5f, 0x83, 0x3a, 0x5e,
0x50, 0x0a, 0xd2, 0x1c, 0xce, 0xf1, 0x96, 0xb4, 0xff, 0x81, 0x0b, 0x2c,
0x07, 0xa7, 0x14, 0x35, 0x75, 0x28, 0xa3, 0x18, 0x89, 0x83, 0xa4, 0xe8,
0x16, 0xd5, 0xb0, 0xeb, 0x24, 0x5e, 0xc5, 0x70, 0xd4, 0x94, 0x53, 0x3d,
0xf6, 0x82, 0x50, 0xc3, 0x54, 0x86, 0xc0, 0x13, 0xd1, 0x45, 0x0b, 0x47,
0x59, 0x37, 0xb0, 0x80, 0x9d, 0xf0, 0x47, 0xb0, 0x8f, 0xbb, 0xb0, 0x13,
0x4c, 0x46, 0x6e, 0x2b, 0x39, 0x4a, 0x26, 0xc6, 0xf0, 0x1c, 0x3b, 0x35,
0xf1, 0x9e, 0xf8, 0xf3, 0x9d, 0xe4, 0x5c, 0x97, 0x05, 0x46, 0xb1, 0x1d,
0xaa, 0x17, 0xe3, 0x7d, 0x34, 0x12, 0xad, 0x7e, 0x85, 0x3c, 0x8e, 0x71,
0x86, 0xf1, 0x7e, 0x9e, 0xf9, 0x46, 0xa2, 0xfc, 0x61, 0x37, 0x52, 0xae,
0xc7, 0x02, 0xaf, 0x89, 0xff, 0xd4, 0xef, 0x67, 0x9b, 0xc1, 0x92, 0xff,
0xc4, 0x0f, 0x9e, 0x25, 0x40, 0x8b, 0x8b, 0xc8, 0x0c, 0x69, 0x00, 0x00,
0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
};
unsigned int gamepad_wireless_png_len = 322;
Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

+3658
View File
File diff suppressed because it is too large Load Diff
+217
View File
@@ -0,0 +1,217 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
/* Gamepad image */
#ifndef gamepadutils_h_
#define gamepadutils_h_
typedef struct GamepadImage GamepadImage;
typedef enum
{
CONTROLLER_MODE_TESTING,
CONTROLLER_MODE_BINDING,
} ControllerDisplayMode;
enum
{
SDL_GAMEPAD_ELEMENT_INVALID = -1,
/* ... SDL_GamepadButton ... */
SDL_GAMEPAD_ELEMENT_AXIS_LEFTX_NEGATIVE = SDL_GAMEPAD_BUTTON_COUNT,
SDL_GAMEPAD_ELEMENT_AXIS_LEFTX_POSITIVE,
SDL_GAMEPAD_ELEMENT_AXIS_LEFTY_NEGATIVE,
SDL_GAMEPAD_ELEMENT_AXIS_LEFTY_POSITIVE,
SDL_GAMEPAD_ELEMENT_AXIS_RIGHTX_NEGATIVE,
SDL_GAMEPAD_ELEMENT_AXIS_RIGHTX_POSITIVE,
SDL_GAMEPAD_ELEMENT_AXIS_RIGHTY_NEGATIVE,
SDL_GAMEPAD_ELEMENT_AXIS_RIGHTY_POSITIVE,
SDL_GAMEPAD_ELEMENT_AXIS_LEFT_TRIGGER,
SDL_GAMEPAD_ELEMENT_AXIS_RIGHT_TRIGGER,
SDL_GAMEPAD_ELEMENT_AXIS_MAX,
SDL_GAMEPAD_ELEMENT_NAME = SDL_GAMEPAD_ELEMENT_AXIS_MAX,
SDL_GAMEPAD_ELEMENT_TYPE,
SDL_GAMEPAD_ELEMENT_MAX,
};
#define HIGHLIGHT_COLOR 224, 255, 255, SDL_ALPHA_OPAQUE
#define HIGHLIGHT_TEXTURE_MOD 224, 255, 255
#define PRESSED_COLOR 175, 238, 238, SDL_ALPHA_OPAQUE
#define PRESSED_TEXTURE_MOD 175, 238, 238
#define SELECTED_COLOR 224, 255, 224, SDL_ALPHA_OPAQUE
#define GYRO_COLOR_RED 255, 0, 0, SDL_ALPHA_OPAQUE
#define GYRO_COLOR_GREEN 0, 255, 0, SDL_ALPHA_OPAQUE
#define GYRO_COLOR_BLUE 0, 0, 255, SDL_ALPHA_OPAQUE
#define GYRO_COLOR_ORANGE 255, 128, 0, SDL_ALPHA_OPAQUE
/* Shared layout constants */
#define BUTTON_PADDING 12.0f
#define MINIMUM_BUTTON_WIDTH 96.0f
/* Symbol */
#define DEGREE_UTF8 "\xC2\xB0"
#define SQUARED_UTF8 "\xC2\xB2"
#define MICRO_UTF8 "\xC2\xB5"
/* Gamepad image display */
extern GamepadImage *CreateGamepadImage(SDL_Renderer *renderer);
extern void SetGamepadImagePosition(GamepadImage *ctx, float x, float y);
extern void GetGamepadImageArea(GamepadImage *ctx, SDL_FRect *area);
extern void GetGamepadTouchpadArea(GamepadImage *ctx, SDL_FRect *area);
extern void SetGamepadImageShowingFront(GamepadImage *ctx, bool showing_front);
extern SDL_GamepadType GetGamepadImageType(GamepadImage *ctx);
extern void SetGamepadImageDisplayMode(GamepadImage *ctx, ControllerDisplayMode display_mode);
extern float GetGamepadImageButtonWidth(GamepadImage *ctx);
extern float GetGamepadImageButtonHeight(GamepadImage *ctx);
extern float GetGamepadImageAxisWidth(GamepadImage *ctx);
extern float GetGamepadImageAxisHeight(GamepadImage *ctx);
extern int GetGamepadImageElementAt(GamepadImage *ctx, float x, float y);
extern void ClearGamepadImage(GamepadImage *ctx);
extern void SetGamepadImageElement(GamepadImage *ctx, int element, bool active);
extern void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad);
extern void RenderGamepadImage(GamepadImage *ctx);
extern void DestroyGamepadImage(GamepadImage *ctx);
/* Gamepad element display */
typedef struct GamepadDisplay GamepadDisplay;
extern GamepadDisplay *CreateGamepadDisplay(SDL_Renderer *renderer);
extern void SetGamepadDisplayDisplayMode(GamepadDisplay *ctx, ControllerDisplayMode display_mode);
extern void SetGamepadDisplayArea(GamepadDisplay *ctx, const SDL_FRect *area);
extern void SetGamepadDisplayGyroDriftCorrection(GamepadDisplay *ctx, float *gyro_drift_correction);
extern int GetGamepadDisplayElementAt(GamepadDisplay *ctx, SDL_Gamepad *gamepad, float x, float y);
extern void SetGamepadDisplayHighlight(GamepadDisplay *ctx, int element, bool pressed);
extern void SetGamepadDisplaySelected(GamepadDisplay *ctx, int element);
extern void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad);
extern void DestroyGamepadDisplay(GamepadDisplay *ctx);
/* Gamepad type display */
enum
{
SDL_GAMEPAD_TYPE_UNSELECTED = -1
};
typedef struct GamepadTypeDisplay GamepadTypeDisplay;
extern GamepadTypeDisplay *CreateGamepadTypeDisplay(SDL_Renderer *renderer);
extern void SetGamepadTypeDisplayArea(GamepadTypeDisplay *ctx, const SDL_FRect *area);
extern int GetGamepadTypeDisplayAt(GamepadTypeDisplay *ctx, float x, float y);
extern void SetGamepadTypeDisplayHighlight(GamepadTypeDisplay *ctx, int type, bool pressed);
extern void SetGamepadTypeDisplaySelected(GamepadTypeDisplay *ctx, int type);
extern void SetGamepadTypeDisplayRealType(GamepadTypeDisplay *ctx, SDL_GamepadType type);
extern void RenderGamepadTypeDisplay(GamepadTypeDisplay *ctx);
extern void DestroyGamepadTypeDisplay(GamepadTypeDisplay *ctx);
/* Joystick element display */
typedef struct JoystickDisplay JoystickDisplay;
extern JoystickDisplay *CreateJoystickDisplay(SDL_Renderer *renderer);
extern void SetJoystickDisplayArea(JoystickDisplay *ctx, const SDL_FRect *area);
extern char *GetJoystickDisplayElementAt(JoystickDisplay *ctx, SDL_Joystick *joystick, float x, float y);
extern void SetJoystickDisplayHighlight(JoystickDisplay *ctx, const char *element, bool pressed);
extern void RenderJoystickDisplay(JoystickDisplay *ctx, SDL_Joystick *joystick);
extern void DestroyJoystickDisplay(JoystickDisplay *ctx);
/* Simple buttons */
typedef struct GamepadButton GamepadButton;
extern GamepadButton *CreateGamepadButton(SDL_Renderer *renderer, const char *label);
extern void SetGamepadButtonLabel(GamepadButton *ctx, const char *label);
extern void SetGamepadButtonArea(GamepadButton *ctx, const SDL_FRect *area);
extern void GetGamepadButtonArea(GamepadButton *ctx, SDL_FRect *area);
extern void SetGamepadButtonHighlight(GamepadButton *ctx, bool highlight, bool pressed);
extern float GetGamepadButtonLabelWidth(GamepadButton *ctx);
extern float GetGamepadButtonLabelHeight(GamepadButton *ctx);
extern bool GamepadButtonContains(GamepadButton *ctx, float x, float y);
extern void RenderGamepadButton(GamepadButton *ctx);
extern void DestroyGamepadButton(GamepadButton *ctx);
/* Gyro element Display */
/* This is used as the initial noise tolerance threshold. It's set very close to zero to avoid divide by zero while we're evaluating the noise profile. Each controller may have a very different noise profile.*/
#define ACCELEROMETER_NOISE_THRESHOLD 1e-6f
/* The value below is based on observation of a Dualshock controller. Of all gamepads observed, the Dualshock (PS4) tends to have one of the noisiest accelerometers. Increase this threshold if a controller is failing to pass the noise profiling stage while stationary on a table. */
#define ACCELEROMETER_MAX_NOISE_G 0.075f
#define ACCELEROMETER_MAX_NOISE_G_SQ (ACCELEROMETER_MAX_NOISE_G * ACCELEROMETER_MAX_NOISE_G)
/* Gyro Calibration Phases */
typedef enum
{
GYRO_CALIBRATION_PHASE_OFF, /* Calibration has not yet been evaluated - signal to the user to put the controller on a flat surface before beginning the calibration process */
GYRO_CALIBRATION_PHASE_NOISE_PROFILING, /* Find the max accelerometer noise for a fixed period */
GYRO_CALIBRATION_PHASE_DRIFT_PROFILING, /* Find the drift while the accelerometer is below the accelerometer noise tolerance */
GYRO_CALIBRATION_PHASE_COMPLETE, /* Calibration has finished */
} EGyroCalibrationPhase;
typedef struct Quaternion Quaternion;
typedef struct GyroDisplay GyroDisplay;
extern void InitCirclePoints3D(void);
extern GyroDisplay *CreateGyroDisplay(SDL_Renderer *renderer);
extern void SetGyroDisplayArea(GyroDisplay *ctx, const SDL_FRect *area);
extern void SetGamepadDisplayIMUValues(GyroDisplay *ctx, float *gyro_drift_solution, float *euler_displacement_angles, Quaternion *gyro_quaternion, int reported_senor_rate_hz, int estimated_sensor_rate_hz, EGyroCalibrationPhase calibration_phase, float drift_calibration_progress_frac, float accelerometer_noise_sq, float accelerometer_noise_tolerance_sq);
extern GamepadButton *GetGyroResetButton(GyroDisplay *ctx);
extern GamepadButton *GetGyroCalibrateButton(GyroDisplay *ctx);
extern void RenderGyroDisplay(GyroDisplay *ctx, GamepadDisplay *gamepadElements, SDL_Gamepad *gamepad);
extern void DestroyGyroDisplay(GyroDisplay *ctx);
/* Working with mappings and bindings */
/* Return whether a mapping has any bindings */
extern bool MappingHasBindings(const char *mapping);
/* Return true if the mapping has a controller name */
extern bool MappingHasName(const char *mapping);
/* Return the name from a mapping, which should be freed using SDL_free(), or NULL if there is no name specified */
extern char *GetMappingName(const char *mapping);
/* Set the name in a mapping, freeing the mapping passed in and returning a new mapping */
extern char *SetMappingName(char *mapping, const char *name);
/* Get the friendly string for an SDL_GamepadType */
extern const char *GetGamepadTypeString(SDL_GamepadType type);
/* Return the type from a mapping, which should be freed using SDL_free(), or NULL if there is no type specified */
extern SDL_GamepadType GetMappingType(const char *mapping);
/* Set the type in a mapping, freeing the mapping passed in and returning a new mapping */
extern char *SetMappingType(char *mapping, SDL_GamepadType type);
/* Return true if a mapping has this element bound */
extern bool MappingHasElement(const char *mapping, int element);
/* Get the binding for an element, which should be freed using SDL_free(), or NULL if the element isn't bound */
extern char *GetElementBinding(const char *mapping, int element);
/* Set the binding for an element, or NULL to clear it, freeing the mapping passed in and returning a new mapping */
extern char *SetElementBinding(char *mapping, int element, const char *binding);
/* Get the element for a binding, or SDL_GAMEPAD_ELEMENT_INVALID if that binding isn't used */
extern int GetElementForBinding(char *mapping, const char *binding);
/* Return true if a mapping contains this binding */
extern bool MappingHasBinding(const char *mapping, const char *binding);
/* Clear any previous binding */
extern char *ClearMappingBinding(char *mapping, const char *binding);
#endif /* gamepadutils_h_ */
+5840
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

+19
View File
@@ -0,0 +1,19 @@
unsigned char icon_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20,
0x02, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x14, 0x92, 0x67, 0x00, 0x00, 0x00,
0x09, 0x50, 0x4c, 0x54, 0x45, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff,
0xff, 0x00, 0x53, 0xed, 0x60, 0xc2, 0x00, 0x00, 0x00, 0x69, 0x49, 0x44,
0x41, 0x54, 0x18, 0xd3, 0x63, 0x60, 0xa0, 0x18, 0x84, 0x86, 0x42, 0x68,
0xd6, 0x55, 0xab, 0x02, 0xc0, 0x0c, 0xa9, 0x55, 0xab, 0x96, 0x80, 0x19,
0x59, 0xab, 0x56, 0xad, 0x04, 0xd1, 0x8c, 0xab, 0x80, 0xc0, 0x01, 0xc8,
0x60, 0x03, 0x31, 0x26, 0x80, 0x18, 0x4b, 0xa3, 0x96, 0x46, 0x81, 0x18,
0x52, 0x4b, 0x81, 0x70, 0x09, 0x98, 0x01, 0x14, 0x59, 0x02, 0xd1, 0x0d,
0xd1, 0x8f, 0xc4, 0x58, 0x99, 0x85, 0xce, 0x80, 0x4a, 0x21, 0x0c, 0x9c,
0xba, 0x6a, 0x55, 0x18, 0x88, 0xc1, 0xb8, 0x34, 0x34, 0x34, 0x0a, 0x64,
0x17, 0x43, 0x66, 0x68, 0x68, 0x26, 0xc4, 0x3d, 0x53, 0xc3, 0x96, 0xa0,
0xba, 0x10, 0xee, 0x66, 0x82, 0x00, 0x00, 0x0b, 0x4e, 0x32, 0x71, 0x69,
0x34, 0x3a, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
0x42, 0x60, 0x82
};
unsigned int icon_png_len = 183;
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+142
View File
@@ -0,0 +1,142 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
/* Program to load a wave file and loop playing it using SDL audio */
/* loopwaves.c is much more robust in handling WAVE files --
This is only for simple WAVEs
*/
#include <stdlib.h>
#define SDL_MAIN_USE_CALLBACKS 1
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
#include "testutils.h"
static struct
{
SDL_AudioSpec spec;
Uint8 *sound; /* Pointer to wave data */
Uint32 soundlen; /* Length of wave data */
} wave;
static SDL_AudioStream *stream;
static SDLTest_CommonState *state;
static int fillerup(void)
{
const int minimum = (wave.soundlen / SDL_AUDIO_FRAMESIZE(wave.spec)) / 2;
if (SDL_GetAudioStreamQueued(stream) < minimum) {
SDL_PutAudioStreamData(stream, wave.sound, wave.soundlen);
}
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
{
int i;
char *filename = NULL;
/* this doesn't have to run very much, so give up tons of CPU time between iterations. */
SDL_SetHint(SDL_HINT_MAIN_CALLBACK_RATE, "5");
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (!state) {
return SDL_APP_SUCCESS;
}
/* Parse commandline */
for (i = 1; i < argc;) {
int consumed;
consumed = SDLTest_CommonArg(state, i);
if (!consumed) {
if (SDL_strcmp(argv[i], "--role") == 0 && argv[i + 1]) {
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_ROLE, argv[i + 1]);
++i;
consumed = 1;
} else if (!filename) {
filename = argv[i];
consumed = 1;
}
}
if (consumed <= 0) {
static const char *options[] = { "[--role ROLE]", "[sample.wav]", NULL };
SDLTest_CommonLogUsage(state, argv[0], options);
exit(1);
}
i += consumed;
}
/* Load the SDL library */
if (!SDL_Init(SDL_INIT_AUDIO | SDL_INIT_EVENTS)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
filename = GetResourceFilename(filename, "sample.wav");
if (!filename) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", SDL_GetError());
return SDL_APP_FAILURE;
}
/* Load the wave file into memory */
if (!SDL_LoadWAV(filename, &wave.spec, &wave.sound, &wave.soundlen)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", filename, SDL_GetError());
SDL_free(filename);
return SDL_APP_FAILURE;
}
SDL_free(filename);
/* Show the list of available drivers */
SDL_Log("Available audio drivers:");
for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
SDL_Log("%i: %s", i, SDL_GetAudioDriver(i));
}
SDL_Log("Using audio driver: %s", SDL_GetCurrentAudioDriver());
SDL_Log("Current audio device name: %s", SDL_GetAudioDeviceName(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK));
stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &wave.spec, NULL, NULL);
if (!stream) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_ResumeAudioStreamDevice(stream);
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
return (event->type == SDL_EVENT_QUIT) ? SDL_APP_SUCCESS : SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppIterate(void *appstate)
{
return fillerup();
}
void SDL_AppQuit(void *appstate, SDL_AppResult result)
{
SDL_DestroyAudioStream(stream);
SDL_free(wave.sound);
SDL_Quit();
SDLTest_CommonDestroyState(state);
}
+11
View File
@@ -0,0 +1,11 @@
/*
* This file is supposed to be used to build tests on platforms that require
* the main function to be implemented in C++, which means that SDL_main's
* implementation needs C++ and thus can't be included in test*.c
*
* Placed in the public domain by Daniel Gibson, 2022-12-12
*/
#include <SDL3/SDL_main.h>
// that's all, folks!
BIN
View File
Binary file not shown.
+95
View File
@@ -0,0 +1,95 @@
32,0.259765625,0,-0,0,-0,0,256,0,256
33,0.26416015625,0.04259963723256735,-0.74801901743264665,0.22009567526743265,0.063391442155309036,167.5,44.5,174.5,76.5
34,0.3984375,0.034401000396196514,-0.74801901743264665,0.36403649960380352,-0.41838351822503961,242.5,175.5,255.5,188.5
35,0.64599609375,-0.0068815929576070169,-0.74801901743264665,0.65238940545760693,0.038034865293185421,0.5,111.5,26.5,142.5
36,0.57177734375,0.033055325128763823,-0.79873217115689388,0.54018686237123603,0.08874801901743265,142.5,0.5,162.5,35.5
37,0.82666015625,0.020303136762083947,-0.77337559429477021,0.80635701948791605,0.038034865293185421,175.5,44.5,206.5,76.5
38,0.728515625,0.021001510499207562,-0.77337559429477021,0.75634223950079238,0.038034865293185421,214.5,44.5,243.5,76.5
39,0.21923828125,0.033793550663629157,-0.74801901743264665,0.18593301183637084,-0.41838351822503961,89.5,232.5,95.5,245.5
40,0.294921875,0.012882577258320127,-0.74801901743264665,0.29180492274167991,0.19017432646592711,62.5,0.5,73.5,37.5
41,0.294921875,0.0031169522583201267,-0.74801901743264665,0.28203929774167991,0.19017432646592711,74.5,0.5,85.5,37.5
42,0.55078125,0.0079258648227020154,-0.79873217115689388,0.54041397892729792,-0.26624405705229792,234.5,78.5,255.5,99.5
43,0.57177734375,0.018668052322702015,-0.62123613312202852,0.55115616642729792,-0.063391442155309036,22.5,232.5,43.5,254.5
44,0.2587890625,0.011122520676505546,-0.16481774960380352,0.21397513557349446,0.16481774960380349,118.5,232.5,126.5,245.5
45,0.32177734375,0.0089933513272583213,-0.34231378763866882,0.31327227367274169,-0.19017432646592711,242.5,189.5,254.5,195.5
46,0.2626953125,0.04259963723256735,-0.13946117274167988,0.22009567526743265,0.063391442155309036,138.5,232.5,145.5,240.5
47,0.36669921875,-0.019747146146988907,-0.74801901743264665,0.38595808364698891,0.038034865293185421,95.5,143.5,111.5,174.5
48,0.57177734375,0.019400474197702015,-0.77337559429477021,0.55188858830229792,0.038034865293185421,0.5,78.5,21.5,110.5
49,0.57177734375,0.055885375396196514,-0.74801901743264665,0.38552087460380352,0.038034865293185421,137.5,143.5,150.5,174.5
50,0.57177734375,0.016959067947702015,-0.77337559429477021,0.54944718205229792,0.038034865293185421,22.5,78.5,43.5,110.5
51,0.57177734375,0.012564536697702015,-0.77337559429477021,0.54505265080229792,0.038034865293185421,44.5,78.5,65.5,110.5
52,0.57177734375,-0.0044912589144215989,-0.74801901743264665,0.57871000891442159,0.038034865293185421,232.5,143.5,255.5,174.5
53,0.57177734375,0.035740872003763823,-0.74801901743264665,0.54287240924623603,0.038034865293185421,235.5,111.5,255.5,142.5
54,0.57177734375,0.023795005447702015,-0.77337559429477021,0.55628311955229792,0.038034865293185421,66.5,78.5,87.5,110.5
55,0.57177734375,0.017203208572702015,-0.74801901743264665,0.54969132267729792,0.038034865293185421,82.5,175.5,103.5,206.5
56,0.57177734375,0.018912192947702015,-0.77337559429477021,0.55140030705229792,0.038034865293185421,88.5,78.5,109.5,110.5
57,0.57177734375,0.017935630447702015,-0.77337559429477021,0.55042374455229792,0.038034865293185421,110.5,78.5,131.5,110.5
58,0.2626953125,0.04259963723256735,-0.59587955625990485,0.22009567526743265,0.063391442155309036,130.5,175.5,137.5,201.5
59,0.2626953125,-0.0044854552545562608,-0.59587955625990485,0.22372373650455626,0.16481774960380349,104.5,175.5,113.5,205.5
60,0.57177734375,0.018912192947702015,-0.64659270998415219,0.55140030705229792,-0.08874801901743265,0.5,232.5,21.5,254.5
61,0.57177734375,0.018912192947702015,-0.51980982567353418,0.55140030705229792,-0.19017432646592711,96.5,232.5,117.5,245.5
62,0.57177734375,0.018912192947702015,-0.64659270998415219,0.55140030705229792,-0.08874801901743265,44.5,232.5,65.5,254.5
63,0.431640625,-0.018492394884112522,-0.77337559429477021,0.43792598863411253,0.063391442155309036,22.5,44.5,40.5,77.5
64,0.896484375,0.030102809899960288,-0.74801901743264665,0.86686984635003961,0.13946117274167988,163.5,0.5,196.5,35.5
65,0.63232421875,-0.026639959513668827,-0.74801901743264665,0.65798761576366882,0.038034865293185421,23.5,175.5,50.5,206.5
66,0.64599609375,0.065804217016640215,-0.74801901743264665,0.6236489079833597,0.038034865293185421,0.5,175.5,22.5,206.5
67,0.6298828125,0.025799202654516594,-0.77337559429477021,0.63435704734548326,0.038034865293185421,132.5,78.5,156.5,110.5
68,0.7255859375,0.064146304848454794,-0.74801901743264665,0.69806072640154515,0.038034865293185421,189.5,143.5,214.5,174.5
69,0.5556640625,0.06817752699088743,-0.74801901743264665,0.52459591050911247,0.038034865293185421,170.5,143.5,188.5,174.5
70,0.51611328125,0.06817752699088743,-0.74801901743264665,0.52459591050911247,0.038034865293185421,151.5,143.5,169.5,174.5
71,0.72705078125,0.027053953917392983,-0.77337559429477021,0.68632495233260693,0.038034865293185421,157.5,78.5,183.5,110.5
72,0.7373046875,0.063885140154516601,-0.74801901743264665,0.67244298484548326,0.038034865293185421,112.5,143.5,136.5,174.5
73,0.279296875,0.063090425663629157,-0.74801901743264665,0.21522988683637084,0.038034865293185421,244.5,44.5,250.5,75.5
74,0.2685546875,-0.11647790585380349,-0.74801901743264665,0.21315759335380352,0.21553090332805072,48.5,0.5,61.5,38.5
75,0.6123046875,0.063379834835578408,-0.74801901743264665,0.64658110266442159,0.038034865293185421,45.5,143.5,68.5,174.5
76,0.52197265625,0.069398230115887444,-0.74801901743264665,0.52581661363411247,0.038034865293185421,26.5,143.5,44.5,174.5
77,0.8994140625,0.069358378318145758,-0.74801901743264665,0.83005568418185416,0.038034865293185421,51.5,175.5,81.5,206.5
78,0.7529296875,0.059751773598454787,-0.74801901743264665,0.69366619515154515,0.038034865293185421,0.5,143.5,25.5,174.5
79,0.77783203125,0.033923939555269372,-0.77337559429477021,0.74390809169473049,0.038034865293185421,184.5,78.5,212.5,110.5
80,0.6015625,0.070164700128763829,-0.74801901743264665,0.57729623737123603,0.038034865293185421,191.5,111.5,211.5,142.5
81,0.77783203125,0.033923939555269372,-0.77337559429477021,0.74390809169473049,0.21553090332805072,19.5,0.5,47.5,39.5
82,0.6171875,0.070198748266640215,-0.74801901743264665,0.6280434392333597,0.038034865293185421,129.5,111.5,151.5,142.5
83,0.54833984375,0.022313137628763823,-0.77337559429477021,0.52944467487123603,0.038034865293185421,213.5,78.5,233.5,110.5
84,0.55078125,-0.016942430789421599,-0.74801901743264665,0.56625883703942159,0.038034865293185421,79.5,111.5,102.5,142.5
85,0.72900390625,0.059734749529516594,-0.74801901743264665,0.66829259422048326,0.038034865293185421,54.5,111.5,78.5,142.5
86,0.59619140625,-0.031539796082607013,-0.74801901743264665,0.62773120233260693,0.038034865293185421,27.5,111.5,53.5,142.5
87,0.92333984375,-0.020105038505348741,-0.74801901743264665,0.94344488225534862,0.038034865293185421,152.5,111.5,190.5,142.5
88,0.57763671875,-0.028382992026545213,-0.74801901743264665,0.60553142952654515,0.038034865293185421,69.5,143.5,94.5,174.5
89,0.55908203125,-0.037416195151545213,-0.74801901743264665,0.59649822640154515,0.038034865293185421,103.5,111.5,128.5,142.5
90,0.572265625,0.0069663263916402082,-0.74801901743264665,0.5648110173583597,0.038034865293185421,212.5,111.5,234.5,142.5
91,0.3271484375,0.052189217883320121,-0.74801901743264665,0.33111156336667991,0.19017432646592711,102.5,0.5,113.5,37.5
92,0.36669921875,-0.019258864896988907,-0.74801901743264665,0.38644636489698891,0.038034865293185421,215.5,143.5,231.5,174.5
93,0.3271484375,-0.0037189852416798751,-0.74801901743264665,0.27520336024167991,0.19017432646592711,114.5,0.5,125.5,37.5
94,0.57177734375,0.0072104670166402082,-0.74801901743264665,0.5650551579833597,-0.24088748019017434,66.5,232.5,88.5,252.5
95,0.43798828125,-0.034571627996236129,0.063391442155309036,0.47255990924623614,0.19017432646592711,89.5,246.5,109.5,251.5
96,0.27734375,0.012133131314381934,-0.79873217115689388,0.26569889993561807,-0.57052297939778129,127.5,232.5,137.5,241.5
97,0.5556640625,0.019122285434825671,-0.57052297939778129,0.50089724581517436,0.038034865293185421,21.5,207.5,40.5,231.5
98,0.61181640625,0.054556724197702015,-0.79873217115689388,0.58704483830229792,0.038034865293185421,41.5,44.5,62.5,77.5
99,0.47900390625,0.022767370740887478,-0.57052297939778129,0.47918575425911253,0.038034865293185421,168.5,207.5,186.5,231.5
100,0.61181640625,0.024527427322702015,-0.79873217115689388,0.55701554142729792,0.038034865293185421,63.5,44.5,84.5,77.5
101,0.5615234375,0.028904934503763823,-0.57052297939778129,0.53603647174623603,0.038034865293185421,200.5,175.5,220.5,199.5
102,0.33642578125,-0.017288715828050714,-0.79873217115689388,0.41377309082805075,0.038034865293185421,128.5,44.5,145.5,77.5
103,0.54296875,-0.022557665164421599,-0.59587955625990485,0.56064360266442159,0.26624405705229792,197.5,0.5,220.5,34.5
104,0.61328125,0.055027981378763823,-0.79873217115689388,0.56215951862123603,0.038034865293185421,146.5,44.5,166.5,77.5
105,0.25244140625,0.050883394413629157,-0.77337559429477021,0.20302285558637084,0.038034865293185421,207.5,44.5,213.5,76.5
106,0.25244140625,-0.091592586172741686,-0.77337559429477021,0.21268633617274166,0.26624405705229792,6.5,0.5,18.5,41.5
107,0.525390625,0.047947903253763823,-0.79873217115689388,0.55507944049623603,0.038034865293185421,107.5,44.5,127.5,77.5
108,0.25244140625,0.050150972538629157,-0.79873217115689388,0.20229043371137084,0.038034865293185421,244.5,0.5,250.5,33.5
109,0.92578125,0.059382660831022144,-0.57052297939778129,0.87079312041897783,0.038034865293185421,60.5,207.5,92.5,231.5
110,0.61328125,0.055027981378763823,-0.57052297939778129,0.56215951862123603,0.038034865293185421,0.5,207.5,20.5,231.5
111,0.6015625,0.022347185766640208,-0.57052297939778129,0.5801918767333597,0.038034865293185421,145.5,207.5,167.5,231.5
112,0.61181640625,0.054556724197702015,-0.57052297939778129,0.58704483830229792,0.26624405705229792,85.5,44.5,106.5,77.5
113,0.61181640625,0.024039146072702015,-0.57052297939778129,0.55652726017729792,0.26624405705229792,0.5,44.5,21.5,77.5
114,0.40869140625,0.0493276266590729,-0.57052297939778129,0.42967627959092713,0.038034865293185421,138.5,175.5,153.5,199.5
115,0.4765625,0.012757605115887478,-0.57052297939778129,0.46917598863411253,0.038034865293185421,41.5,207.5,59.5,231.5
116,0.3564453125,-0.0156137795909271,-0.69730586370839942,0.36473487334092713,0.038034865293185421,114.5,175.5,129.5,204.5
117,0.61328125,0.049901028253763823,-0.57052297939778129,0.55703256549623603,0.038034865293185421,221.5,175.5,241.5,199.5
118,0.49951171875,-0.029166486108359792,-0.57052297939778129,0.5286782048583597,0.038034865293185421,154.5,175.5,176.5,199.5
119,0.77490234375,-0.01825405791897786,-0.57052297939778129,0.79315640166897772,0.038034865293185421,93.5,207.5,125.5,231.5
120,0.5234375,-0.017203595483359792,-0.57052297939778129,0.5406410954833597,0.038034865293185421,177.5,175.5,199.5,199.5
121,0.5009765625,-0.027945782983359792,-0.57052297939778129,0.5298989079833597,0.26624405705229792,221.5,0.5,243.5,33.5
122,0.46875,0.0059216676158874784,-0.57052297939778129,0.46234005113411253,0.038034865293185421,126.5,207.5,144.5,231.5
123,0.375,-0.0048715920909271002,-0.74801901743264665,0.37547706084092713,0.19017432646592711,86.5,0.5,101.5,37.5
124,0.54931640625,0.21077847971969096,-0.79873217115689377,0.33756136403030901,0.29160063391442159,0.5,0.5,5.5,43.5
125,0.375,1.122040907289984e-05,-0.74801901743264665,0.38035987334092713,0.19017432646592711,126.5,0.5,141.5,37.5
126,0.57177734375,0.018912192947702015,-0.44374009508716328,0.55140030705229792,-0.24088748019017434,234.5,100.5,255.5,108.5
1 32 0.259765625 0 -0 0 -0 0 256 0 256
2 33 0.26416015625 0.04259963723256735 -0.74801901743264665 0.22009567526743265 0.063391442155309036 167.5 44.5 174.5 76.5
3 34 0.3984375 0.034401000396196514 -0.74801901743264665 0.36403649960380352 -0.41838351822503961 242.5 175.5 255.5 188.5
4 35 0.64599609375 -0.0068815929576070169 -0.74801901743264665 0.65238940545760693 0.038034865293185421 0.5 111.5 26.5 142.5
5 36 0.57177734375 0.033055325128763823 -0.79873217115689388 0.54018686237123603 0.08874801901743265 142.5 0.5 162.5 35.5
6 37 0.82666015625 0.020303136762083947 -0.77337559429477021 0.80635701948791605 0.038034865293185421 175.5 44.5 206.5 76.5
7 38 0.728515625 0.021001510499207562 -0.77337559429477021 0.75634223950079238 0.038034865293185421 214.5 44.5 243.5 76.5
8 39 0.21923828125 0.033793550663629157 -0.74801901743264665 0.18593301183637084 -0.41838351822503961 89.5 232.5 95.5 245.5
9 40 0.294921875 0.012882577258320127 -0.74801901743264665 0.29180492274167991 0.19017432646592711 62.5 0.5 73.5 37.5
10 41 0.294921875 0.0031169522583201267 -0.74801901743264665 0.28203929774167991 0.19017432646592711 74.5 0.5 85.5 37.5
11 42 0.55078125 0.0079258648227020154 -0.79873217115689388 0.54041397892729792 -0.26624405705229792 234.5 78.5 255.5 99.5
12 43 0.57177734375 0.018668052322702015 -0.62123613312202852 0.55115616642729792 -0.063391442155309036 22.5 232.5 43.5 254.5
13 44 0.2587890625 0.011122520676505546 -0.16481774960380352 0.21397513557349446 0.16481774960380349 118.5 232.5 126.5 245.5
14 45 0.32177734375 0.0089933513272583213 -0.34231378763866882 0.31327227367274169 -0.19017432646592711 242.5 189.5 254.5 195.5
15 46 0.2626953125 0.04259963723256735 -0.13946117274167988 0.22009567526743265 0.063391442155309036 138.5 232.5 145.5 240.5
16 47 0.36669921875 -0.019747146146988907 -0.74801901743264665 0.38595808364698891 0.038034865293185421 95.5 143.5 111.5 174.5
17 48 0.57177734375 0.019400474197702015 -0.77337559429477021 0.55188858830229792 0.038034865293185421 0.5 78.5 21.5 110.5
18 49 0.57177734375 0.055885375396196514 -0.74801901743264665 0.38552087460380352 0.038034865293185421 137.5 143.5 150.5 174.5
19 50 0.57177734375 0.016959067947702015 -0.77337559429477021 0.54944718205229792 0.038034865293185421 22.5 78.5 43.5 110.5
20 51 0.57177734375 0.012564536697702015 -0.77337559429477021 0.54505265080229792 0.038034865293185421 44.5 78.5 65.5 110.5
21 52 0.57177734375 -0.0044912589144215989 -0.74801901743264665 0.57871000891442159 0.038034865293185421 232.5 143.5 255.5 174.5
22 53 0.57177734375 0.035740872003763823 -0.74801901743264665 0.54287240924623603 0.038034865293185421 235.5 111.5 255.5 142.5
23 54 0.57177734375 0.023795005447702015 -0.77337559429477021 0.55628311955229792 0.038034865293185421 66.5 78.5 87.5 110.5
24 55 0.57177734375 0.017203208572702015 -0.74801901743264665 0.54969132267729792 0.038034865293185421 82.5 175.5 103.5 206.5
25 56 0.57177734375 0.018912192947702015 -0.77337559429477021 0.55140030705229792 0.038034865293185421 88.5 78.5 109.5 110.5
26 57 0.57177734375 0.017935630447702015 -0.77337559429477021 0.55042374455229792 0.038034865293185421 110.5 78.5 131.5 110.5
27 58 0.2626953125 0.04259963723256735 -0.59587955625990485 0.22009567526743265 0.063391442155309036 130.5 175.5 137.5 201.5
28 59 0.2626953125 -0.0044854552545562608 -0.59587955625990485 0.22372373650455626 0.16481774960380349 104.5 175.5 113.5 205.5
29 60 0.57177734375 0.018912192947702015 -0.64659270998415219 0.55140030705229792 -0.08874801901743265 0.5 232.5 21.5 254.5
30 61 0.57177734375 0.018912192947702015 -0.51980982567353418 0.55140030705229792 -0.19017432646592711 96.5 232.5 117.5 245.5
31 62 0.57177734375 0.018912192947702015 -0.64659270998415219 0.55140030705229792 -0.08874801901743265 44.5 232.5 65.5 254.5
32 63 0.431640625 -0.018492394884112522 -0.77337559429477021 0.43792598863411253 0.063391442155309036 22.5 44.5 40.5 77.5
33 64 0.896484375 0.030102809899960288 -0.74801901743264665 0.86686984635003961 0.13946117274167988 163.5 0.5 196.5 35.5
34 65 0.63232421875 -0.026639959513668827 -0.74801901743264665 0.65798761576366882 0.038034865293185421 23.5 175.5 50.5 206.5
35 66 0.64599609375 0.065804217016640215 -0.74801901743264665 0.6236489079833597 0.038034865293185421 0.5 175.5 22.5 206.5
36 67 0.6298828125 0.025799202654516594 -0.77337559429477021 0.63435704734548326 0.038034865293185421 132.5 78.5 156.5 110.5
37 68 0.7255859375 0.064146304848454794 -0.74801901743264665 0.69806072640154515 0.038034865293185421 189.5 143.5 214.5 174.5
38 69 0.5556640625 0.06817752699088743 -0.74801901743264665 0.52459591050911247 0.038034865293185421 170.5 143.5 188.5 174.5
39 70 0.51611328125 0.06817752699088743 -0.74801901743264665 0.52459591050911247 0.038034865293185421 151.5 143.5 169.5 174.5
40 71 0.72705078125 0.027053953917392983 -0.77337559429477021 0.68632495233260693 0.038034865293185421 157.5 78.5 183.5 110.5
41 72 0.7373046875 0.063885140154516601 -0.74801901743264665 0.67244298484548326 0.038034865293185421 112.5 143.5 136.5 174.5
42 73 0.279296875 0.063090425663629157 -0.74801901743264665 0.21522988683637084 0.038034865293185421 244.5 44.5 250.5 75.5
43 74 0.2685546875 -0.11647790585380349 -0.74801901743264665 0.21315759335380352 0.21553090332805072 48.5 0.5 61.5 38.5
44 75 0.6123046875 0.063379834835578408 -0.74801901743264665 0.64658110266442159 0.038034865293185421 45.5 143.5 68.5 174.5
45 76 0.52197265625 0.069398230115887444 -0.74801901743264665 0.52581661363411247 0.038034865293185421 26.5 143.5 44.5 174.5
46 77 0.8994140625 0.069358378318145758 -0.74801901743264665 0.83005568418185416 0.038034865293185421 51.5 175.5 81.5 206.5
47 78 0.7529296875 0.059751773598454787 -0.74801901743264665 0.69366619515154515 0.038034865293185421 0.5 143.5 25.5 174.5
48 79 0.77783203125 0.033923939555269372 -0.77337559429477021 0.74390809169473049 0.038034865293185421 184.5 78.5 212.5 110.5
49 80 0.6015625 0.070164700128763829 -0.74801901743264665 0.57729623737123603 0.038034865293185421 191.5 111.5 211.5 142.5
50 81 0.77783203125 0.033923939555269372 -0.77337559429477021 0.74390809169473049 0.21553090332805072 19.5 0.5 47.5 39.5
51 82 0.6171875 0.070198748266640215 -0.74801901743264665 0.6280434392333597 0.038034865293185421 129.5 111.5 151.5 142.5
52 83 0.54833984375 0.022313137628763823 -0.77337559429477021 0.52944467487123603 0.038034865293185421 213.5 78.5 233.5 110.5
53 84 0.55078125 -0.016942430789421599 -0.74801901743264665 0.56625883703942159 0.038034865293185421 79.5 111.5 102.5 142.5
54 85 0.72900390625 0.059734749529516594 -0.74801901743264665 0.66829259422048326 0.038034865293185421 54.5 111.5 78.5 142.5
55 86 0.59619140625 -0.031539796082607013 -0.74801901743264665 0.62773120233260693 0.038034865293185421 27.5 111.5 53.5 142.5
56 87 0.92333984375 -0.020105038505348741 -0.74801901743264665 0.94344488225534862 0.038034865293185421 152.5 111.5 190.5 142.5
57 88 0.57763671875 -0.028382992026545213 -0.74801901743264665 0.60553142952654515 0.038034865293185421 69.5 143.5 94.5 174.5
58 89 0.55908203125 -0.037416195151545213 -0.74801901743264665 0.59649822640154515 0.038034865293185421 103.5 111.5 128.5 142.5
59 90 0.572265625 0.0069663263916402082 -0.74801901743264665 0.5648110173583597 0.038034865293185421 212.5 111.5 234.5 142.5
60 91 0.3271484375 0.052189217883320121 -0.74801901743264665 0.33111156336667991 0.19017432646592711 102.5 0.5 113.5 37.5
61 92 0.36669921875 -0.019258864896988907 -0.74801901743264665 0.38644636489698891 0.038034865293185421 215.5 143.5 231.5 174.5
62 93 0.3271484375 -0.0037189852416798751 -0.74801901743264665 0.27520336024167991 0.19017432646592711 114.5 0.5 125.5 37.5
63 94 0.57177734375 0.0072104670166402082 -0.74801901743264665 0.5650551579833597 -0.24088748019017434 66.5 232.5 88.5 252.5
64 95 0.43798828125 -0.034571627996236129 0.063391442155309036 0.47255990924623614 0.19017432646592711 89.5 246.5 109.5 251.5
65 96 0.27734375 0.012133131314381934 -0.79873217115689388 0.26569889993561807 -0.57052297939778129 127.5 232.5 137.5 241.5
66 97 0.5556640625 0.019122285434825671 -0.57052297939778129 0.50089724581517436 0.038034865293185421 21.5 207.5 40.5 231.5
67 98 0.61181640625 0.054556724197702015 -0.79873217115689388 0.58704483830229792 0.038034865293185421 41.5 44.5 62.5 77.5
68 99 0.47900390625 0.022767370740887478 -0.57052297939778129 0.47918575425911253 0.038034865293185421 168.5 207.5 186.5 231.5
69 100 0.61181640625 0.024527427322702015 -0.79873217115689388 0.55701554142729792 0.038034865293185421 63.5 44.5 84.5 77.5
70 101 0.5615234375 0.028904934503763823 -0.57052297939778129 0.53603647174623603 0.038034865293185421 200.5 175.5 220.5 199.5
71 102 0.33642578125 -0.017288715828050714 -0.79873217115689388 0.41377309082805075 0.038034865293185421 128.5 44.5 145.5 77.5
72 103 0.54296875 -0.022557665164421599 -0.59587955625990485 0.56064360266442159 0.26624405705229792 197.5 0.5 220.5 34.5
73 104 0.61328125 0.055027981378763823 -0.79873217115689388 0.56215951862123603 0.038034865293185421 146.5 44.5 166.5 77.5
74 105 0.25244140625 0.050883394413629157 -0.77337559429477021 0.20302285558637084 0.038034865293185421 207.5 44.5 213.5 76.5
75 106 0.25244140625 -0.091592586172741686 -0.77337559429477021 0.21268633617274166 0.26624405705229792 6.5 0.5 18.5 41.5
76 107 0.525390625 0.047947903253763823 -0.79873217115689388 0.55507944049623603 0.038034865293185421 107.5 44.5 127.5 77.5
77 108 0.25244140625 0.050150972538629157 -0.79873217115689388 0.20229043371137084 0.038034865293185421 244.5 0.5 250.5 33.5
78 109 0.92578125 0.059382660831022144 -0.57052297939778129 0.87079312041897783 0.038034865293185421 60.5 207.5 92.5 231.5
79 110 0.61328125 0.055027981378763823 -0.57052297939778129 0.56215951862123603 0.038034865293185421 0.5 207.5 20.5 231.5
80 111 0.6015625 0.022347185766640208 -0.57052297939778129 0.5801918767333597 0.038034865293185421 145.5 207.5 167.5 231.5
81 112 0.61181640625 0.054556724197702015 -0.57052297939778129 0.58704483830229792 0.26624405705229792 85.5 44.5 106.5 77.5
82 113 0.61181640625 0.024039146072702015 -0.57052297939778129 0.55652726017729792 0.26624405705229792 0.5 44.5 21.5 77.5
83 114 0.40869140625 0.0493276266590729 -0.57052297939778129 0.42967627959092713 0.038034865293185421 138.5 175.5 153.5 199.5
84 115 0.4765625 0.012757605115887478 -0.57052297939778129 0.46917598863411253 0.038034865293185421 41.5 207.5 59.5 231.5
85 116 0.3564453125 -0.0156137795909271 -0.69730586370839942 0.36473487334092713 0.038034865293185421 114.5 175.5 129.5 204.5
86 117 0.61328125 0.049901028253763823 -0.57052297939778129 0.55703256549623603 0.038034865293185421 221.5 175.5 241.5 199.5
87 118 0.49951171875 -0.029166486108359792 -0.57052297939778129 0.5286782048583597 0.038034865293185421 154.5 175.5 176.5 199.5
88 119 0.77490234375 -0.01825405791897786 -0.57052297939778129 0.79315640166897772 0.038034865293185421 93.5 207.5 125.5 231.5
89 120 0.5234375 -0.017203595483359792 -0.57052297939778129 0.5406410954833597 0.038034865293185421 177.5 175.5 199.5 199.5
90 121 0.5009765625 -0.027945782983359792 -0.57052297939778129 0.5298989079833597 0.26624405705229792 221.5 0.5 243.5 33.5
91 122 0.46875 0.0059216676158874784 -0.57052297939778129 0.46234005113411253 0.038034865293185421 126.5 207.5 144.5 231.5
92 123 0.375 -0.0048715920909271002 -0.74801901743264665 0.37547706084092713 0.19017432646592711 86.5 0.5 101.5 37.5
93 124 0.54931640625 0.21077847971969096 -0.79873217115689377 0.33756136403030901 0.29160063391442159 0.5 0.5 5.5 43.5
94 125 0.375 1.122040907289984e-05 -0.74801901743264665 0.38035987334092713 0.19017432646592711 126.5 0.5 141.5 37.5
95 126 0.57177734375 0.018912192947702015 -0.44374009508716328 0.55140030705229792 -0.24088748019017434 234.5 100.5 255.5 108.5
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+14
View File
@@ -0,0 +1,14 @@
#define picture_width 32
#define picture_height 32
static char picture_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18,
0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f,
0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08,
0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08,
0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48,
0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a,
0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a,
0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28,
0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50,
0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+36
View File
@@ -0,0 +1,36 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
/* Call SDL_GetPrefPath to warm the SHGetFolderPathW cache */
/**
* We noticed frequent ci timeouts running testfilesystem on 32-bit Windows.
* Internally, this functions calls Shell32.SHGetFolderPathW.
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
int main(int argc, char *argv[])
{
Uint64 start;
Uint64 prequit;
(void)argc;
(void)argv;
SDL_Init(0);
start = SDL_GetTicks();
SDL_free(SDL_GetPrefPath("libsdl", "test_filesystem"));
prequit = SDL_GetTicks();
SDL_Log("SDL_GetPrefPath took %" SDL_PRIu64 "ms", prequit - start);
SDL_Quit();
SDL_Log("SDL_Quit took %" SDL_PRIu64 "ms", SDL_GetTicks() - prequit);
return 0;
}
+58
View File
@@ -0,0 +1,58 @@
Relative mode testing
=====================
See test program at the bottom of this file.
Initial tests:
- When in relative mode, the mouse shouldn't be moveable outside of the window.
- When the cursor is outside the window when relative mode is enabled, mouse
clicks should not go to whatever app was under the cursor previously.
- When alt/cmd-tabbing between a relative mode app and another app, clicks when
in the relative mode app should also not go to whatever app was under the
cursor previously.
Code
====
#include <SDL.h>
int PollEvents()
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_EVENT_QUIT:
return 1;
default:
break;
}
}
return 0;
}
int main(int argc, char *argv[])
{
SDL_Window *win;
SDL_Init(SDL_INIT_VIDEO);
win = SDL_CreateWindow("Test", 800, 600, 0);
SDL_SetWindowRelativeMouseMode(win, true);
while (1)
{
if (PollEvents())
break;
}
SDL_DestroyWindow(win);
SDL_Quit();
return 0;
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
View File
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1005 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

BIN
View File
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
[Test]
Type=session
Exec=@installedtestsdir@/@exe@ @installed_arguments@
+191
View File
@@ -0,0 +1,191 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
#define SDL_MAIN_USE_CALLBACKS 1
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
#include <SDL3/SDL_test_common.h>
static SDL_Renderer *renderer = NULL;
static SDL_Texture *texture = NULL;
static SDL_AsyncIOQueue *queue = NULL;
static SDLTest_CommonState *state = NULL;
SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
{
const char *base = NULL;
SDL_AsyncIO *asyncio = NULL;
char **pngs = NULL;
int pngcount = 0;
int i;
SDL_srand(0);
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
if (!state) {
return SDL_APP_FAILURE;
}
/* Enable standard application logging */
SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
/* Parse commandline */
for (i = 1; i < argc;) {
int consumed = SDLTest_CommonArg(state, i);
if (consumed <= 0) {
static const char *options[] = {
NULL,
};
SDLTest_CommonLogUsage(state, argv[0], options);
SDL_Quit();
SDLTest_CommonDestroyState(state);
return 1;
}
i += consumed;
}
state->num_windows = 1;
/* Load the SDL library */
if (!SDLTest_CommonInit(state)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
renderer = state->renderers[0];
if (!renderer) {
/* SDL_Log("Couldn't create renderer: %s", SDL_GetError()); */
return SDL_APP_FAILURE;
}
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STATIC, 512, 512);
if (!texture) {
SDL_Log("Couldn't create texture: %s", SDL_GetError());
return SDL_APP_FAILURE;
} else {
static const Uint32 blank[512 * 512];
const SDL_Rect rect = { 0, 0, 512, 512 };
SDL_UpdateTexture(texture, &rect, blank, 512 * sizeof (Uint32));
}
queue = SDL_CreateAsyncIOQueue();
if (!queue) {
SDL_Log("Couldn't create async i/o queue: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
base = SDL_GetBasePath();
pngs = SDL_GlobDirectory(base, "*.png", SDL_GLOB_CASEINSENSITIVE, &pngcount);
if (!pngs || (pngcount == 0)) {
SDL_Log("No PNG files found.");
return SDL_APP_FAILURE;
}
for (i = 0; i < pngcount; i++) {
char *path = NULL;
if (SDL_asprintf(&path, "%s%s", base, pngs[i]) < 0) {
SDL_free(path);
} else {
SDL_Log("Loading %s...", path);
SDL_LoadFileAsync(path, queue, path);
}
}
SDL_free(pngs);
SDL_Log("Opening asyncio.tmp...");
asyncio = SDL_AsyncIOFromFile("asyncio.tmp", "w");
if (!asyncio) {
SDL_Log("Failed!");
return SDL_APP_FAILURE;
}
SDL_WriteAsyncIO(asyncio, "hello", 0, 5, queue, "asyncio.tmp (write)");
SDL_CloseAsyncIO(asyncio, true, queue, "asyncio.tmp (flush/close)");
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
switch (event->type) {
case SDL_EVENT_QUIT:
return SDL_APP_SUCCESS;
default:
break;
}
return SDLTest_CommonEventMainCallbacks(state, event);
}
static void async_io_task_complete(const SDL_AsyncIOOutcome *outcome)
{
const char *fname = (const char *) outcome->userdata;
const char *resultstr = "[unknown result]";
switch (outcome->result) {
#define RESCASE(x) case x: resultstr = #x; break
RESCASE(SDL_ASYNCIO_COMPLETE);
RESCASE(SDL_ASYNCIO_FAILURE);
RESCASE(SDL_ASYNCIO_CANCELED);
#undef RESCASE
}
SDL_Log("File '%s' async results: %s", fname, resultstr);
if (SDL_strncmp(fname, "asyncio.tmp", 11) == 0) {
return;
}
if (outcome->result == SDL_ASYNCIO_COMPLETE) {
SDL_Surface *surface = SDL_LoadPNG_IO(SDL_IOFromConstMem(outcome->buffer, (size_t) outcome->bytes_transferred), true);
if (surface) {
SDL_Surface *converted = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_RGBA8888);
SDL_DestroySurface(surface);
if (converted) {
const SDL_Rect rect = { 50 + SDL_rand(512 - 100), 50 + SDL_rand(512 - 100), converted->w, converted->h };
SDL_UpdateTexture(texture, &rect, converted->pixels, converted->pitch);
SDL_DestroySurface(converted);
}
}
}
SDL_free(outcome->userdata);
SDL_free(outcome->buffer);
}
SDL_AppResult SDL_AppIterate(void *appstate)
{
SDL_AsyncIOOutcome outcome;
if (SDL_GetAsyncIOResult(queue, &outcome)) {
async_io_task_complete(&outcome);
}
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
SDL_RenderTexture(renderer, texture, NULL, NULL);
SDL_RenderPresent(renderer);
return SDL_APP_CONTINUE;
}
void SDL_AppQuit(void *appstate, SDL_AppResult result)
{
SDL_DestroyAsyncIOQueue(queue);
SDL_DestroyTexture(texture);
SDL_RemovePath("asyncio.tmp");
SDLTest_CommonQuit(state);
}
+764
View File
@@ -0,0 +1,764 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
/*
Absolutely basic tests just to see if we get the expected value
after calling each function.
*/
static const char *
tf(bool _tf)
{
static const char *t = "TRUE";
static const char *f = "FALSE";
if (_tf) {
return t;
}
return f;
}
static void RunBasicTest(void)
{
int value;
SDL_SpinLock lock = 0;
SDL_AtomicInt v;
bool tfret = false;
SDL_Log("%s", "");
SDL_Log("spin lock---------------------------------------");
SDL_Log("%s", "");
SDL_LockSpinlock(&lock);
SDL_Log("AtomicLock lock=%d", lock);
SDL_UnlockSpinlock(&lock);
SDL_Log("AtomicUnlock lock=%d", lock);
SDL_Log("%s", "");
SDL_Log("atomic -----------------------------------------");
SDL_Log("%s", "");
SDL_SetAtomicInt(&v, 0);
tfret = SDL_SetAtomicInt(&v, 10) == 0;
SDL_Log("AtomicSet(10) tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
tfret = SDL_AddAtomicInt(&v, 10) == 10;
SDL_Log("AtomicAdd(10) tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
SDL_SetAtomicInt(&v, 0);
SDL_AtomicIncRef(&v);
tfret = (SDL_GetAtomicInt(&v) == 1);
SDL_Log("AtomicIncRef() tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
SDL_AtomicIncRef(&v);
tfret = (SDL_GetAtomicInt(&v) == 2);
SDL_Log("AtomicIncRef() tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
tfret = (SDL_AtomicDecRef(&v) == false);
SDL_Log("AtomicDecRef() tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
tfret = (SDL_AtomicDecRef(&v) == true);
SDL_Log("AtomicDecRef() tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
SDL_SetAtomicInt(&v, 10);
tfret = (SDL_CompareAndSwapAtomicInt(&v, 0, 20) == false);
SDL_Log("AtomicCAS() tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
value = SDL_GetAtomicInt(&v);
tfret = (SDL_CompareAndSwapAtomicInt(&v, value, 20) == true);
SDL_Log("AtomicCAS() tfret=%s val=%d", tf(tfret), SDL_GetAtomicInt(&v));
}
/**************************************************************************/
/* Atomic operation test
* Adapted with permission from code by Michael Davidsaver at:
* http://bazaar.launchpad.net/~mdavidsaver/epics-base/atomic/revision/12105#src/libCom/test/epicsAtomicTest.c
* Original copyright 2010 Brookhaven Science Associates as operator of Brookhaven National Lab
* http://www.aps.anl.gov/epics/license/open.php
*/
/* Tests semantics of atomic operations. Also a stress test
* to see if they are really atomic.
*
* Several threads adding to the same variable.
* at the end the value is compared with the expected
* and with a non-atomic counter.
*/
/* Number of concurrent incrementers */
#define NThreads 2
#define CountInc 100
#define VALBITS (sizeof(atomicValue) * 8)
#define atomicValue int
#define CountTo ((atomicValue)((1u << (VALBITS - 1)) - 1))
#define NInter (CountTo / CountInc / NThreads)
#define Expect (CountTo - NInter * CountInc * NThreads)
enum
{
CountTo_GreaterThanZero = CountTo > 0,
};
SDL_COMPILE_TIME_ASSERT(size, CountTo_GreaterThanZero); /* check for rollover */
static SDL_AtomicInt good = { 42 };
static atomicValue bad = 42;
static SDL_AtomicInt threadsRunning;
static SDL_Semaphore *threadDone;
static int SDLCALL adder(void *junk)
{
unsigned long N = NInter;
SDL_Log("Thread subtracting %d %lu times", CountInc, N);
while (N--) {
SDL_AddAtomicInt(&good, -CountInc);
bad -= CountInc;
}
SDL_AddAtomicInt(&threadsRunning, -1);
SDL_SignalSemaphore(threadDone);
return 0;
}
static void runAdder(void)
{
Uint64 start, end;
int i;
SDL_Thread *threads[NThreads];
start = SDL_GetTicksNS();
threadDone = SDL_CreateSemaphore(0);
SDL_SetAtomicInt(&threadsRunning, NThreads);
for (i = 0; i < NThreads; i++) {
threads[i] = SDL_CreateThread(adder, "Adder", NULL);
}
while (SDL_GetAtomicInt(&threadsRunning) > 0) {
SDL_WaitSemaphore(threadDone);
}
for (i = 0; i < NThreads; i++) {
SDL_WaitThread(threads[i], NULL);
}
SDL_DestroySemaphore(threadDone);
end = SDL_GetTicksNS();
SDL_Log("Finished in %f sec", (end - start) / 1000000000.0);
}
static void RunEpicTest(void)
{
int b;
atomicValue v;
SDL_Log("%s", "");
SDL_Log("epic test---------------------------------------");
SDL_Log("%s", "");
SDL_Log("Size asserted to be >= 32-bit");
SDL_assert(sizeof(atomicValue) >= 4);
SDL_Log("Check static initializer");
v = SDL_GetAtomicInt(&good);
SDL_assert(v == 42);
SDL_assert(bad == 42);
SDL_Log("Test negative values");
SDL_SetAtomicInt(&good, -5);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == -5);
SDL_Log("Verify maximum value");
SDL_SetAtomicInt(&good, CountTo);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == CountTo);
SDL_Log("Test compare and exchange");
b = SDL_CompareAndSwapAtomicInt(&good, 500, 43);
SDL_assert(!b); /* no swap since CountTo!=500 */
v = SDL_GetAtomicInt(&good);
SDL_assert(v == CountTo); /* ensure no swap */
b = SDL_CompareAndSwapAtomicInt(&good, CountTo, 44);
SDL_assert(!!b); /* will swap */
v = SDL_GetAtomicInt(&good);
SDL_assert(v == 44);
SDL_Log("Test Add");
v = SDL_AddAtomicInt(&good, 1);
SDL_assert(v == 44);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == 45);
v = SDL_AddAtomicInt(&good, 10);
SDL_assert(v == 45);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == 55);
SDL_Log("Test Add (Negative values)");
v = SDL_AddAtomicInt(&good, -20);
SDL_assert(v == 55);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == 35);
v = SDL_AddAtomicInt(&good, -50); /* crossing zero down */
SDL_assert(v == 35);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == -15);
v = SDL_AddAtomicInt(&good, 30); /* crossing zero up */
SDL_assert(v == -15);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == 15);
SDL_Log("Reset before count down test");
SDL_SetAtomicInt(&good, CountTo);
v = SDL_GetAtomicInt(&good);
SDL_assert(v == CountTo);
bad = CountTo;
SDL_assert(bad == CountTo);
SDL_Log("Counting down from %d, Expect %d remaining", CountTo, Expect);
runAdder();
v = SDL_GetAtomicInt(&good);
SDL_Log("Atomic %d Non-Atomic %d", v, bad);
SDL_assert(v == Expect);
/* We can't guarantee that bad != Expect, this would happen on a single core system, for example. */
/*SDL_assert(bad != Expect);*/
}
/* End atomic operation test */
/**************************************************************************/
/**************************************************************************/
/* Lock-free FIFO test */
/* This is useful to test the impact of another thread locking the queue
entirely for heavy-weight manipulation.
*/
#define TEST_SPINLOCK_FIFO
#define NUM_READERS 4
#define NUM_WRITERS 4
#define EVENTS_PER_WRITER 1000000
/* The number of entries must be a power of 2 */
#define MAX_ENTRIES 256
#define WRAP_MASK (MAX_ENTRIES - 1)
typedef struct
{
SDL_AtomicInt sequence;
SDL_Event event;
} SDL_EventQueueEntry;
typedef struct
{
SDL_EventQueueEntry entries[MAX_ENTRIES];
char cache_pad1[SDL_CACHELINE_SIZE - ((sizeof(SDL_EventQueueEntry) * MAX_ENTRIES) % SDL_CACHELINE_SIZE)];
SDL_AtomicInt enqueue_pos;
char cache_pad2[SDL_CACHELINE_SIZE - sizeof(SDL_AtomicInt)];
SDL_AtomicInt dequeue_pos;
char cache_pad3[SDL_CACHELINE_SIZE - sizeof(SDL_AtomicInt)];
#ifdef TEST_SPINLOCK_FIFO
SDL_SpinLock lock;
SDL_AtomicInt rwcount;
SDL_AtomicInt watcher;
char cache_pad4[SDL_CACHELINE_SIZE - sizeof(SDL_SpinLock) - 2 * sizeof(SDL_AtomicInt)];
#endif
SDL_AtomicInt active;
/* Only needed for the mutex test */
SDL_Mutex *mutex;
} SDL_EventQueue;
static void InitEventQueue(SDL_EventQueue *queue)
{
int i;
for (i = 0; i < MAX_ENTRIES; ++i) {
SDL_SetAtomicInt(&queue->entries[i].sequence, i);
}
SDL_SetAtomicInt(&queue->enqueue_pos, 0);
SDL_SetAtomicInt(&queue->dequeue_pos, 0);
#ifdef TEST_SPINLOCK_FIFO
queue->lock = 0;
SDL_SetAtomicInt(&queue->rwcount, 0);
SDL_SetAtomicInt(&queue->watcher, 0);
#endif
SDL_SetAtomicInt(&queue->active, 1);
}
static bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *event)
{
SDL_EventQueueEntry *entry;
unsigned queue_pos;
unsigned entry_seq;
int delta;
bool status;
#ifdef TEST_SPINLOCK_FIFO
/* This is a gate so an external thread can lock the queue */
SDL_LockSpinlock(&queue->lock);
SDL_assert(SDL_GetAtomicInt(&queue->watcher) == 0);
SDL_AtomicIncRef(&queue->rwcount);
SDL_UnlockSpinlock(&queue->lock);
#endif
queue_pos = (unsigned)SDL_GetAtomicInt(&queue->enqueue_pos);
for (;;) {
entry = &queue->entries[queue_pos & WRAP_MASK];
entry_seq = (unsigned)SDL_GetAtomicInt(&entry->sequence);
delta = (int)(entry_seq - queue_pos);
if (delta == 0) {
/* The entry and the queue position match, try to increment the queue position */
if (SDL_CompareAndSwapAtomicInt(&queue->enqueue_pos, (int)queue_pos, (int)(queue_pos + 1))) {
/* We own the object, fill it! */
entry->event = *event;
SDL_SetAtomicInt(&entry->sequence, (int)(queue_pos + 1));
status = true;
break;
}
} else if (delta < 0) {
/* We ran into an old queue entry, which means it still needs to be dequeued */
status = false;
break;
} else {
/* We ran into a new queue entry, get the new queue position */
queue_pos = (unsigned)SDL_GetAtomicInt(&queue->enqueue_pos);
}
}
#ifdef TEST_SPINLOCK_FIFO
(void)SDL_AtomicDecRef(&queue->rwcount);
#endif
return status;
}
static bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event)
{
SDL_EventQueueEntry *entry;
unsigned queue_pos;
unsigned entry_seq;
int delta;
bool status;
#ifdef TEST_SPINLOCK_FIFO
/* This is a gate so an external thread can lock the queue */
SDL_LockSpinlock(&queue->lock);
SDL_assert(SDL_GetAtomicInt(&queue->watcher) == 0);
SDL_AtomicIncRef(&queue->rwcount);
SDL_UnlockSpinlock(&queue->lock);
#endif
queue_pos = (unsigned)SDL_GetAtomicInt(&queue->dequeue_pos);
for (;;) {
entry = &queue->entries[queue_pos & WRAP_MASK];
entry_seq = (unsigned)SDL_GetAtomicInt(&entry->sequence);
delta = (int)(entry_seq - (queue_pos + 1));
if (delta == 0) {
/* The entry and the queue position match, try to increment the queue position */
if (SDL_CompareAndSwapAtomicInt(&queue->dequeue_pos, (int)queue_pos, (int)(queue_pos + 1))) {
/* We own the object, fill it! */
*event = entry->event;
SDL_SetAtomicInt(&entry->sequence, (int)(queue_pos + MAX_ENTRIES));
status = true;
break;
}
} else if (delta < 0) {
/* We ran into an old queue entry, which means we've hit empty */
status = false;
break;
} else {
/* We ran into a new queue entry, get the new queue position */
queue_pos = (unsigned)SDL_GetAtomicInt(&queue->dequeue_pos);
}
}
#ifdef TEST_SPINLOCK_FIFO
(void)SDL_AtomicDecRef(&queue->rwcount);
#endif
return status;
}
static bool EnqueueEvent_Mutex(SDL_EventQueue *queue, const SDL_Event *event)
{
SDL_EventQueueEntry *entry;
unsigned queue_pos;
unsigned entry_seq;
int delta;
bool status = false;
SDL_LockMutex(queue->mutex);
queue_pos = (unsigned)queue->enqueue_pos.value;
entry = &queue->entries[queue_pos & WRAP_MASK];
entry_seq = (unsigned)entry->sequence.value;
delta = (int)(entry_seq - queue_pos);
if (delta == 0) {
++queue->enqueue_pos.value;
/* We own the object, fill it! */
entry->event = *event;
entry->sequence.value = (int)(queue_pos + 1);
status = true;
} else if (delta < 0) {
/* We ran into an old queue entry, which means it still needs to be dequeued */
} else {
SDL_Log("ERROR: mutex failed!");
}
SDL_UnlockMutex(queue->mutex);
return status;
}
static bool DequeueEvent_Mutex(SDL_EventQueue *queue, SDL_Event *event)
{
SDL_EventQueueEntry *entry;
unsigned queue_pos;
unsigned entry_seq;
int delta;
bool status = false;
SDL_LockMutex(queue->mutex);
queue_pos = (unsigned)queue->dequeue_pos.value;
entry = &queue->entries[queue_pos & WRAP_MASK];
entry_seq = (unsigned)entry->sequence.value;
delta = (int)(entry_seq - (queue_pos + 1));
if (delta == 0) {
++queue->dequeue_pos.value;
/* We own the object, fill it! */
*event = entry->event;
entry->sequence.value = (int)(queue_pos + MAX_ENTRIES);
status = true;
} else if (delta < 0) {
/* We ran into an old queue entry, which means we've hit empty */
} else {
SDL_Log("ERROR: mutex failed!");
}
SDL_UnlockMutex(queue->mutex);
return status;
}
typedef struct
{
SDL_EventQueue *queue;
int index;
char padding1[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int)) % SDL_CACHELINE_SIZE];
int waits;
bool lock_free;
char padding2[SDL_CACHELINE_SIZE - sizeof(int) - sizeof(bool)];
SDL_Thread *thread;
} WriterData;
typedef struct
{
SDL_EventQueue *queue;
int counters[NUM_WRITERS];
int waits;
bool lock_free;
char padding[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int) * NUM_WRITERS + sizeof(int) + sizeof(bool)) % SDL_CACHELINE_SIZE];
SDL_Thread *thread;
} ReaderData;
static int SDLCALL FIFO_Writer(void *_data)
{
WriterData *data = (WriterData *)_data;
SDL_EventQueue *queue = data->queue;
int i;
SDL_Event event;
event.type = SDL_EVENT_USER;
event.user.windowID = 0;
event.user.code = 0;
event.user.data1 = data;
event.user.data2 = NULL;
if (data->lock_free) {
for (i = 0; i < EVENTS_PER_WRITER; ++i) {
event.user.code = i;
while (!EnqueueEvent_LockFree(queue, &event)) {
++data->waits;
SDL_Delay(0);
}
}
} else {
for (i = 0; i < EVENTS_PER_WRITER; ++i) {
event.user.code = i;
while (!EnqueueEvent_Mutex(queue, &event)) {
++data->waits;
SDL_Delay(0);
}
}
}
return 0;
}
static int SDLCALL FIFO_Reader(void *_data)
{
ReaderData *data = (ReaderData *)_data;
SDL_EventQueue *queue = data->queue;
SDL_Event event;
if (data->lock_free) {
for (;;) {
if (DequeueEvent_LockFree(queue, &event)) {
WriterData *writer = (WriterData *)event.user.data1;
++data->counters[writer->index];
} else if (SDL_GetAtomicInt(&queue->active)) {
++data->waits;
SDL_Delay(0);
} else {
/* We drained the queue, we're done! */
break;
}
}
} else {
for (;;) {
if (DequeueEvent_Mutex(queue, &event)) {
WriterData *writer = (WriterData *)event.user.data1;
++data->counters[writer->index];
} else if (SDL_GetAtomicInt(&queue->active)) {
++data->waits;
SDL_Delay(0);
} else {
/* We drained the queue, we're done! */
break;
}
}
}
return 0;
}
#ifdef TEST_SPINLOCK_FIFO
/* This thread periodically locks the queue for no particular reason */
static int SDLCALL FIFO_Watcher(void *_data)
{
SDL_EventQueue *queue = (SDL_EventQueue *)_data;
while (SDL_GetAtomicInt(&queue->active)) {
SDL_LockSpinlock(&queue->lock);
SDL_AtomicIncRef(&queue->watcher);
while (SDL_GetAtomicInt(&queue->rwcount) > 0) {
SDL_Delay(0);
}
/* Do queue manipulation here... */
(void)SDL_AtomicDecRef(&queue->watcher);
SDL_UnlockSpinlock(&queue->lock);
/* Wait a bit... */
SDL_Delay(1);
}
return 0;
}
#endif /* TEST_SPINLOCK_FIFO */
static void RunFIFOTest(bool lock_free)
{
SDL_EventQueue queue;
SDL_Thread *fifo_thread = NULL;
WriterData writerData[NUM_WRITERS];
ReaderData readerData[NUM_READERS];
Uint64 start, end;
int i, j;
int grand_total;
char textBuffer[1024];
size_t len;
SDL_Log("%s", "");
SDL_Log("FIFO test---------------------------------------");
SDL_Log("%s", "");
SDL_Log("Mode: %s", lock_free ? "LockFree" : "Mutex");
SDL_memset(&queue, 0xff, sizeof(queue));
InitEventQueue(&queue);
if (!lock_free) {
queue.mutex = SDL_CreateMutex();
}
start = SDL_GetTicksNS();
#ifdef TEST_SPINLOCK_FIFO
/* Start a monitoring thread */
if (lock_free) {
fifo_thread = SDL_CreateThread(FIFO_Watcher, "FIFOWatcher", &queue);
}
#endif
/* Start the readers first */
SDL_Log("Starting %d readers", NUM_READERS);
SDL_zeroa(readerData);
for (i = 0; i < NUM_READERS; ++i) {
char name[64];
(void)SDL_snprintf(name, sizeof(name), "FIFOReader%d", i);
readerData[i].queue = &queue;
readerData[i].lock_free = lock_free;
readerData[i].thread = SDL_CreateThread(FIFO_Reader, name, &readerData[i]);
}
/* Start up the writers */
SDL_Log("Starting %d writers", NUM_WRITERS);
SDL_zeroa(writerData);
for (i = 0; i < NUM_WRITERS; ++i) {
char name[64];
(void)SDL_snprintf(name, sizeof(name), "FIFOWriter%d", i);
writerData[i].queue = &queue;
writerData[i].index = i;
writerData[i].lock_free = lock_free;
writerData[i].thread = SDL_CreateThread(FIFO_Writer, name, &writerData[i]);
}
/* Wait for the writers */
for (i = 0; i < NUM_WRITERS; ++i) {
SDL_WaitThread(writerData[i].thread, NULL);
}
/* Shut down the queue so readers exit */
SDL_SetAtomicInt(&queue.active, 0);
/* Wait for the readers */
for (i = 0; i < NUM_READERS; ++i) {
SDL_WaitThread(readerData[i].thread, NULL);
}
end = SDL_GetTicksNS();
/* Wait for the FIFO thread */
if (fifo_thread) {
SDL_WaitThread(fifo_thread, NULL);
}
if (!lock_free) {
SDL_DestroyMutex(queue.mutex);
}
SDL_Log("Finished in %f sec", (end - start) / 1000000000.0);
SDL_Log("%s", "");
for (i = 0; i < NUM_WRITERS; ++i) {
SDL_Log("Writer %d wrote %d events, had %d waits", i, EVENTS_PER_WRITER, writerData[i].waits);
}
SDL_Log("Writers wrote %d total events", NUM_WRITERS * EVENTS_PER_WRITER);
/* Print a breakdown of which readers read messages from which writer */
SDL_Log("%s", "");
grand_total = 0;
for (i = 0; i < NUM_READERS; ++i) {
int total = 0;
for (j = 0; j < NUM_WRITERS; ++j) {
total += readerData[i].counters[j];
}
grand_total += total;
SDL_Log("Reader %d read %d events, had %d waits", i, total, readerData[i].waits);
(void)SDL_snprintf(textBuffer, sizeof(textBuffer), " { ");
for (j = 0; j < NUM_WRITERS; ++j) {
if (j > 0) {
len = SDL_strlen(textBuffer);
(void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", ");
}
len = SDL_strlen(textBuffer);
(void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, "%d", readerData[i].counters[j]);
}
len = SDL_strlen(textBuffer);
(void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n");
SDL_Log("%s", textBuffer);
}
SDL_Log("Readers read %d total events", grand_total);
}
/* End FIFO test */
/**************************************************************************/
int main(int argc, char *argv[])
{
SDLTest_CommonState *state;
int i;
bool enable_threads = true;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (!state) {
return 1;
}
/* Parse commandline */
for (i = 1; i < argc;) {
int consumed;
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
consumed = -1;
if (SDL_strcasecmp(argv[i], "--no-threads") == 0) {
enable_threads = false;
consumed = 1;
}
}
if (consumed < 0) {
static const char *options[] = {
"[--no-threads]",
NULL
};
SDLTest_CommonLogUsage(state, argv[0], options);
return 1;
}
i += consumed;
}
RunBasicTest();
if (SDL_GetEnvironmentVariable(SDL_GetEnvironment(), "SDL_TESTS_QUICK") != NULL) {
SDL_Log("Not running slower tests");
return 0;
}
if (enable_threads) {
RunEpicTest();
}
/* This test is really slow, so don't run it by default */
#if 0
RunFIFOTest(false);
#endif
RunFIFOTest(true);
SDL_Quit();
SDLTest_CommonDestroyState(state);
return 0;
}
+1277
View File
File diff suppressed because it is too large Load Diff
+209
View File
@@ -0,0 +1,209 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
/* Program to test hotplugging of audio devices */
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
#include "testutils.h"
#ifdef SDL_PLATFORM_EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
#include <stdlib.h>
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
static SDL_AudioSpec spec;
static Uint8 *sound = NULL; /* Pointer to wave data */
static Uint32 soundlen = 0; /* Length of wave data */
static SDLTest_CommonState *state;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void
quit(int rc)
{
SDL_Quit();
SDLTest_CommonDestroyState(state);
/* Let 'main()' return normally */
if (rc != 0) {
exit(rc);
}
}
static int done = 0;
static void poked(int sig)
{
done = 1;
}
static const char *devtypestr(int recording)
{
return recording ? "recording" : "playback";
}
static void iteration(void)
{
SDL_Event e;
SDL_AudioDeviceID dev;
while (SDL_PollEvent(&e)) {
if (e.type == SDL_EVENT_QUIT) {
done = 1;
} else if (e.type == SDL_EVENT_KEY_UP) {
if (e.key.key == SDLK_ESCAPE) {
done = 1;
}
} else if (e.type == SDL_EVENT_AUDIO_DEVICE_ADDED) {
const SDL_AudioDeviceID which = e.adevice.which;
const bool recording = e.adevice.recording ? true : false;
const char *name = SDL_GetAudioDeviceName(which);
if (name) {
SDL_Log("New %s audio device at id %u: %s", devtypestr(recording), (unsigned int)which, name);
} else {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Got new %s device, id %u, but failed to get the name: %s",
devtypestr(recording), (unsigned int)which, SDL_GetError());
continue;
}
if (!recording) {
SDL_AudioStream *stream = SDL_OpenAudioDeviceStream(which, &spec, NULL, NULL);
if (!stream) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to create/bind an audio stream to %u ('%s'): %s", (unsigned int) which, name, SDL_GetError());
} else {
SDL_Log("Opened '%s' as %u", name, (unsigned int) which);
/* !!! FIXME: laziness, this used to loop the audio, but we'll just play it once for now on each connect. */
SDL_PutAudioStreamData(stream, sound, soundlen);
SDL_FlushAudioStream(stream);
SDL_ResumeAudioStreamDevice(stream);
/* !!! FIXME: this is leaking the stream for now. We'll wire it up to a dictionary or whatever later. */
}
}
} else if (e.type == SDL_EVENT_AUDIO_DEVICE_REMOVED) {
dev = e.adevice.which;
SDL_Log("%s device %u removed.", devtypestr(e.adevice.recording), (unsigned int)dev);
/* !!! FIXME: we need to keep track of our streams and destroy them here. */
}
}
}
#ifdef SDL_PLATFORM_EMSCRIPTEN
static void loop(void)
{
if (done)
emscripten_cancel_main_loop();
else
iteration();
}
#endif
int main(int argc, char *argv[])
{
int i;
char *filename = NULL;
SDL_Window *window;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (!state) {
return 1;
}
/* Parse commandline */
for (i = 1; i < argc;) {
int consumed;
consumed = SDLTest_CommonArg(state, i);
if (!consumed) {
if (!filename) {
filename = argv[i];
consumed = 1;
}
}
if (consumed <= 0) {
static const char *options[] = { "[sample.wav]", NULL };
SDLTest_CommonLogUsage(state, argv[0], options);
exit(1);
}
i += consumed;
}
/* Load the SDL library */
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
return 1;
}
/* Some targets (Mac CoreAudio) need an event queue for audio hotplug, so make and immediately hide a window. */
window = SDL_CreateWindow("testaudiohotplug", 640, 480, 0);
if (!window) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_CreateWindow failed: %s", SDL_GetError());
quit(1);
}
SDL_MinimizeWindow(window);
filename = GetResourceFilename(filename, "sample.wav");
if (!filename) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", SDL_GetError());
quit(1);
}
/* Load the wave file into memory */
if (!SDL_LoadWAV(filename, &spec, &sound, &soundlen)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", filename, SDL_GetError());
quit(1);
}
#ifdef HAVE_SIGNAL_H
/* Set the signals */
#ifdef SIGHUP
(void)signal(SIGHUP, poked);
#endif
(void)signal(SIGINT, poked);
#ifdef SIGQUIT
(void)signal(SIGQUIT, poked);
#endif
(void)signal(SIGTERM, poked);
#endif /* HAVE_SIGNAL_H */
/* Show the list of available drivers */
SDL_Log("Available audio drivers:");
for (i = 0; i < SDL_GetNumAudioDrivers(); ++i) {
SDL_Log("%i: %s", i, SDL_GetAudioDriver(i));
}
SDL_Log("Select a driver with the SDL_AUDIO_DRIVER environment variable.");
SDL_Log("Using audio driver: %s", SDL_GetCurrentAudioDriver());
#ifdef SDL_PLATFORM_EMSCRIPTEN
emscripten_set_main_loop(loop, 0, 1);
#else
while (!done) {
SDL_Delay(100);
iteration();
}
#endif
/* Clean up on signal */
/* Quit audio first, then free WAV. This prevents access violations in the audio threads. */
SDL_QuitSubSystem(SDL_INIT_AUDIO);
SDL_free(sound);
SDL_free(filename);
quit(0);
return 0;
}
+122
View File
@@ -0,0 +1,122 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
static void
print_devices(bool recording)
{
SDL_AudioSpec spec;
const char *typestr = (recording ? "recording" : "playback");
int n = 0;
int frames;
SDL_AudioDeviceID *devices = recording ? SDL_GetAudioRecordingDevices(&n) : SDL_GetAudioPlaybackDevices(&n);
if (!devices) {
SDL_Log(" Driver failed to report %s devices: %s", typestr, SDL_GetError());
SDL_Log("%s", "");
} else if (n == 0) {
SDL_Log(" No %s devices found.", typestr);
SDL_Log("%s", "");
} else {
int i;
SDL_Log("Found %d %s device%s:", n, typestr, n != 1 ? "s" : "");
for (i = 0; i < n; i++) {
const char *name = SDL_GetAudioDeviceName(devices[i]);
if (name) {
SDL_Log(" %d: %s", i, name);
} else {
SDL_Log(" %d Error: %s", i, SDL_GetError());
}
if (SDL_GetAudioDeviceFormat(devices[i], &spec, &frames)) {
SDL_Log(" Sample Rate: %d", spec.freq);
SDL_Log(" Channels: %d", spec.channels);
SDL_Log(" SDL_AudioFormat: %X", spec.format);
SDL_Log(" Buffer Size: %d frames", frames);
}
}
SDL_Log("%s", "");
}
SDL_free(devices);
}
int main(int argc, char **argv)
{
SDL_AudioSpec spec;
int i;
int n;
int frames;
SDLTest_CommonState *state;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (!state) {
return 1;
}
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
}
/* Load the SDL library */
if (!SDL_Init(SDL_INIT_AUDIO)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
return 1;
}
/* Print available audio drivers */
n = SDL_GetNumAudioDrivers();
if (n == 0) {
SDL_Log("No built-in audio drivers");
SDL_Log("%s", "");
} else {
SDL_Log("Built-in audio drivers:");
for (i = 0; i < n; ++i) {
SDL_Log(" %d: %s", i, SDL_GetAudioDriver(i));
}
SDL_Log("Select a driver with the SDL_AUDIO_DRIVER environment variable.");
}
SDL_Log("Using audio driver: %s", SDL_GetCurrentAudioDriver());
SDL_Log("%s", "");
print_devices(false);
print_devices(true);
if (SDL_GetAudioDeviceFormat(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, &frames)) {
SDL_Log("Default Playback Device:");
SDL_Log("Sample Rate: %d", spec.freq);
SDL_Log("Channels: %d", spec.channels);
SDL_Log("SDL_AudioFormat: %X", spec.format);
SDL_Log("Buffer Size: %d frames", frames);
} else {
SDL_Log("Error when calling SDL_GetAudioDeviceFormat(default playback): %s", SDL_GetError());
}
if (SDL_GetAudioDeviceFormat(SDL_AUDIO_DEVICE_DEFAULT_RECORDING, &spec, &frames)) {
SDL_Log("Default Recording Device:");
SDL_Log("Sample Rate: %d", spec.freq);
SDL_Log("Channels: %d", spec.channels);
SDL_Log("SDL_AudioFormat: %X", spec.format);
SDL_Log("Buffer Size: %d frames", frames);
} else {
SDL_Log("Error when calling SDL_GetAudioDeviceFormat(default recording): %s", SDL_GetError());
}
SDL_Quit();
SDLTest_CommonDestroyState(state);
return 0;
}
+214
View File
@@ -0,0 +1,214 @@
/*
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
#define SDL_MAIN_USE_CALLBACKS 1
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
static SDL_Window *window = NULL;
static SDL_Renderer *renderer = NULL;
static SDL_AudioStream *stream_in = NULL;
static SDL_AudioStream *stream_out = NULL;
static SDLTest_CommonState *state = NULL;
SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv)
{
SDL_AudioDeviceID *devices;
SDL_AudioSpec outspec;
SDL_AudioSpec inspec;
SDL_AudioDeviceID device;
SDL_AudioDeviceID want_device = SDL_AUDIO_DEVICE_DEFAULT_RECORDING;
const char *devname = NULL;
int i;
/* this doesn't have to run very much, so give up tons of CPU time between iterations. */
SDL_SetHint(SDL_HINT_MAIN_CALLBACK_RATE, "15");
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (!state) {
return SDL_APP_SUCCESS;
}
/* Parse commandline */
for (i = 1; i < argc;) {
int consumed;
consumed = SDLTest_CommonArg(state, i);
if (!consumed) {
if (!devname) {
devname = argv[i];
consumed = 1;
}
}
if (consumed <= 0) {
static const char *options[] = { "[device_name]", NULL };
SDLTest_CommonLogUsage(state, argv[0], options);
return SDL_APP_FAILURE;
}
i += consumed;
}
/* Load the SDL library */
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s", SDL_GetError());
return SDL_APP_SUCCESS;
}
if (!SDL_CreateWindowAndRenderer("testaudiorecording", 320, 240, 0, &window, &renderer)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create SDL window and renderer: %s", SDL_GetError());
return SDL_APP_SUCCESS;
}
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
SDL_Log("Using audio driver: %s", SDL_GetCurrentAudioDriver());
devices = SDL_GetAudioRecordingDevices(NULL);
for (i = 0; devices[i] != 0; i++) {
const char *name = SDL_GetAudioDeviceName(devices[i]);
SDL_Log(" Recording device #%d: '%s'", i, name);
if (devname && (SDL_strcmp(devname, name) == 0)) {
want_device = devices[i];
}
}
if (devname && (want_device == SDL_AUDIO_DEVICE_DEFAULT_RECORDING)) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Didn't see a recording device named '%s', using the system default instead.", devname);
devname = NULL;
}
/* DirectSound can fail in some instances if you open the same hardware
for both recording and output and didn't open the output end first,
according to the docs, so if you're doing something like this, always
open your recording devices second in case you land in those bizarre
circumstances. */
SDL_Log("Opening default playback device...");
device = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, NULL);
if (!device) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open an audio device for playback: %s!", SDL_GetError());
SDL_free(devices);
return SDL_APP_FAILURE;
}
SDL_PauseAudioDevice(device);
SDL_GetAudioDeviceFormat(device, &outspec, NULL);
stream_out = SDL_CreateAudioStream(&outspec, &outspec);
if (!stream_out) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create an audio stream for playback: %s!", SDL_GetError());
SDL_free(devices);
return SDL_APP_FAILURE;
} else if (!SDL_BindAudioStream(device, stream_out)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't bind an audio stream for playback: %s!", SDL_GetError());
SDL_free(devices);
return SDL_APP_FAILURE;
}
SDL_Log("Opening recording device %s%s%s...",
devname ? "'" : "",
devname ? devname : "[[default]]",
devname ? "'" : "");
device = SDL_OpenAudioDevice(want_device, NULL);
if (!device) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open an audio device for recording: %s!", SDL_GetError());
SDL_free(devices);
return SDL_APP_FAILURE;
}
SDL_free(devices);
SDL_PauseAudioDevice(device);
SDL_GetAudioDeviceFormat(device, &inspec, NULL);
stream_in = SDL_CreateAudioStream(&inspec, &inspec);
if (!stream_in) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create an audio stream for recording: %s!", SDL_GetError());
return SDL_APP_FAILURE;
} else if (!SDL_BindAudioStream(device, stream_in)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't bind an audio stream for recording: %s!", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_SetAudioStreamFormat(stream_in, NULL, &outspec); /* make sure we output at the playback format. */
SDL_Log("Ready! Hold down mouse or finger to record!");
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
{
if (event->type == SDL_EVENT_QUIT) {
return SDL_APP_SUCCESS;
} else if (event->type == SDL_EVENT_KEY_DOWN) {
if (event->key.key == SDLK_ESCAPE) {
return SDL_APP_SUCCESS;
}
} else if (event->type == SDL_EVENT_MOUSE_BUTTON_DOWN) {
if (event->button.button == 1) {
SDL_PauseAudioStreamDevice(stream_out);
SDL_FlushAudioStream(stream_out); /* so no samples are held back for resampling purposes. */
SDL_ResumeAudioStreamDevice(stream_in);
}
} else if (event->type == SDL_EVENT_MOUSE_BUTTON_UP) {
if (event->button.button == 1) {
SDL_PauseAudioStreamDevice(stream_in);
SDL_FlushAudioStream(stream_in); /* so no samples are held back for resampling purposes. */
SDL_ResumeAudioStreamDevice(stream_out);
}
}
return SDL_APP_CONTINUE;
}
SDL_AppResult SDL_AppIterate(void *appstate)
{
if (!SDL_AudioStreamDevicePaused(stream_in)) {
SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
} else {
SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
}
SDL_RenderClear(renderer);
SDL_RenderPresent(renderer);
/* Feed any new data we recorded to the output stream. It'll play when we unpause the device. */
while (SDL_GetAudioStreamAvailable(stream_in) > 0) {
Uint8 buf[1024];
const int br = SDL_GetAudioStreamData(stream_in, buf, sizeof(buf));
if (br < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to read from input audio stream: %s", SDL_GetError());
return SDL_APP_FAILURE;
} else if (!SDL_PutAudioStreamData(stream_out, buf, br)) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to write to output audio stream: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
}
return SDL_APP_CONTINUE;
}
void SDL_AppQuit(void *appstate, SDL_AppResult result)
{
SDL_Log("Shutting down.");
const SDL_AudioDeviceID devid_in = SDL_GetAudioStreamDevice(stream_in);
const SDL_AudioDeviceID devid_out = SDL_GetAudioStreamDevice(stream_out);
SDL_CloseAudioDevice(devid_in); /* !!! FIXME: use SDL_OpenAudioDeviceStream instead so we can dump this. */
SDL_CloseAudioDevice(devid_out);
SDL_DestroyAudioStream(stream_in);
SDL_DestroyAudioStream(stream_out);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
SDLTest_CommonDestroyState(state);
}

Some files were not shown because too many files have changed in this diff Show More