mirror of https://github.com/libsdl-org/SDL.git
Compare commits
110 Commits
ec0b905634
...
f881265e17
Author | SHA1 | Date |
---|---|---|
cosmonaut | f881265e17 | |
Ethan Lee | 07f9a946cf | |
Evan Hemsley | 98a29fef70 | |
Evan Hemsley | 1562638b1b | |
Ethan Lee | 2866387b2d | |
cosmonaut | d03e747577 | |
Sam Lantinga | 6f2621438a | |
Sam Lantinga | 2cf32b0e0a | |
APGR22 | 961488b0dc | |
Brick | 09fbb2a07d | |
Anonymous Maarten | d3d7c04bf8 | |
Anonymous Maarten | 18225f7bb5 | |
Anonymous Maarten | a7d4ee05f6 | |
Anonymous Maarten | 690875d555 | |
Anonymous Maarten | 831c79d32f | |
SDL Wiki Bot | eda9247f01 | |
Brick | b6b9d5508e | |
Sam Lantinga | 5c4b558c1c | |
Ozkan Sezer | f295f6814c | |
Ali Emre Gülcü | f17b556c76 | |
vittorioromeo | a69eaae32e | |
Anonymous Maarten | a50e0319d5 | |
Sam Lantinga | 7cddde32ac | |
Sam Lantinga | c24f860c4d | |
SDL Wiki Bot | 919c012d29 | |
Sam Lantinga | abfd0dc683 | |
Sam Lantinga | 730fa2c379 | |
Sam Lantinga | 02ff85f2f3 | |
Sam Lantinga | 4609af618a | |
Ryan C. Gordon | 241603b607 | |
Frank Praznik | 67f3a3ee54 | |
Ryan C. Gordon | 241cfaf38f | |
Ryan C. Gordon | 253c917296 | |
Ryan C. Gordon | 45df084287 | |
Ryan C. Gordon | 665ff8c5f6 | |
SDL Wiki Bot | 10ab623d43 | |
Frank Praznik | 9ac523f940 | |
Ryan C. Gordon | 5e6d85b8f0 | |
Sam Lantinga | 558630d59c | |
Sam Lantinga | 7843579358 | |
Sylvain | ee16d2f705 | |
Anonymous Maarten | 027856b9fa | |
Anonymous Maarten | 88980aeb21 | |
Oleg | 79cabeef18 | |
Oleg | dc9d9dd85a | |
Oleg | ce9177b64f | |
Sam Lantinga | fd678ff50f | |
Green Sky | 0ee874f02d | |
Sam Lantinga | fbe7e2e6d3 | |
SDL Wiki Bot | c6354252a1 | |
Susko3 | e6345716e0 | |
Susko3 | 968e8c9275 | |
Susko3 | 8d7f91f8e4 | |
Ryan C. Gordon | 4b3b5fb56c | |
SDL Wiki Bot | 60d355eb0b | |
Ryan C. Gordon | d57f2afcaf | |
Sam Lantinga | 661f2fc1fc | |
SDL Wiki Bot | 5a0879b7dd | |
Susko3 | f229e940a4 | |
SDL Wiki Bot | f9876b6b5c | |
Ryan C. Gordon | 2066ee08c9 | |
Ryan C. Gordon | 917c62e55c | |
Anonymous Maarten | c7205ab6b5 | |
Petar Popovic | 1103294d33 | |
Ryan C. Gordon | 1796511782 | |
Ryan C. Gordon | 62a7e419f7 | |
Ryan C. Gordon | 17976c1ae1 | |
Petar Popovic | 3baec8aab4 | |
Sam Lantinga | 863a9029ae | |
Ryan C. Gordon | 03b7e02804 | |
Sam Lantinga | 92301ae8a3 | |
Sam Lantinga | 9b7f88e512 | |
Sam Lantinga | 84fa11f740 | |
Sam Lantinga | be786aeb9d | |
SDL Wiki Bot | 8b5f0d07e9 | |
Frank Praznik | df3fea87d6 | |
SDL Wiki Bot | c7087fea01 | |
Sam Lantinga | 5f1e01cce0 | |
Sam Lantinga | 17520c2e6e | |
SDL Wiki Bot | 678cfd23c0 | |
SDL Wiki Bot | 7d6453ea33 | |
Ryan C. Gordon | 766de7deff | |
Ryan C. Gordon | 7bc4bb9f96 | |
Petar Popovic | 94cbaaabbf | |
SDL Wiki Bot | 06d6f2cb25 | |
Sam Lantinga | b959203c9b | |
Sam Lantinga | fc62dfc6e2 | |
Frank Praznik | f4aca6866c | |
SDL Wiki Bot | 486af58797 | |
Thomas J Faughnan Jr | ad166be1c5 | |
SDL Wiki Bot | 8bd0433966 | |
Sam Lantinga | cb416922e3 | |
Sylvain | 7b252634fd | |
Cyao | d4ce9183b8 | |
Anonymous Maarten | a4371d28ac | |
Sam Lantinga | 026edbeab0 | |
Sam Lantinga | c95c415a0b | |
Sam Lantinga | 8582bdaab8 | |
Sam Lantinga | c64d7ed0aa | |
Sam Lantinga | 71f3750ff1 | |
Petar Popovic | 9c6aa5066a | |
Sam Lantinga | a87fa020ac | |
Sam Lantinga | 323bab9305 | |
Ozkan Sezer | 2205626816 | |
Ozkan Sezer | b2fca55e5c | |
SDL Wiki Bot | cd45e0a1ed | |
SDL Wiki Bot | 7857d34d2c | |
Sam Lantinga | 06a5d4d24f | |
Sam Lantinga | c1ba31118b | |
Ryan C. Gordon | d231edd2ad |
|
@ -139,7 +139,22 @@ jobs:
|
|||
- name: Package (CPack)
|
||||
if: ${{ always() && steps.build.outcome == 'success' }}
|
||||
run: |
|
||||
cmake --build build/ --config Release --target package
|
||||
# DMG creation on macOS occasionally fails, so try multiple times
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/25671
|
||||
success=0
|
||||
max_tries=10
|
||||
for i in $(seq $max_tries); do
|
||||
cmake --build build/ --config Release --target package && success=1
|
||||
if test $success = 1; then
|
||||
break
|
||||
fi
|
||||
echo "Package creation failed. Sleep 1 second and try again."
|
||||
sleep 1
|
||||
done
|
||||
if test $success = 0; then
|
||||
echo "Package creation failed after $max_tries attempts."
|
||||
exit 1
|
||||
fi
|
||||
- name: Verify CMake configuration files
|
||||
run: |
|
||||
${{ matrix.platform.source_cmd }}
|
||||
|
|
|
@ -3,12 +3,12 @@ projectshortname = SDL
|
|||
incsubdir = include/SDL3
|
||||
wikisubdir =
|
||||
readmesubdir = docs
|
||||
apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_)
|
||||
apiprefixregex = (SDL_|SDLK_)
|
||||
mainincludefname = SDL3/SDL.h
|
||||
versionfname = include/SDL3/SDL_version.h
|
||||
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
|
||||
versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
|
||||
versionpatchregex = \A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z
|
||||
versionmicroregex = \A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z
|
||||
selectheaderregex = \ASDL.*?\.h\Z
|
||||
projecturl = https://libsdl.org/
|
||||
wikiurl = https://wiki.libsdl.org
|
||||
|
@ -17,3 +17,7 @@ warn_about_missing = 0
|
|||
wikipreamble = (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!)
|
||||
wikiheaderfiletext = Defined in [<SDL3/%fname%>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/%fname%)
|
||||
manpageheaderfiletext = Defined in SDL3/%fname%
|
||||
|
||||
# All SDL_test_* headers become undefined categories, everything else just converts like SDL_audio.h -> Audio
|
||||
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
|
||||
headercategoryeval = s/\ASDL_test_?.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
||||
|
|
|
@ -35,6 +35,8 @@ LOCAL_SRC_FILES := \
|
|||
$(wildcard $(LOCAL_PATH)/src/dynapi/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/events/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/file/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/gpu/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/gpu/*/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/haptic/android/*.c) \
|
||||
$(wildcard $(LOCAL_PATH)/src/hidapi/*.c) \
|
||||
|
|
|
@ -248,6 +248,7 @@ endmacro()
|
|||
|
||||
define_sdl_subsystem(Audio)
|
||||
define_sdl_subsystem(Video)
|
||||
define_sdl_subsystem(Gpu DEPS SDL_VIDEO)
|
||||
define_sdl_subsystem(Render DEPS SDL_VIDEO)
|
||||
define_sdl_subsystem(Camera DEPS SDL_VIDEO)
|
||||
define_sdl_subsystem(Joystick)
|
||||
|
@ -376,6 +377,12 @@ if(VITA)
|
|||
set_option(VIDEO_VITA_PVR "Build with PSVita PVR gles/gles2 support" OFF)
|
||||
endif()
|
||||
|
||||
# FIXME: Eventually this will use pkgconfig:
|
||||
# https://github.com/doitsujin/dxvk/pull/3834
|
||||
if(LINUX)
|
||||
option(SDL_USE_DXVK "Build with dxvk-native support" OFF)
|
||||
endif()
|
||||
|
||||
set(HAVE_STATIC_PIC "${SDL_STATIC_PIC}")
|
||||
|
||||
if(NOT (SDL_SHARED OR SDL_STATIC))
|
||||
|
@ -483,6 +490,8 @@ sdl_glob_sources(
|
|||
"${SDL3_SOURCE_DIR}/src/events/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/file/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/filesystem/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/gpu/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/gpu/*/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/joystick/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/haptic/*.c"
|
||||
"${SDL3_SOURCE_DIR}/src/hidapi/*.c"
|
||||
|
@ -1395,7 +1404,7 @@ if(ANDROID)
|
|||
find_package(Java)
|
||||
find_package(SdlAndroidPlatform MODULE)
|
||||
|
||||
if(Java_FOUND AND SdlAndroidPlatform_FOUND)
|
||||
if(Java_FOUND AND SdlAndroidPlatform_FOUND AND NOT CMAKE_VERSION VERSION_LESS "3.19")
|
||||
include(UseJava)
|
||||
set(path_android_jar "${SDL_ANDROID_PLATFORM_ROOT}/android.jar")
|
||||
set(android_java_sources_root "${SDL3_SOURCE_DIR}/android-project/app/src/main/java")
|
||||
|
@ -2348,6 +2357,10 @@ elseif(APPLE)
|
|||
set(SDL_VIDEO_RENDER_METAL 1)
|
||||
set(HAVE_RENDER_METAL TRUE)
|
||||
endif()
|
||||
if (SDL_GPU)
|
||||
set(SDL_GPU_METAL 1)
|
||||
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/gpu/metal/*.m")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@ -2906,6 +2919,18 @@ if(SDL_VIDEO)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(SDL_GPU)
|
||||
if(SDL_VIDEO_RENDER_D3D11 OR SDL_USE_DXVK)
|
||||
set(SDL_GPU_D3D11 1)
|
||||
set(HAVE_SDL_GPU TRUE)
|
||||
endif()
|
||||
|
||||
if(SDL_VIDEO_VULKAN)
|
||||
set(SDL_GPU_VULKAN 1)
|
||||
set(HAVE_SDL_GPU TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Dummies
|
||||
# configure.ac does it differently:
|
||||
# if not have X
|
||||
|
@ -3304,6 +3329,16 @@ if(SDL_SHARED)
|
|||
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
||||
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src>"
|
||||
)
|
||||
if(SDL_USE_DXVK)
|
||||
# FIXME: Eventually this will use pkgconfig:
|
||||
# https://github.com/doitsujin/dxvk/pull/3834
|
||||
target_include_directories(SDL3-shared
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dxvk/include/native/directx>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dxvk/include/native/windows>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dxvk/include/native/wsi>
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(SDL3-shared PUBLIC $<TARGET_NAME:SDL3::Headers>)
|
||||
if(MINGW OR CYGWIN)
|
||||
target_link_options(SDL3-shared PRIVATE -static-libgcc)
|
||||
|
@ -3332,6 +3367,16 @@ if(SDL_STATIC)
|
|||
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
|
||||
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR}/src>"
|
||||
)
|
||||
if(SDL_USE_DXVK)
|
||||
# FIXME: Eventually this will use pkgconfig:
|
||||
# https://github.com/doitsujin/dxvk/pull/3834
|
||||
target_include_directories(SDL3-static
|
||||
PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dxvk/include/native/directx>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dxvk/include/native/windows>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dxvk/include/native/wsi>
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(SDL3-static PUBLIC $<TARGET_NAME:SDL3::Headers>)
|
||||
# Use `Compatible Interface Properties` to:
|
||||
# - allow consumers to enforce a shared/static library
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
<ClInclude Include="..\src\events\SDL_touch_c.h" />
|
||||
<ClInclude Include="..\src\events\SDL_windowevents_c.h" />
|
||||
<ClInclude Include="..\src\filesystem\SDL_sysfilesystem.h" />
|
||||
<ClInclude Include="..\src\gpu\SDL_gpu_driver.h" />
|
||||
<ClInclude Include="..\src\haptic\SDL_haptic_c.h" />
|
||||
<ClInclude Include="..\src\haptic\SDL_syshaptic.h" />
|
||||
<ClInclude Include="..\src\haptic\windows\SDL_dinputhaptic_c.h" />
|
||||
|
@ -339,6 +340,10 @@
|
|||
<ClCompile Include="..\src\file\SDL_iostream.c" />
|
||||
<ClCompile Include="..\src\filesystem\SDL_filesystem.c" />
|
||||
<ClCompile Include="..\src\filesystem\windows\SDL_sysfsops.c" />
|
||||
<ClCompile Include="..\src\gpu\SDL_gpu.c "/>
|
||||
<ClCompile Include="..\src\gpu\SDL_gpu_spirv.c "/>
|
||||
<ClCompile Include="..\src\gpu\d3d11\SDL_gpu_d3d11.c "/>
|
||||
<ClCompile Include="..\src\gpu\d3d11\SDL_gpu_d3d11_d3dcompiler.c "/>
|
||||
<ClCompile Include="..\src\haptic\dummy\SDL_syshaptic.c" />
|
||||
<ClCompile Include="..\src\haptic\SDL_haptic.c" />
|
||||
<ClCompile Include="..\src\haptic\windows\SDL_dinputhaptic.c" />
|
||||
|
|
|
@ -253,6 +253,7 @@
|
|||
<ClInclude Include="..\..\include\SDL3\SDL_events.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_filesystem.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_gamepad.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_gpu.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_guid.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_haptic.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_hints.h" />
|
||||
|
@ -345,7 +346,10 @@
|
|||
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
|
||||
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
|
||||
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_filesystem.h" />
|
||||
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h" />
|
||||
<ClInclude Include="..\..\src\gpu\SDL_gpu_driver.h" />
|
||||
<ClInclude Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
|
||||
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
|
||||
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
|
||||
|
@ -406,6 +410,11 @@
|
|||
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
|
||||
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c" />
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11_d3dcompiler.c" />
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c" />
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu_spirv.c" />
|
||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
|
||||
<ClCompile Include="..\..\src\main\generic\SDL_sysmain_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
|
||||
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
|
||||
|
|
|
@ -195,6 +195,8 @@
|
|||
</Filter>
|
||||
<Filter Include="time\windows">
|
||||
<UniqueIdentifier>{0000d7fda065b13b0ca4ab262c380000}</UniqueIdentifier>
|
||||
<Filter Include="gpu">
|
||||
<UniqueIdentifier>{098fbef9-d8a0-4b3b-b57b-d157d395335d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="dialog">
|
||||
<UniqueIdentifier>{00008dfdfa0190856fbf3c7db52d0000}</UniqueIdentifier>
|
||||
|
@ -871,6 +873,16 @@
|
|||
<ClInclude Include="..\..\src\render\vulkan\SDL_shaders_vulkan.h">
|
||||
<Filter>render\vulkan</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_storage.h" />
|
||||
<ClInclude Include="..\..\include\SDL3\SDL_gpu.h">
|
||||
<Filter>API Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gpu\SDL_gpu_driver.h">
|
||||
<Filter>gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan_vkfuncs.h">
|
||||
<Filter>gpu</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
|
||||
|
@ -1479,6 +1491,24 @@
|
|||
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c">
|
||||
<Filter>render\vulkan</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\storage\generic\SDL_genericstorage.c" />
|
||||
<ClCompile Include="..\..\src\storage\steam\SDL_steamstorage.c" />
|
||||
<ClCompile Include="..\..\src\storage\SDL_storage.c" />
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\SDL_gpu_spirv.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gpu\d3d11\SDL_gpu_d3d11_d3dcompiler.c">
|
||||
<Filter>gpu</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
|
||||
|
|
|
@ -13,10 +13,10 @@ string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re
|
|||
set(_sdl_major "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
|
||||
set(_sdl_minor "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)" _sdl_patch_re "${_sdl_version_h}")
|
||||
set(_sdl_patch "${CMAKE_MATCH_1}")
|
||||
if(_sdl_major_re AND _sdl_minor_re AND _sdl_patch_re)
|
||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_patch}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_version_h}")
|
||||
set(_sdl_micro "${CMAKE_MATCH_1}")
|
||||
if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
|
||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
||||
else()
|
||||
message(AUTHOR_WARNING "Could not extract version from SDL3/SDL_version.h.")
|
||||
return()
|
||||
|
|
|
@ -30,10 +30,10 @@ string(REGEX MATCH "#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re
|
|||
set(_sdl_major "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_version_h}")
|
||||
set(_sdl_minor "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)" _sdl_patch_re "${_sdl_version_h}")
|
||||
set(_sdl_patch "${CMAKE_MATCH_1}")
|
||||
if(_sdl_major_re AND _sdl_minor_re AND _sdl_patch_re)
|
||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_patch}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_MICRO_VERSION[ \t]+([0-9]+)" _sdl_micro_re "${_sdl_version_h}")
|
||||
set(_sdl_micro "${CMAKE_MATCH_1}")
|
||||
if(_sdl_major_re AND _sdl_minor_re AND _sdl_micro_re)
|
||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_micro}")
|
||||
else()
|
||||
message(AUTHOR_WARNING "Could not extract version from SDL_version.h.")
|
||||
return()
|
||||
|
@ -43,8 +43,8 @@ unset(_sdl_major_re)
|
|||
unset(_sdl_major)
|
||||
unset(_sdl_minor_re)
|
||||
unset(_sdl_minor)
|
||||
unset(_sdl_patch_re)
|
||||
unset(_sdl_patch)
|
||||
unset(_sdl_micro_re)
|
||||
unset(_sdl_micro)
|
||||
|
||||
if(PACKAGE_FIND_VERSION_RANGE)
|
||||
# Package version must be in the requested version range
|
||||
|
|
|
@ -338,6 +338,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
// Setup
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.v(TAG, "Manufacturer: " + Build.MANUFACTURER);
|
||||
Log.v(TAG, "Device: " + Build.DEVICE);
|
||||
Log.v(TAG, "Model: " + Build.MODEL);
|
||||
Log.v(TAG, "onCreate()");
|
||||
|
@ -1260,7 +1261,17 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.equals("X96-W")) {
|
||||
return true;
|
||||
}
|
||||
return Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.startsWith("TV");
|
||||
if (Build.MANUFACTURER.equals("Amlogic") && Build.MODEL.startsWith("TV")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isVRHeadset() {
|
||||
if (Build.MANUFACTURER.equals("Oculus") && Build.MODEL.startsWith("Quest")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static double getDiagonal()
|
||||
|
@ -1454,15 +1465,20 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
}
|
||||
|
||||
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
|
||||
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
||||
// they are ignored here because sending them as mouse input to SDL is messy
|
||||
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
|
||||
switch (event.getAction()) {
|
||||
case KeyEvent.ACTION_DOWN:
|
||||
case KeyEvent.ACTION_UP:
|
||||
// mark the event as handled or it will be handled by system
|
||||
// handling KEYCODE_BACK by system will call onBackPressed()
|
||||
return true;
|
||||
if (SDLActivity.isVRHeadset()) {
|
||||
// The Oculus Quest controller back button comes in as source mouse, so accept that
|
||||
} else {
|
||||
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
||||
// they are ignored here because sending them as mouse input to SDL is messy
|
||||
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
|
||||
Log.v("SDL", "keycode is back or forward");
|
||||
switch (event.getAction()) {
|
||||
case KeyEvent.ACTION_DOWN:
|
||||
case KeyEvent.ACTION_UP:
|
||||
// mark the event as handled or it will be handled by system
|
||||
// handling KEYCODE_BACK by system will call onBackPressed()
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2985,11 +2985,6 @@ SDL_GamepadBinding *e1;
|
|||
- e1->outputType
|
||||
+ e1->output_type
|
||||
@@
|
||||
typedef SDL_version, SDL_Version;
|
||||
@@
|
||||
- SDL_version
|
||||
+ SDL_Version
|
||||
@@
|
||||
@@
|
||||
- SDL_HINT_ALLOW_TOPMOST
|
||||
+ SDL_HINT_WINDOW_ALLOW_TOPMOST
|
||||
|
@ -3137,10 +3132,64 @@ typedef SDL_Colour, SDL_Color;
|
|||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_iPhoneSetEventPump
|
||||
+ SDL_iOSSetEventPump
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_COMPILEDVERSION
|
||||
+ SDL_VERSION
|
||||
@@
|
||||
@@
|
||||
- SDL_PATCHLEVEL
|
||||
+ SDL_MICRO_VERSION
|
||||
@@
|
||||
@@
|
||||
- SDL_TABLESIZE
|
||||
+ SDL_arraysize
|
||||
@@
|
||||
@@
|
||||
- SDL_iPhoneSetEventPump
|
||||
+ SDL_iOSSetEventPump
|
||||
- SDLK_QUOTE
|
||||
+ SDLK_APOSTROPHE
|
||||
@@
|
||||
@@
|
||||
- SDLK_BACKQUOTE
|
||||
+ SDLK_GRAVE
|
||||
@@
|
||||
@@
|
||||
- SDLK_QUOTEDBL
|
||||
+ SDLK_DBLAPOSTROPHE
|
||||
@@
|
||||
@@
|
||||
- SDL_LogSetAllPriority
|
||||
+ SDL_SetLogPriorities
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_LogSetPriority
|
||||
+ SDL_SetLogPriority
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_LogGetPriority
|
||||
+ SDL_GetLogPriority
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_LogResetPriorities
|
||||
+ SDL_ResetLogPriorities
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_SIMDGetAlignment
|
||||
+ SDL_GetSIMDAlignment
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_MixAudioFormat
|
||||
+ SDL_MixAudio
|
||||
(...)
|
||||
@@
|
||||
@@
|
||||
- SDL_MIX_MAXVOLUME
|
||||
+ 1.0f
|
||||
|
|
|
@ -42,8 +42,8 @@ android_stl="c++_shared"
|
|||
|
||||
sdl_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' "${sdl_root}/include/SDL3/SDL_version.h")
|
||||
sdl_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' "${sdl_root}/include/SDL3/SDL_version.h")
|
||||
sdl_patch=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' "${sdl_root}/include/SDL3/SDL_version.h")
|
||||
sdl_version="${sdl_major}.${sdl_minor}.${sdl_patch}"
|
||||
sdl_micro=$(sed -ne 's/^#define SDL_MICRO_VERSION *//p' "${sdl_root}/include/SDL3/SDL_version.h")
|
||||
sdl_version="${sdl_major}.${sdl_minor}.${sdl_micro}"
|
||||
echo "Building Android prefab package for SDL version $sdl_version"
|
||||
|
||||
prefabhome="${build_root}/prefab-${sdl_version}"
|
||||
|
|
|
@ -513,8 +513,8 @@ class Releaser:
|
|||
text = f.read()
|
||||
major = next(re.finditer(r"^#define SDL_MAJOR_VERSION\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
minor = next(re.finditer(r"^#define SDL_MINOR_VERSION\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
patch = next(re.finditer(r"^#define SDL_PATCHLEVEL\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
return f"{major}.{minor}.{patch}"
|
||||
micro = next(re.finditer(r"^#define SDL_MICRO_VERSION\s+([0-9]+)$", text, flags=re.M)).group(1)
|
||||
return f"{major}.{minor}.{micro}"
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
|
|
|
@ -208,7 +208,7 @@ def find_symbols_in_file(file, regex):
|
|||
|
||||
# double check
|
||||
# Remove one line comment /* ... */
|
||||
# eg: extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
|
||||
# eg: extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */);
|
||||
l = reg_comment_remove_content.sub('', l)
|
||||
|
||||
# Remove strings " ... "
|
||||
|
|
|
@ -12,7 +12,7 @@ fi
|
|||
|
||||
major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL3/SDL_version.h)
|
||||
minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL3/SDL_version.h)
|
||||
micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL3/SDL_version.h)
|
||||
micro=$(sed -ne 's/^#define SDL_MICRO_VERSION *//p' include/SDL3/SDL_version.h)
|
||||
version="${major}.${minor}.${micro}"
|
||||
|
||||
if [ -x "$(command -v git)" ]; then
|
||||
|
|
|
@ -8,7 +8,7 @@ cd `dirname $0`/..
|
|||
|
||||
ref_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL3/SDL_version.h)
|
||||
ref_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL3/SDL_version.h)
|
||||
ref_micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL3/SDL_version.h)
|
||||
ref_micro=$(sed -ne 's/^#define SDL_MICRO_VERSION *//p' include/SDL3/SDL_version.h)
|
||||
ref_version="${ref_major}.${ref_minor}.${ref_micro}"
|
||||
|
||||
tests=0
|
||||
|
@ -25,6 +25,14 @@ not_ok () {
|
|||
failed=1
|
||||
}
|
||||
|
||||
version=$(sed -Ene 's/^.* version ([0-9.]*)$/\1/p' include/SDL3/SDL.h)
|
||||
|
||||
if [ "$ref_version" = "$version" ]; then
|
||||
ok "SDL.h $version"
|
||||
else
|
||||
not_ok "SDL.h $version disagrees with SDL_version.h $ref_version"
|
||||
fi
|
||||
|
||||
version=$(sed -Ene 's/^project\(SDL[0-9]+ LANGUAGES C VERSION "([0-9.]*)"\)$/\1/p' CMakeLists.txt)
|
||||
|
||||
if [ "$ref_version" = "$version" ]; then
|
||||
|
|
|
@ -22,11 +22,13 @@ fi
|
|||
|
||||
MAJOR="$1"
|
||||
MINOR="$2"
|
||||
PATCH="$3"
|
||||
NEWVERSION="$MAJOR.$MINOR.$PATCH"
|
||||
MICRO="$3"
|
||||
NEWVERSION="$MAJOR.$MINOR.$MICRO"
|
||||
|
||||
echo "Updating version to '$NEWVERSION' ..."
|
||||
|
||||
perl -w -pi -e 's/\A(.* version )[0-9.]+/${1}'$NEWVERSION'/;' include/SDL3/SDL.h
|
||||
|
||||
# !!! FIXME: This first one is a kinda scary search/replace that might fail later if another X.Y.Z version is added to the file.
|
||||
perl -w -pi -e 's/(\<string\>)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/Info-Framework.plist
|
||||
|
||||
|
@ -41,14 +43,14 @@ perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;
|
|||
perl -w -pi -e 's/(DYLIB_COMPATIBILITY_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
|
||||
# non-zero patch?
|
||||
if [ "x$PATCH" != "x0" ]; then
|
||||
if [ "x$MICRO" != "x0" ]; then
|
||||
if [ `expr $MINOR % 2` = "0" ]; then
|
||||
# If patch is not zero, but minor is even, it's a bugfix release.
|
||||
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.'$PATCH'.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.'$MICRO'.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
|
||||
else
|
||||
# If patch is not zero, but minor is odd, it's a development prerelease.
|
||||
DYVER=`expr $MINOR \* 100 + $PATCH + 1`
|
||||
DYVER=`expr $MINOR \* 100 + $MICRO + 1`
|
||||
perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
perl -w -pi -e 's/(DYLIB_COMPATIBILITY_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj
|
||||
fi
|
||||
|
@ -58,16 +60,16 @@ perl -w -pi -e 's/\A(project\(SDL[0-9]+ LANGUAGES C VERSION ")[0-9.]+/${1}'$NEWV
|
|||
|
||||
perl -w -pi -e 's/\A(.* SDL_MAJOR_VERSION = )\d+/${1}'$MAJOR'/;' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
|
||||
perl -w -pi -e 's/\A(.* SDL_MINOR_VERSION = )\d+/${1}'$MINOR'/;' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
|
||||
perl -w -pi -e 's/\A(.* SDL_MICRO_VERSION = )\d+/${1}'$PATCH'/;' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
|
||||
perl -w -pi -e 's/\A(.* SDL_MICRO_VERSION = )\d+/${1}'$MICRO'/;' android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
|
||||
|
||||
perl -w -pi -e 's/(\#define SDL_MAJOR_VERSION\s+)\d+/${1}'$MAJOR'/;' include/SDL3/SDL_version.h
|
||||
perl -w -pi -e 's/(\#define SDL_MINOR_VERSION\s+)\d+/${1}'$MINOR'/;' include/SDL3/SDL_version.h
|
||||
perl -w -pi -e 's/(\#define SDL_PATCHLEVEL\s+)\d+/${1}'$PATCH'/;' include/SDL3/SDL_version.h
|
||||
perl -w -pi -e 's/(\#define SDL_MICRO_VERSION\s+)\d+/${1}'$MICRO'/;' include/SDL3/SDL_version.h
|
||||
|
||||
perl -w -pi -e 's/(FILEVERSION\s+)\d+,\d+,\d+/${1}'$MAJOR','$MINOR','$PATCH'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(PRODUCTVERSION\s+)\d+,\d+,\d+/${1}'$MAJOR','$MINOR','$PATCH'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(VALUE "FileVersion", ")\d+, \d+, \d+/${1}'$MAJOR', '$MINOR', '$PATCH'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(VALUE "ProductVersion", ")\d+, \d+, \d+/${1}'$MAJOR', '$MINOR', '$PATCH'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(FILEVERSION\s+)\d+,\d+,\d+/${1}'$MAJOR','$MINOR','$MICRO'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(PRODUCTVERSION\s+)\d+,\d+,\d+/${1}'$MAJOR','$MINOR','$MICRO'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(VALUE "FileVersion", ")\d+, \d+, \d+/${1}'$MAJOR', '$MINOR', '$MICRO'/;' src/core/windows/version.rc
|
||||
perl -w -pi -e 's/(VALUE "ProductVersion", ")\d+, \d+, \d+/${1}'$MAJOR', '$MINOR', '$MICRO'/;' src/core/windows/version.rc
|
||||
|
||||
echo "Running build-scripts/test-versioning.sh to verify changes..."
|
||||
./build-scripts/test-versioning.sh
|
||||
|
|
|
@ -16,7 +16,7 @@ my $apiprefixregex = undef;
|
|||
my $versionfname = 'include/SDL_version.h';
|
||||
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
|
||||
my $versionminorregex = '\A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z';
|
||||
my $versionpatchregex = '\A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z';
|
||||
my $versionmicroregex = '\A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z';
|
||||
my $mainincludefname = 'SDL.h';
|
||||
my $selectheaderregex = '\ASDL.*?\.h\Z';
|
||||
my $projecturl = 'https://libsdl.org/';
|
||||
|
@ -31,6 +31,7 @@ my $optionsfname = undef;
|
|||
my $wikipreamble = undef;
|
||||
my $wikiheaderfiletext = 'Defined in %fname%';
|
||||
my $manpageheaderfiletext = 'Defined in %fname%';
|
||||
my $headercategoryeval = undef;
|
||||
my $changeformat = undef;
|
||||
my $manpath = undef;
|
||||
my $gitrev = undef;
|
||||
|
@ -70,6 +71,8 @@ if ((not defined $optionsfname) && (-f $default_optionsfname)) {
|
|||
if (defined $optionsfname) {
|
||||
open OPTIONS, '<', $optionsfname or die("Failed to open options file '$optionsfname': $!\n");
|
||||
while (<OPTIONS>) {
|
||||
next if /\A\s*\#/; # Skip lines that start with (optional whitespace, then) '#' as comments.
|
||||
|
||||
chomp;
|
||||
if (/\A(.*?)\=(.*)\Z/) {
|
||||
my $key = $1;
|
||||
|
@ -89,7 +92,7 @@ if (defined $optionsfname) {
|
|||
$readmesubdir = $val, next if $key eq 'readmesubdir';
|
||||
$versionmajorregex = $val, next if $key eq 'versionmajorregex';
|
||||
$versionminorregex = $val, next if $key eq 'versionminorregex';
|
||||
$versionpatchregex = $val, next if $key eq 'versionpatchregex';
|
||||
$versionmicroregex = $val, next if $key eq 'versionmicroregex';
|
||||
$versionfname = $val, next if $key eq 'versionfname';
|
||||
$mainincludefname = $val, next if $key eq 'mainincludefname';
|
||||
$selectheaderregex = $val, next if $key eq 'selectheaderregex';
|
||||
|
@ -99,6 +102,7 @@ if (defined $optionsfname) {
|
|||
$wikipreamble = $val, next if $key eq 'wikipreamble';
|
||||
$wikiheaderfiletext = $val, next if $key eq 'wikiheaderfiletext';
|
||||
$manpageheaderfiletext = $val, next if $key eq 'manpageheaderfiletext';
|
||||
$headercategoryeval = $val, next if $key eq 'headercategoryeval';
|
||||
}
|
||||
}
|
||||
close(OPTIONS);
|
||||
|
@ -617,7 +621,8 @@ my %headersymslocation = (); # $headersymslocation{"SDL_OpenAudio"} -> name of
|
|||
my %headersymschunk = (); # $headersymschunk{"SDL_OpenAudio"} -> offset in array in %headers that should be replaced for this symbol.
|
||||
my %headersymshasdoxygen = (); # $headersymshasdoxygen{"SDL_OpenAudio"} -> 1 if there was no existing doxygen for this function.
|
||||
my %headersymstype = (); # $headersymstype{"SDL_OpenAudio"} -> 1 (function), 2 (macro), 3 (struct), 4 (enum), 5 (other typedef)
|
||||
|
||||
my %headersymscategory = (); # $headersymscategory{"SDL_OpenAudio"} -> 'Audio' ... this is set with a `/* WIKI CATEGEORY: Audio */` comment in the headers that sets it on all symbols until a new comment changes it. So usually, once at the top of the header file.
|
||||
my %headercategorydocs = (); # $headercategorydocs{"Audio"} -> (fake) symbol for this category's documentation. Undefined if not documented.
|
||||
my %wikitypes = (); # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki'
|
||||
my %wikisyms = (); # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikisyms{"SDL_OpenAudio"}{"Remarks"}.
|
||||
my %wikisectionorder = (); # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
|
||||
|
@ -689,9 +694,23 @@ while (my $d = readdir(DH)) {
|
|||
next if not $dent =~ /$selectheaderregex/; # just selected headers.
|
||||
open(FH, '<', "$incpath/$dent") or die("Can't open '$incpath/$dent': $!\n");
|
||||
|
||||
# You can optionally set a wiki category with Perl code in .wikiheaders-options that gets eval()'d per-header,
|
||||
# and also if you put `/* WIKI CATEGORY: blah */` on a line by itself, it'll change the category for any symbols
|
||||
# below it in the same file. If no category is set, one won't be added for the symbol (beyond the standard CategoryFunction, etc)
|
||||
my $current_wiki_category = undef;
|
||||
if (defined $headercategoryeval) {
|
||||
$_ = $dent;
|
||||
$current_wiki_category = eval($headercategoryeval);
|
||||
if (($current_wiki_category eq '') || ($current_wiki_category eq '-')) {
|
||||
$current_wiki_category = undef;
|
||||
}
|
||||
#print("CATEGORY FOR '$dent' IS " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n");
|
||||
}
|
||||
|
||||
my @contents = ();
|
||||
my $ignoring_lines = 0;
|
||||
my $header_comment = -1;
|
||||
my $saw_category_doxygen = -1;
|
||||
my $lineno = 0;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
|
@ -722,7 +741,12 @@ while (my $d = readdir(DH)) {
|
|||
$ignoring_lines = 1;
|
||||
push @contents, $_;
|
||||
next;
|
||||
} elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC/) { # a function declaration without a doxygen comment?
|
||||
} elsif (/\A\s*\/\*\s*WIKI CATEGORY:\s*(.*?)\s*\*\/\s*\Z/) {
|
||||
$current_wiki_category = (($1 eq '') || ($1 eq '-')) ? undef : $1;
|
||||
#print("CATEGORY FOR '$dent' CHANGED TO " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n");
|
||||
push @contents, $_;
|
||||
next;
|
||||
} elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC/) { # a function declaration without a doxygen comment?
|
||||
$symtype = 1; # function declaration
|
||||
@templines = ();
|
||||
$decl = $_;
|
||||
|
@ -739,6 +763,8 @@ while (my $d = readdir(DH)) {
|
|||
add_coverage_gap($_, $dent, $lineno) if ($header_comment == 0);
|
||||
next;
|
||||
} else { # Start of a doxygen comment, parse it out.
|
||||
my $is_category_doxygen = 0;
|
||||
|
||||
@templines = ( $_ );
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
|
@ -760,43 +786,76 @@ while (my $d = readdir(DH)) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
s/\A\s*\*\s*//;
|
||||
s/\A\s*\*\s*//; # Strip off the " * " at the start of the comment line.
|
||||
|
||||
# To add documentation to Category Pages, the rule is it has to
|
||||
# be the first Doxygen comment in the header, and it must start with `# CategoryX`
|
||||
# (otherwise we'll treat it as documentation for whatever's below it). `X` is
|
||||
# the category name, which doesn't _necessarily_ have to match
|
||||
# $current_wiki_category, but it probably should.
|
||||
#
|
||||
# For compatibility with Doxygen, if there's a `\file` here instead of
|
||||
# `# CategoryName`, we'll accept it and use the $current_wiki_category if set.
|
||||
if ($saw_category_doxygen == -1) {
|
||||
$saw_category_doxygen = defined($current_wiki_category) && /\A\\file\s+/;
|
||||
if ($saw_category_doxygen) {
|
||||
$_ = "# Category$current_wiki_category";
|
||||
} else {
|
||||
$saw_category_doxygen = /\A\# Category/;
|
||||
}
|
||||
$is_category_doxygen = $saw_category_doxygen;
|
||||
}
|
||||
|
||||
$str .= "$_\n";
|
||||
}
|
||||
}
|
||||
|
||||
$decl = <FH>;
|
||||
$lineno++ if defined $decl;
|
||||
$decl = '' if not defined $decl;
|
||||
chomp($decl);
|
||||
if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC/) {
|
||||
$symtype = 1; # function declaration
|
||||
} elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
|
||||
$symtype = 1; # (forced-inline) function declaration
|
||||
} elsif ($decl =~ /\A\s*\#\s*define\s+/) {
|
||||
$symtype = 2; # macro
|
||||
} elsif ($decl =~ /\A\s*(typedef\s+|)(struct|union)/) {
|
||||
$symtype = 3; # struct or union
|
||||
} elsif ($decl =~ /\A\s*(typedef\s+|)enum/) {
|
||||
$symtype = 4; # enum
|
||||
} elsif ($decl =~ /\A\s*typedef\s+.*\Z/) {
|
||||
$symtype = 5; # other typedef
|
||||
if ($is_category_doxygen) {
|
||||
$str =~ s/\s*\Z//;
|
||||
$decl = '';
|
||||
$symtype = -1; # not a symbol at all.
|
||||
} else {
|
||||
#print "Found doxygen but no function sig:\n$str\n\n";
|
||||
foreach (@templines) {
|
||||
push @contents, $_;
|
||||
add_coverage_gap($_, $dent, $lineno);
|
||||
$decl = <FH>;
|
||||
$lineno++ if defined $decl;
|
||||
$decl = '' if not defined $decl;
|
||||
chomp($decl);
|
||||
if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC/) {
|
||||
$symtype = 1; # function declaration
|
||||
} elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
|
||||
$symtype = 1; # (forced-inline) function declaration
|
||||
} elsif ($decl =~ /\A\s*\#\s*define\s+/) {
|
||||
$symtype = 2; # macro
|
||||
} elsif ($decl =~ /\A\s*(typedef\s+|)(struct|union)/) {
|
||||
$symtype = 3; # struct or union
|
||||
} elsif ($decl =~ /\A\s*(typedef\s+|)enum/) {
|
||||
$symtype = 4; # enum
|
||||
} elsif ($decl =~ /\A\s*typedef\s+.*\Z/) {
|
||||
$symtype = 5; # other typedef
|
||||
} else {
|
||||
#print "Found doxygen but no function sig:\n$str\n\n";
|
||||
foreach (@templines) {
|
||||
push @contents, $_;
|
||||
add_coverage_gap($_, $dent, $lineno);
|
||||
}
|
||||
push @contents, $decl;
|
||||
add_coverage_gap($decl, $dent, $lineno);
|
||||
next;
|
||||
}
|
||||
push @contents, $decl;
|
||||
add_coverage_gap($decl, $dent, $lineno);
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
my @decllines = ( $decl );
|
||||
my $sym = '';
|
||||
|
||||
if ($symtype == 1) { # a function
|
||||
if ($symtype == -1) { # category documentation with no symbol attached.
|
||||
@decllines = ();
|
||||
if ($str =~ /^#\s*Category(.*?)\s*$/m) {
|
||||
$sym = "[category documentation] $1"; # make a fake, unique symbol that's not valid C.
|
||||
} else {
|
||||
die("Unexpected category documentation line '$str' in '$incpath/$dent' ...?");
|
||||
}
|
||||
$headercategorydocs{$current_wiki_category} = $sym;
|
||||
} elsif ($symtype == 1) { # a function
|
||||
my $is_forced_inline = ($decl =~ /\A\s*SDL_FORCE_INLINE/);
|
||||
|
||||
if ($is_forced_inline) {
|
||||
|
@ -829,9 +888,8 @@ while (my $d = readdir(DH)) {
|
|||
|
||||
$decl =~ s/\s+\Z//;
|
||||
|
||||
if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
|
||||
if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
|
||||
$sym = $7;
|
||||
#$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
|
||||
} elsif ($is_forced_inline && $decl =~ /\A\s*SDL_FORCE_INLINE\s+(SDL_DEPRECATED\s+|)(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(.*?)\s*\((.*?)\);/) {
|
||||
$sym = $6;
|
||||
} else {
|
||||
|
@ -850,11 +908,11 @@ while (my $d = readdir(DH)) {
|
|||
foreach (@decllines) {
|
||||
if ($decl eq '') {
|
||||
$decl = $_;
|
||||
$decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_)?DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
|
||||
$decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
|
||||
} else {
|
||||
my $trimmed = $_;
|
||||
# !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
|
||||
$trimmed =~ s/\A\s{24}//; # 24 for shrinking to match the removed "extern DECLSPEC SDLCALL "
|
||||
$trimmed =~ s/\A\s{28}//; # 28 for shrinking to match the removed "extern SDL_DECLSPEC SDLCALL "
|
||||
$decl .= $trimmed;
|
||||
}
|
||||
$decl .= "\n";
|
||||
|
@ -915,7 +973,6 @@ while (my $d = readdir(DH)) {
|
|||
} elsif ($symtype == 2) { # a macro
|
||||
if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)\s+/) {
|
||||
$sym = $1;
|
||||
#$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
|
||||
} else {
|
||||
#print "Found doxygen but no macro:\n$str\n\n";
|
||||
foreach (@templines) {
|
||||
|
@ -1105,11 +1162,12 @@ while (my $d = readdir(DH)) {
|
|||
if ($has_doxygen) {
|
||||
print STDERR "WARNING: Symbol '$sym' appears to be documented in multiple locations. Only keeping the first one we saw!\n";
|
||||
}
|
||||
push @contents, join("\n", @decllines); # just put the existing declation in as-is.
|
||||
push @contents, join("\n", @decllines) if (scalar(@decllines) > 0); # just put the existing declation in as-is.
|
||||
}
|
||||
}
|
||||
|
||||
if (!$skipsym) {
|
||||
$headersymscategory{$sym} = $current_wiki_category if defined $current_wiki_category;
|
||||
$headersyms{$sym} = $str;
|
||||
$headerdecls{$sym} = $decl;
|
||||
$headersymslocation{$sym} = $dent;
|
||||
|
@ -1117,7 +1175,7 @@ while (my $d = readdir(DH)) {
|
|||
$headersymshasdoxygen{$sym} = $has_doxygen;
|
||||
$headersymstype{$sym} = $symtype;
|
||||
push @contents, join("\n", @templines);
|
||||
push @contents, join("\n", @decllines);
|
||||
push @contents, join("\n", @decllines) if (scalar(@decllines) > 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1140,14 +1198,45 @@ while (my $d = readdir(DH)) {
|
|||
my $sym = $dent;
|
||||
$sym =~ s/\..*\Z//;
|
||||
|
||||
# (There are other pages to ignore, but these are known ones to not bother parsing.)
|
||||
# Ignore FrontPage.
|
||||
next if $sym eq 'FrontPage';
|
||||
|
||||
# Ignore "Category*" pages.
|
||||
next if ($sym =~ /\ACategory/);
|
||||
|
||||
open(FH, '<', "$wikipath/$dent") or die("Can't open '$wikipath/$dent': $!\n");
|
||||
|
||||
if ($sym =~ /\ACategory(.*?)\Z/) { # Special case for Category pages.
|
||||
# Find the end of the category documentation in the existing file and append everything else to the new file.
|
||||
my $cat = $1;
|
||||
my $docstr = '';
|
||||
my $notdocstr = '';
|
||||
my $docs = 1;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
if ($docs) {
|
||||
$docs = 0 if /\A\-\-\-\-\Z/; # Hit a footer? We're done.
|
||||
$docs = 0 if /\A<!\-\-/; # Hit an HTML comment? We're done.
|
||||
}
|
||||
if ($docs) {
|
||||
$docstr .= "$_\n";
|
||||
} else {
|
||||
$notdocstr .= "$_\n";
|
||||
}
|
||||
}
|
||||
close(FH);
|
||||
|
||||
$docstr =~ s/\s*\Z//;
|
||||
|
||||
$sym = "[category documentation] $cat"; # make a fake, unique symbol that's not valid C.
|
||||
$wikitypes{$sym} = $type;
|
||||
my %sections = ();
|
||||
$sections{'Remarks'} = $docstr;
|
||||
$sections{'[footer]'} = $notdocstr;
|
||||
$wikisyms{$sym} = \%sections;
|
||||
my @section_order = ( 'Remarks', '[footer]' );
|
||||
$wikisectionorder{$sym} = \@section_order;
|
||||
next;
|
||||
}
|
||||
|
||||
my $current_section = '[start]';
|
||||
my @section_order = ( $current_section );
|
||||
my %sections = ();
|
||||
|
@ -1300,7 +1389,9 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
my $params = undef;
|
||||
my $paramstr = undef;
|
||||
|
||||
if (($symtype == 1) || (($symtype == 5))) { # we'll assume a typedef (5) with a \param is a function pointer typedef.
|
||||
if ($symtype == -1) { # category documentation block.
|
||||
# nothing to be done here.
|
||||
} elsif (($symtype == 1) || (($symtype == 5))) { # we'll assume a typedef (5) with a \param is a function pointer typedef.
|
||||
$params = $sectionsref->{'Function Parameters'};
|
||||
$paramstr = '\param';
|
||||
} elsif ($symtype == 2) {
|
||||
|
@ -1495,7 +1586,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
}
|
||||
$output .= " */";
|
||||
|
||||
#print("$sym:\n$output\n\n");
|
||||
#print("$sym:\n[$output]\n\n");
|
||||
|
||||
$$contentsref[$chunk] = $output;
|
||||
#$$contentsref[$chunk+1] = $headerdecls{$sym};
|
||||
|
@ -1544,6 +1635,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
closedir(DH);
|
||||
}
|
||||
}
|
||||
|
||||
} elsif ($copy_direction == -1) { # --copy-to-wiki
|
||||
|
||||
if (defined $changeformat) {
|
||||
|
@ -1554,6 +1646,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
foreach (keys %headersyms) {
|
||||
my $sym = $_;
|
||||
next if not $headersymshasdoxygen{$sym};
|
||||
next if $sym =~ /\A\[category documentation\]/; # not real symbols, we handle this elsewhere.
|
||||
my $symtype = $headersymstype{$sym};
|
||||
my $origwikitype = defined $wikitypes{$sym} ? $wikitypes{$sym} : 'md'; # default to MarkDown for new stuff.
|
||||
my $wikitype = (defined $changeformat) ? $changeformat : $origwikitype;
|
||||
|
@ -1602,8 +1695,6 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
$remarks =~ s/\s*\Z//;
|
||||
|
||||
my $decl = $headerdecls{$sym};
|
||||
#$decl =~ s/\*\s+SDLCALL/ *SDLCALL/; # Try to make "void * Function" become "void *Function"
|
||||
#$decl =~ s/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL/$2$3/;
|
||||
|
||||
my $syntax = '';
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
|
@ -1787,7 +1878,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
$sections{'Function Parameters'} = $str;
|
||||
}
|
||||
|
||||
my $path = "$wikipath/$_.${wikitype}.tmp";
|
||||
my $path = "$wikipath/$sym.${wikitype}.tmp";
|
||||
open(FH, '>', $path) or die("Can't open '$path': $!\n");
|
||||
|
||||
my $sectionsref = $wikisyms{$sym};
|
||||
|
@ -1823,41 +1914,46 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
}
|
||||
}
|
||||
|
||||
my $footer = $$sectionsref{'[footer]'};
|
||||
if ($symtype != -1) { # Don't do these in category documentation block
|
||||
my $footer = $$sectionsref{'[footer]'};
|
||||
|
||||
my $symtypename;
|
||||
if ($symtype == 1) {
|
||||
$symtypename = 'Function';
|
||||
} elsif ($symtype == 2) {
|
||||
$symtypename = 'Macro';
|
||||
} elsif ($symtype == 3) {
|
||||
$symtypename = 'Struct';
|
||||
} elsif ($symtype == 4) {
|
||||
$symtypename = 'Enum';
|
||||
} elsif ($symtype == 5) {
|
||||
$symtypename = 'Datatype';
|
||||
} else {
|
||||
die("Unexpected symbol type $symtype!");
|
||||
}
|
||||
my $symtypename;
|
||||
if ($symtype == 1) {
|
||||
$symtypename = 'Function';
|
||||
} elsif ($symtype == 2) {
|
||||
$symtypename = 'Macro';
|
||||
} elsif ($symtype == 3) {
|
||||
$symtypename = 'Struct';
|
||||
} elsif ($symtype == 4) {
|
||||
$symtypename = 'Enum';
|
||||
} elsif ($symtype == 5) {
|
||||
$symtypename = 'Datatype';
|
||||
} else {
|
||||
die("Unexpected symbol type $symtype!");
|
||||
}
|
||||
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
$footer =~ s/\[\[CategoryAPI\]\],?\s*//g;
|
||||
$footer =~ s/\[\[CategoryAPI${symtypename}\]\],?\s*//g;
|
||||
$footer = "[[CategoryAPI]], [[CategoryAPI$symtypename]]" . (($footer eq '') ? "\n" : ", $footer");
|
||||
} elsif ($wikitype eq 'md') {
|
||||
$footer =~ s/\[CategoryAPI\]\(CategoryAPI\),?\s*//g;
|
||||
$footer =~ s/\[CategoryAPI${symtypename}\]\(CategoryAPI${symtypename}\),?\s*//g;
|
||||
$footer = "[CategoryAPI](CategoryAPI), [CategoryAPI$symtypename](CategoryAPI$symtypename)" . (($footer eq '') ? '' : ', ') . $footer;
|
||||
} else { die("Unexpected wikitype '$wikitype'"); }
|
||||
$$sectionsref{'[footer]'} = $footer;
|
||||
|
||||
if (defined $wikipreamble) {
|
||||
my $wikified_preamble = wikify($wikitype, $wikipreamble);
|
||||
my $symcategory = $headersymscategory{$sym};
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
print FH "====== $wikified_preamble ======\n";
|
||||
$footer =~ s/\[\[CategoryAPI\]\],?\s*//g;
|
||||
$footer =~ s/\[\[CategoryAPI${symtypename}\]\],?\s*//g;
|
||||
$footer =~ s/\[\[Category${symcategory}\]\],?\s*//g if defined $symcategory;
|
||||
$footer = "[[CategoryAPI]], [[CategoryAPI$symtypename]]" . (defined $symcategory ? ", [[Category$symcategory]]" : '') . (($footer eq '') ? "\n" : ", $footer");
|
||||
} elsif ($wikitype eq 'md') {
|
||||
print FH "###### $wikified_preamble\n";
|
||||
$footer =~ s/\[CategoryAPI\]\(CategoryAPI\),?\s*//g;
|
||||
$footer =~ s/\[CategoryAPI${symtypename}\]\(CategoryAPI${symtypename}\),?\s*//g;
|
||||
$footer =~ s/\[Category${symcategory}\]\(Category${symcategory}\),?\s*//g if defined $symcategory;
|
||||
$footer = "[CategoryAPI](CategoryAPI), [CategoryAPI$symtypename](CategoryAPI$symtypename)" . (defined $symcategory ? ", [Category$symcategory](Category$symcategory)" : '') . (($footer eq '') ? '' : ', ') . $footer;
|
||||
} else { die("Unexpected wikitype '$wikitype'"); }
|
||||
$$sectionsref{'[footer]'} = $footer;
|
||||
|
||||
if (defined $wikipreamble) {
|
||||
my $wikified_preamble = wikify($wikitype, $wikipreamble);
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
print FH "====== $wikified_preamble ======\n";
|
||||
} elsif ($wikitype eq 'md') {
|
||||
print FH "###### $wikified_preamble\n";
|
||||
} else { die("Unexpected wikitype '$wikitype'"); }
|
||||
}
|
||||
}
|
||||
|
||||
my $prevsectstr = '';
|
||||
|
@ -1897,11 +1993,13 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
}
|
||||
}
|
||||
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
print FH "\n== $sectname ==\n\n";
|
||||
} elsif ($wikitype eq 'md') {
|
||||
print FH "\n## $sectname\n\n";
|
||||
} else { die("Unexpected wikitype '$wikitype'"); }
|
||||
if ($symtype != -1) { # Not for category documentation block
|
||||
if ($wikitype eq 'mediawiki') {
|
||||
print FH "\n== $sectname ==\n\n";
|
||||
} elsif ($wikitype eq 'md') {
|
||||
print FH "\n## $sectname\n\n";
|
||||
} else { die("Unexpected wikitype '$wikitype'"); }
|
||||
}
|
||||
}
|
||||
|
||||
my $sectstr = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect};
|
||||
|
@ -1939,12 +2037,80 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
}
|
||||
|
||||
print FH "# $sym\n\nPlease refer to [$refersto]($refersto) for details.\n\n";
|
||||
#print FH "----\n";
|
||||
#print FH "[CategoryAPI](CategoryAPI)\n\n";
|
||||
print FH "----\n";
|
||||
print FH "[CategoryAPI](CategoryAPI), [CategoryAPIMacro](CategoryAPIMacro)\n\n";
|
||||
|
||||
close(FH);
|
||||
}
|
||||
|
||||
# Write out Category pages...
|
||||
foreach (keys %headercategorydocs) {
|
||||
my $cat = $_;
|
||||
my $sym = $headercategorydocs{$cat}; # fake symbol
|
||||
my $raw = $headersyms{$sym}; # raw doxygen text with comment characters stripped from start/end and start of each line.
|
||||
my $wikitype = defined($wikitypes{$sym}) ? $wikitypes{$sym} : 'md';
|
||||
my $path = "$wikipath/Category$cat.$wikitype";
|
||||
|
||||
$raw = wordwrap(wikify($wikitype, $raw));
|
||||
|
||||
my $tmppath = "$path.tmp";
|
||||
open(FH, '>', $tmppath) or die("Can't open '$tmppath': $!\n");
|
||||
print FH "$raw\n\n";
|
||||
|
||||
if (! -f $path) { # Doesn't exist at all? Write out a template file.
|
||||
# If writing from scratch, it's always a Markdown file.
|
||||
die("Unexpected wikitype '$wikitype'!") if $wikitype ne 'md';
|
||||
print FH <<__EOF__
|
||||
|
||||
<!-- END CATEGORY DOCUMENTATION -->
|
||||
|
||||
## Functions
|
||||
|
||||
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
|
||||
<!-- BEGIN CATEGORY LIST: Category$cat, CategoryAPIFunction -->
|
||||
<!-- END CATEGORY LIST -->
|
||||
|
||||
## Datatypes
|
||||
|
||||
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
|
||||
<!-- BEGIN CATEGORY LIST: Category$cat, CategoryAPIDatatype -->
|
||||
<!-- END CATEGORY LIST -->
|
||||
|
||||
## Structs
|
||||
|
||||
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
|
||||
<!-- BEGIN CATEGORY LIST: Category$cat, CategoryAPIStruct -->
|
||||
<!-- END CATEGORY LIST -->
|
||||
|
||||
## Enums
|
||||
|
||||
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
|
||||
<!-- BEGIN CATEGORY LIST: Category$cat, CategoryAPIEnum -->
|
||||
<!-- END CATEGORY LIST -->
|
||||
|
||||
## Macros
|
||||
|
||||
<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
|
||||
<!-- BEGIN CATEGORY LIST: Category$cat, CategoryAPIMacro -->
|
||||
<!-- END CATEGORY LIST -->
|
||||
|
||||
----
|
||||
[CategoryAPICategory](CategoryAPICategory)
|
||||
|
||||
__EOF__
|
||||
;
|
||||
} else {
|
||||
my $endstr = $wikisyms{$sym}->{'[footer]'};
|
||||
if (defined($endstr)) {
|
||||
print FH $endstr;
|
||||
}
|
||||
}
|
||||
|
||||
close(FH);
|
||||
rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n");
|
||||
}
|
||||
|
||||
# Write out READMEs...
|
||||
if (defined $readmepath) {
|
||||
if ( -d $readmepath ) {
|
||||
mkdir($wikireadmepath); # just in case
|
||||
|
@ -2008,23 +2174,24 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n");
|
||||
my $majorver = 0;
|
||||
my $minorver = 0;
|
||||
my $patchver = 0;
|
||||
my $microver = 0;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
if (/$versionmajorregex/) {
|
||||
$majorver = int($1);
|
||||
} elsif (/$versionminorregex/) {
|
||||
$minorver = int($1);
|
||||
} elsif (/$versionpatchregex/) {
|
||||
$patchver = int($1);
|
||||
} elsif (/$versionmicroregex/) {
|
||||
$microver = int($1);
|
||||
}
|
||||
}
|
||||
close(FH);
|
||||
my $fullversion = "$majorver.$minorver.$patchver";
|
||||
my $fullversion = "$majorver.$minorver.$microver";
|
||||
|
||||
foreach (keys %headersyms) {
|
||||
my $sym = $_;
|
||||
next if not defined $wikisyms{$sym}; # don't have a page for that function, skip it.
|
||||
next if $sym =~ /\A\[category documentation\]/; # not real symbols
|
||||
my $symtype = $headersymstype{$sym};
|
||||
my $wikitype = $wikitypes{$sym};
|
||||
my $sectionsref = $wikisyms{$sym};
|
||||
|
@ -2290,19 +2457,19 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n");
|
||||
my $majorver = 0;
|
||||
my $minorver = 0;
|
||||
my $patchver = 0;
|
||||
my $microver = 0;
|
||||
while (<FH>) {
|
||||
chomp;
|
||||
if (/$versionmajorregex/) {
|
||||
$majorver = int($1);
|
||||
} elsif (/$versionminorregex/) {
|
||||
$minorver = int($1);
|
||||
} elsif (/$versionpatchregex/) {
|
||||
$patchver = int($1);
|
||||
} elsif (/$versionmicroregex/) {
|
||||
$microver = int($1);
|
||||
}
|
||||
}
|
||||
close(FH);
|
||||
my $fullversion = "$majorver.$minorver.$patchver";
|
||||
my $fullversion = "$majorver.$minorver.$microver";
|
||||
|
||||
my $latex_fname = "$srcpath/$projectshortname.tex";
|
||||
my $latex_tmpfname = "$latex_fname.tmp";
|
||||
|
@ -2341,7 +2508,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||
\\begin{document}
|
||||
\\frontmatter
|
||||
|
||||
\\title{$projectfullname $majorver.$minorver.$patchver Reference Manual}
|
||||
\\title{$projectfullname $majorver.$minorver.$microver Reference Manual}
|
||||
\\author{The $projectshortname Developers}
|
||||
\\maketitle
|
||||
|
||||
|
@ -2371,6 +2538,7 @@ __EOF__
|
|||
foreach (@headersymskeys) {
|
||||
my $sym = $_;
|
||||
next if not defined $wikisyms{$sym}; # don't have a page for that function, skip it.
|
||||
next if $sym =~ /\A\[category documentation\]/; # not real symbols.
|
||||
my $symtype = $headersymstype{$sym};
|
||||
my $wikitype = $wikitypes{$sym};
|
||||
my $sectionsref = $wikisyms{$sym};
|
||||
|
|
|
@ -114,9 +114,13 @@ cmake --build . --config Release
|
|||
|
||||
### Shared or static
|
||||
|
||||
By default, only a shared SDL library is built and installed.
|
||||
By default, only a dynamic (=shared) SDL library is built and installed.
|
||||
The options `-DSDL_SHARED=` and `-DSDL_STATIC=` accept boolean values to change this.
|
||||
|
||||
Exceptions exist:
|
||||
- some platforms don't support dynamic libraries, so only `-DSDL_STATIC=ON` makes sense.
|
||||
- a static Apple framework is not supported
|
||||
|
||||
### Pass custom compile options to the compiler
|
||||
|
||||
- Use [`CMAKE_<LANG>_FLAGS`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html) to pass extra
|
||||
|
@ -283,6 +287,25 @@ At the end of SDL CMake configuration, a table shows all CMake options along wit
|
|||
| `-DSDL_DISABLE_INSTALL_DOCS=` | `ON`/`OFF` | Don't install the SDL documentation |
|
||||
| `-DSDL_INSTALL_TESTS=` | `ON`/`OFF` | Install the SDL test programs |
|
||||
|
||||
## CMake FAQ
|
||||
|
||||
### How do I copy a SDL3 dynamic library to another location?
|
||||
|
||||
Use [CMake generator expressions](https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#target-dependent-expressions).
|
||||
Generator expressions support multiple configurations, and are evaluated during build system generation time.
|
||||
|
||||
On Windows, the following example this copies `SDL3.dll` to the directory where `mygame.exe` is built.
|
||||
On Unix systems, `$<TARGET_FILE:...>` will refer to the dynamic library (or framework).
|
||||
```cmake
|
||||
if(WIN32)
|
||||
add_custom_command(
|
||||
TARGET mygame POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:SDL3::SDL3-shared> $<TARGET_FILE_DIR:mygame>
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
```
|
||||
|
||||
## Help, it doesn't work!
|
||||
|
||||
Below, a SDL3 CMake project can be found that builds 99.9% of time (assuming you have internet connectivity).
|
||||
|
|
|
@ -0,0 +1,387 @@
|
|||
# Rules for documentation
|
||||
|
||||
These are the rules for the care and feeding of wikiheaders.pl.
|
||||
|
||||
|
||||
## No style guide
|
||||
|
||||
When adding or editing documentation, we don't (currently) have a style guide
|
||||
for what it should read like, so try to make it consistent with the rest of
|
||||
the existing text. It generally should read more like technical reference
|
||||
manuals and not sound conversational in tone.
|
||||
|
||||
Most of these rules are about how to make sure the documentation works on
|
||||
a _technical_ level, as scripts need to parse it, and there are a few simple
|
||||
rules we need to obey to cooperate with those scripts.
|
||||
|
||||
## The wiki and headers share the same text.
|
||||
|
||||
There is a massive Perl script (`build-scripts/wikiheaders.pl`, hereafter
|
||||
refered to as "wikiheaders") that can read both the wiki and the public
|
||||
headers, and move changes in one across to the other.
|
||||
|
||||
If you prefer to use the wiki, go ahead and edit there. If you prefer to use
|
||||
your own text editor, or command line tools to batch-process text, etc, you
|
||||
can [clone the wiki as a git repo](https://github.com/libsdl-org/sdlwiki) and
|
||||
work locally.
|
||||
|
||||
|
||||
## Don't taunt wikiheaders.
|
||||
|
||||
The script isn't magic; it's a massive pile of Regular Expressions and not
|
||||
a full C or markdown parser. While it isn't _fragile_, if you try to do clever
|
||||
things, you might confuse it. This is to the benefit of documentation, though,
|
||||
where we would rather you not do surprising things.
|
||||
|
||||
|
||||
## We _sort of_ write in Doxygen format.
|
||||
|
||||
To document a symbol, we use something that looks like Doxygen (and Javadoc)
|
||||
standard comment format:
|
||||
|
||||
```c
|
||||
/**
|
||||
* This is a function that does something.
|
||||
*
|
||||
* It can be used for frozzling bobbles. Be aware that the Frozulator module
|
||||
* _must_ be initialized before calling this.
|
||||
*
|
||||
* \param frozzlevel The amount of frozzling to perform.
|
||||
* \param color What color bobble to frozzle. 0 is red, 1 is green.
|
||||
* \returns the number of bobbles that were actually frozzled, -1 on error.
|
||||
*
|
||||
* \threadsafety Do not call this from two threads at once, or the bobbles
|
||||
* won't all frozzle correctly!
|
||||
*
|
||||
* \since This function is available since SDL 7.3.1.
|
||||
*
|
||||
* \sa SDL_DoSomethingElse
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_DoSomething(int frozzlevel, int color);
|
||||
```
|
||||
|
||||
Note the `/**` at the start of the comment. That's a "Doxygen-style" comment,
|
||||
and wikiheaders will treat this differently than a comment with one `*`, as
|
||||
this signifies that this is not just a comment, but _documentation_.
|
||||
|
||||
We do _not_ parse every magic Doxygen tag, and we don't parse them in `@param`
|
||||
format. The goal here was to mostly coexist with people that might want
|
||||
to run Doxygen on the SDL headers, not to build Doxygen from scratch. That
|
||||
being said, compatibility with Doxygen is not a hard requirement here.
|
||||
|
||||
wikiheaders uses these specific tags to turn this comment into a (hopefully)
|
||||
well-formatted wiki page, and also can generate manpages and books in LaTeX
|
||||
format from it!
|
||||
|
||||
Text markup in the headers is _always_ done in Markdown format! But less is
|
||||
more: try not to markup text more than necessary.
|
||||
|
||||
|
||||
## Doxygen tags we support:
|
||||
|
||||
- `\brief one-line description` (Not required, and wikiheaders will remove them).
|
||||
- `\param varname description` (One for each function/macro parameter)
|
||||
- `\returns description` (One for each function, don't use on `void` returns).
|
||||
- `\sa` (each of these get tucked into a "See Also" section on the wiki)
|
||||
- `\since This function is available since SDL 3.0.0.` (one per Doxygen comment)
|
||||
- `\threadsafety description` (one per function/macro).
|
||||
|
||||
Other Doxygen things might exist in the headers, but they aren't understood
|
||||
by wikiheaders.
|
||||
|
||||
|
||||
## Use Markdown.
|
||||
|
||||
The wiki also supports MediaWiki format, but we are transitioning away from it.
|
||||
The headers always use Markdown. If you're editing the wiki from a git clone,
|
||||
just make .md files and the wiki will know what to do with them.
|
||||
|
||||
|
||||
## Most things in the headers can be documented.
|
||||
|
||||
wikiheaders understands functions, typedefs, structs/unions/enums, `#defines`
|
||||
... basically most of what makes up a C header. Just slap a Doxygen-style
|
||||
comment in front of most things and it'll work.
|
||||
|
||||
|
||||
## Defines right below typedefs and functions bind.
|
||||
|
||||
Any `#define` directly below a function or non-struct/union/enum typedef is
|
||||
considered part of that declaration. This happens to work well with how our
|
||||
headers work, as these defines tend to be bitflags and such that are related
|
||||
to that symbol.
|
||||
|
||||
wikiheaders will include those defines in the syntax section of the wiki
|
||||
page, and generate stub pages for each define that simply says "please refer
|
||||
to (The Actual Symbol You Care About)" with a link. It will also pull in
|
||||
any blank lines and most preprocessor directives for the syntax text, too.
|
||||
|
||||
Sometimes an unrelated define, by itself, just happens to be right below one
|
||||
of these symbols in the header. The easiest way to deal with this is either
|
||||
to document that define with a Doxygen-style comment, if it makes sense to do
|
||||
so, or just add a normal C comment right above it if not, so wikiheaders
|
||||
doesn't bind it to the previous symbol.
|
||||
|
||||
|
||||
## Don't document the `SDL_test*.h` headers.
|
||||
|
||||
These are in the public headers but they aren't really considered public APIs.
|
||||
They live in a separate library that doesn't, or at least probably shouldn't,
|
||||
ship to end users. As such, we don't want it documented on the wiki.
|
||||
|
||||
For now, we do this by not having any Doxygen-style comments in these files.
|
||||
Please keep it that way! If you want to document these headers, just don't
|
||||
use the magic two-`*` comment.
|
||||
|
||||
|
||||
## The first line is the summary.
|
||||
|
||||
The first line of a piece of documentation is meant to be a succinct
|
||||
description. This is what Doxygen would call the `\brief` tag. wikiheaders
|
||||
will split this text out until the first period (end of sentence!), and when
|
||||
word wrapping, shuffle the overflow into a new paragraph below it.
|
||||
|
||||
|
||||
## Split paragraphs with a blank line.
|
||||
|
||||
And don't indent them at all (indenting in Markdown is treated as preformatted
|
||||
text).
|
||||
|
||||
wikiheaders will wordwrap header comments so they fit in 80 columns, so if you
|
||||
don't leave a blank line between paragraphs, they will smush into a single
|
||||
block of text when wordwrapping.
|
||||
|
||||
|
||||
## Don't worry about word wrapping.
|
||||
|
||||
If you don't word-wrap your header edits perfectly (and you won't, I promise),
|
||||
wikiheaders will send your change to the wiki, and then to make things match,
|
||||
send it right back to the headers with correct word wrapping. Since this
|
||||
happens right after you push your changes, you might as well just write
|
||||
however you like and assume the system will clean it up for you.
|
||||
|
||||
|
||||
## Things that start with `SDL_` will automatically become wiki links.
|
||||
|
||||
wikiheaders knows to turn these into links to other pages, so if you reference
|
||||
an SDL symbol in the header documentation, you don't need to link to it.
|
||||
You can optionally wrap the symbol in backticks, and wikiheaders will know to
|
||||
link the backticked thing. It will not generate links in three-backtick
|
||||
code/preformatted blocks.
|
||||
|
||||
|
||||
## URLs will automatically become links.
|
||||
|
||||
You can use Markdown's `[link markup format](https://example.com/)`, but
|
||||
sometimes it's clearer to list bare URLs; the URL will be visible on the
|
||||
wiki page, but also clickable to follow the link. This is up to your judgement
|
||||
on a case-by-case basis.
|
||||
|
||||
|
||||
## Hide stuff from wikiheaders.
|
||||
|
||||
If all else fails, you can block off pieces of the header with this
|
||||
magic line (whitespace is ignored):
|
||||
|
||||
```c
|
||||
#ifndef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
```
|
||||
|
||||
Everything between this line and the next `#endif` will just be skipped by
|
||||
wikiheaders. Note that wikiheaders is not a C preprocessor! Don't try to
|
||||
nest conditionals or use `!defined`.
|
||||
|
||||
Just block off sections if you need to. And: you almost never need to.
|
||||
|
||||
|
||||
## Hide stuff from the compiler.
|
||||
|
||||
If you need to put something that's only of interest to wikiheaders, the
|
||||
convention is to put it in a block like this:
|
||||
|
||||
```c
|
||||
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
```
|
||||
|
||||
Generally this is used when there's a collection of preprocessor conditionals
|
||||
to define the same symbol differently in different circumstances. You put
|
||||
that symbol in this block with some reasonable generic version _and the
|
||||
Doxygen-style comment_. Because wikiheaders doesn't care about this
|
||||
preprocessor magic, and the C compiler can be as fancy as it wants, this is
|
||||
strictly a useful convention.
|
||||
|
||||
|
||||
## Struct/union/enum typedefs must have the name on the first line.
|
||||
|
||||
This is because wikiheaders is not a full C parser. Don't write this:
|
||||
|
||||
```c
|
||||
typedef struct
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
} SDL_MyStruct;
|
||||
```
|
||||
|
||||
...make sure the name is at the start, too:
|
||||
|
||||
```c
|
||||
typedef struct SDL_MyStruct
|
||||
{
|
||||
int a;
|
||||
int b;
|
||||
} SDL_MyStruct;
|
||||
```
|
||||
|
||||
wikiheaders will complain loudly if you don't do this, and exit with an
|
||||
error message.
|
||||
|
||||
|
||||
## Code examples go in the wiki.
|
||||
|
||||
We don't want the headers cluttered up with code examples. These live on the
|
||||
wiki pages, and wikiheaders knows to not bridge them back to the headers.
|
||||
|
||||
Put them in a `## Code Examples` section, and make sure to wrap them in a
|
||||
three-backtick-c section for formatting purposes. Only write code in C,
|
||||
please.
|
||||
|
||||
|
||||
## Do you _need_ a code example?
|
||||
|
||||
Most code examples aren't actually useful. If your code example is just
|
||||
`SDL_CreateWindow("Hello SDL", 640, 480, 0);` then just delete it; if all
|
||||
you're showing is how to call a function in C, it's not a useful code example.
|
||||
Not all functions need an example. One with complex setup or usage details
|
||||
might, though!
|
||||
|
||||
|
||||
## Code examples are compiled by GitHub Actions.
|
||||
|
||||
On each change to the wiki, there is a script that pulls out all the code
|
||||
examples into discrete C files and attempts to compile them, and complains
|
||||
if they don't work.
|
||||
|
||||
|
||||
## Unrecognized sections are left alone in the wiki.
|
||||
|
||||
A wiki section that starts with `## Section Name` (or `== Section Name ==` in
|
||||
MediaWiki format) that isn't one of the recognized names will be left alone
|
||||
by wikiheaders. Recognized sections might get overwritten with new content
|
||||
from the headers, but the wiki file will not have other sections cleaned out
|
||||
(this is how Code Examples remain wiki only, for example). You can use this
|
||||
to add Wiki-specific text, or stuff that doesn't make sense in a header, or
|
||||
would merely clutter it up.
|
||||
|
||||
A possibly-incomplete list of sections that will be overwritten by changes
|
||||
to the headers:
|
||||
|
||||
- The page title line, and the "brief" one-sentence description section.
|
||||
- "Deprecated"
|
||||
- "Header File"
|
||||
- "Syntax"
|
||||
- "Function Parameters"
|
||||
- "Macro Parameters"
|
||||
- "Fields"
|
||||
- "Values"
|
||||
- "Return Value"
|
||||
- "Remarks"
|
||||
- "Thread Safety"
|
||||
- "Version"
|
||||
- "See Also"
|
||||
|
||||
|
||||
## It's okay to repeat yourself.
|
||||
|
||||
Each individual piece of documentation becomes a separate page on the wiki, so
|
||||
small repeated details can just exist in different pieces of documentation. If
|
||||
it's complicated, it's not unreasonable to say "Please refer to
|
||||
SDL_SomeOtherFunction for more details" ... wiki users can click right
|
||||
through, header users can search for the function name.
|
||||
|
||||
|
||||
## The docs directory is bridged to the wiki, too.
|
||||
|
||||
You might be reading this document on the wiki! Any `README-*.md` files in
|
||||
the docs directory are bridged to the wiki, so `docs/README-linux.md` lands
|
||||
at https://wiki.libsdl.org/SDL3/README/linux ...these are just copied directly
|
||||
without any further processing by wikiheaders, and changes go in both
|
||||
directions.
|
||||
|
||||
|
||||
## Wiki categories are (mostly) managed automatically.
|
||||
|
||||
The wiki will see this pattern as the last thing on a page and treat it as a
|
||||
list of categories that page belongs to:
|
||||
|
||||
```
|
||||
----
|
||||
[CategoryStuff](CategoryStuff), [CategoryWhatever](CategoryWhatever)
|
||||
```
|
||||
|
||||
You can use this to simply tag a page as part of a category, and the user can
|
||||
click directly to see other pages in that category. The wiki will
|
||||
automatically manage a `Category*` pages that list any tagged pages.
|
||||
|
||||
You _should not_ add tags to the public headers. They don't mean anything
|
||||
there. wikiheaders will add a few tags that make sense when generating wiki
|
||||
content from the header files, and it will preserve other tags already present
|
||||
on the page, so if you want to add extra categories to something, tag it on
|
||||
the wiki itself.
|
||||
|
||||
The wiki uses some magic HTML comment tags to decide how to list items on
|
||||
Category pages and let other content live on the page as well. You can
|
||||
see an example of this in action at:
|
||||
|
||||
https://raw.githubusercontent.com/libsdl-org/sdlwiki/main/SDL3/CategoryEvents.md
|
||||
|
||||
|
||||
## Categorizing the headers.
|
||||
|
||||
To put a symbol in a specific category, we use three approaches in SDL:
|
||||
|
||||
- Things in the `SDL_test*.h` headers aren't categorized at all (and you
|
||||
shouldn't document them!)
|
||||
- Most files are categorized by header name: we strip off the leading `SDL_`
|
||||
and capitalize the first letter of what's left. So everything in SDL_audio.h
|
||||
is in the "Audio" category, everything in SDL_video.h is in the "Video"
|
||||
category, etc.
|
||||
- If wikiheaders sees a comment like this on a line by itself...
|
||||
```c
|
||||
/* WIKI CATEGORY: Blah */
|
||||
```
|
||||
...then all symbols below that will land in the "Blah" category. We use this
|
||||
at the top of a few headers where the simple
|
||||
chop-off-SDL_-and-captialize-the-first-letter trick doesn't work well, but
|
||||
one could theoretically use this for headers that have some overlap in
|
||||
category.
|
||||
|
||||
|
||||
## Category documentation lives in headers.
|
||||
|
||||
To document a category (text that lives before the item lists on a wiki
|
||||
category page), you have to follow a simple rule:
|
||||
|
||||
The _first_ Doxygen-style comment in a header must start with:
|
||||
|
||||
```
|
||||
/**
|
||||
* # CategoryABC
|
||||
```
|
||||
|
||||
If these conditions aren't met, wikiheaders will assume that documentation
|
||||
belongs to whatever is below it instead of the Category.
|
||||
|
||||
The text of this comment will be added to the appropriate wiki Category page,
|
||||
at the top, replacing everything in the file until it sees a line that starts
|
||||
with an HTML comment (`<!--`), or a line that starts with `----`. Everything
|
||||
after that in the wiki file will be preserved.
|
||||
|
||||
Likewise, when bridging _back_ to the headers, if wikiheaders sees one of
|
||||
these comments, it'll copy the top section of the Category page back into the
|
||||
comment.
|
||||
|
||||
Beyond stripping the initial ` * ` portion off each line, these comments are
|
||||
treated as pure Markdown. They don't support any Doxygen tags like `\sa` or
|
||||
`\since`.
|
||||
|
|
@ -25,19 +25,19 @@ rename_macros.py source_code_path
|
|||
|
||||
|
||||
CMake users should use this snippet to include SDL support in their project:
|
||||
```
|
||||
```cmake
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3)
|
||||
```
|
||||
|
||||
Autotools users should use this snippet to include SDL support in their project:
|
||||
```
|
||||
```m4
|
||||
PKG_CHECK_MODULES([SDL3], [sdl3])
|
||||
```
|
||||
and then add $SDL3_CFLAGS to their project CFLAGS and $SDL3_LIBS to their project LDFLAGS
|
||||
and then add `$SDL3_CFLAGS` to their project `CFLAGS` and `$SDL3_LIBS` to their project `LDFLAGS`.
|
||||
|
||||
Makefile users can use this snippet to include SDL support in their project:
|
||||
```
|
||||
```make
|
||||
CFLAGS += $(shell pkg-config sdl3 --cflags)
|
||||
LDFLAGS += $(shell pkg-config sdl3 --libs)
|
||||
```
|
||||
|
@ -48,6 +48,8 @@ The SDLmain library has been removed, it's been entirely replaced by SDL_main.h.
|
|||
|
||||
The vi format comments have been removed from source code. Vim users can use the [editorconfig plugin](https://github.com/editorconfig/editorconfig-vim) to automatically set tab spacing for the SDL coding style.
|
||||
|
||||
Installed SDL CMake configuration files no longer define `SDL3_PREFIX`, `SDL3_EXEC_PREFIX`, `SDL3_INCLUDE_DIR`, `SDL3_INCLUDE_DIRS`, `SDL3_BINDIR` or `SDL3_LIBDIR`. Users are expected to use [CMake generator expressions](https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#target-dependent-expressions) with `SDL3::SDL3`, `SDL3::SDL3-shared`, `SDL3::SDL3-static` or `SDL3::Headers`. By no longer defining these CMake variables, using a system SDL3 or using a vendoring SDL3 behave in the same way.
|
||||
|
||||
## SDL_atomic.h
|
||||
|
||||
The following structures have been renamed:
|
||||
|
@ -183,7 +185,7 @@ SDL_GetAudioDeviceSpec() is removed; use SDL_GetAudioDeviceFormat() instead.
|
|||
|
||||
SDL_GetDefaultAudioInfo() is removed; SDL_GetAudioDeviceFormat() with SDL_AUDIO_DEVICE_DEFAULT_OUTPUT or SDL_AUDIO_DEVICE_DEFAULT_CAPTURE. There is no replacement for querying the default device name; the string is no longer used to open devices, and SDL3 will migrate between physical devices on the fly if the system default changes, so if you must show this to the user, a generic name like "System default" is recommended.
|
||||
|
||||
SDL_MixAudio() has been removed, as it relied on legacy SDL 1.2 quirks; SDL_MixAudioFormat() remains and offers the same functionality.
|
||||
SDL_MixAudioFormat() and SDL_MIX_MAXVOLUME have been removed in favour of SDL_MixAudio(), which now takes the audio format, and a float volume between 0.0 and 1.0.
|
||||
|
||||
SDL_FreeWAV has been removed and calls can be replaced with SDL_free.
|
||||
|
||||
|
@ -252,6 +254,7 @@ The following functions have been renamed:
|
|||
* SDL_AudioStreamPut() => SDL_PutAudioStreamData()
|
||||
* SDL_FreeAudioStream() => SDL_DestroyAudioStream()
|
||||
* SDL_LoadWAV_RW() => SDL_LoadWAV_IO()
|
||||
* SDL_MixAudioFormat() => SDL_MixAudio()
|
||||
* SDL_NewAudioStream() => SDL_CreateAudioStream()
|
||||
|
||||
|
||||
|
@ -292,6 +295,9 @@ The following symbols have been renamed:
|
|||
* AUDIO_S8 => SDL_AUDIO_S8
|
||||
* AUDIO_U8 => SDL_AUDIO_U8
|
||||
|
||||
The following symbols have been removed:
|
||||
* SDL_MIX_MAXVOLUME - mixer volume is now a float between 0.0 and 1.0
|
||||
|
||||
## SDL_cpuinfo.h
|
||||
|
||||
The intrinsics headers (mmintrin.h, etc.) have been moved to `<SDL3/SDL_intrin.h>` and are no longer automatically included in SDL.h.
|
||||
|
@ -300,7 +306,10 @@ SDL_Has3DNow() has been removed; there is no replacement.
|
|||
|
||||
SDL_HasRDTSC() has been removed; there is no replacement. Don't use the RDTSC opcode in modern times, use SDL_GetPerformanceCounter and SDL_GetPerformanceFrequency instead.
|
||||
|
||||
SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() have been removed. You can use SDL_aligned_alloc() and SDL_aligned_free() with SDL_SIMDGetAlignment() to get the same functionality.
|
||||
SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() have been removed. You can use SDL_aligned_alloc() and SDL_aligned_free() with SDL_GetSIMDAlignment() to get the same functionality.
|
||||
|
||||
The following functions have been renamed:
|
||||
* SDL_SIMDGetAlignment() => SDL_GetSIMDAlignment()
|
||||
|
||||
## SDL_error.h
|
||||
|
||||
|
@ -720,12 +729,13 @@ The following hints have been removed:
|
|||
* SDL_HINT_IDLE_TIMER_DISABLED - use SDL_DisableScreenSaver() instead
|
||||
* SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text
|
||||
* SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer
|
||||
* SDL_HINT_PS2_DYNAMIC_VSYNC - use SDL_SetRendererVSync(renderer, -1) instead
|
||||
* SDL_HINT_RENDER_BATCHING - Render batching is always enabled, apps should call SDL_FlushRenderer() before calling into a lower-level graphics API.
|
||||
* SDL_HINT_RENDER_LOGICAL_SIZE_MODE - the logical size mode is explicitly set with SDL_SetRenderLogicalPresentation()
|
||||
* SDL_HINT_RENDER_OPENGL_SHADERS - shaders are always used if they are available
|
||||
* SDL_HINT_RENDER_SCALE_QUALITY - textures now default to linear filtering, use SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST) if you want nearest pixel mode instead
|
||||
* SDL_HINT_VIDEO_EXTERNAL_CONTEXT - replaced with SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN in SDL_CreateWindowWithProperties()
|
||||
* SDL_HINT_THREAD_STACK_SIZE - the stack size can be specified using SDL_CreateThreadWithStackSize()
|
||||
* SDL_HINT_VIDEO_EXTERNAL_CONTEXT - replaced with SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN in SDL_CreateWindowWithProperties()
|
||||
* SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL - replaced with SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN in SDL_CreateWindowWithProperties()
|
||||
* SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN - replaced with SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN in SDL_CreateWindowWithProperties()
|
||||
* SDL_HINT_VIDEO_HIGHDPI_DISABLED - high DPI support is always enabled
|
||||
|
@ -750,7 +760,6 @@ The following hints have been renamed:
|
|||
* SDL_HINT_LINUX_HAT_DEADZONES => SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
|
||||
* SDL_HINT_LINUX_JOYSTICK_CLASSIC => SDL_HINT_JOYSTICK_LINUX_CLASSIC
|
||||
* SDL_HINT_LINUX_JOYSTICK_DEADZONES => SDL_HINT_JOYSTICK_LINUX_DEADZONES
|
||||
* SDL_HINT_PS2_DYNAMIC_VSYNC => SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC
|
||||
|
||||
The following functions have been removed:
|
||||
* SDL_ClearHints() - replaced with SDL_ResetHints()
|
||||
|
@ -901,6 +910,9 @@ The following symbols have been renamed:
|
|||
* KMOD_RSHIFT => SDL_KMOD_RSHIFT
|
||||
* KMOD_SCROLL => SDL_KMOD_SCROLL
|
||||
* KMOD_SHIFT => SDL_KMOD_SHIFT
|
||||
* SDLK_BACKQUOTE => SDLK_GRAVE
|
||||
* SDLK_QUOTE => SDLK_APOSTROPHE
|
||||
* SDLK_QUOTEDBL => SDLK_DBLAPOSTROPHE
|
||||
|
||||
## SDL_loadso.h
|
||||
|
||||
|
@ -913,7 +925,11 @@ The following macros have been removed:
|
|||
|
||||
The following functions have been renamed:
|
||||
* SDL_LogGetOutputFunction() => SDL_GetLogOutputFunction()
|
||||
* SDL_LogGetPriority() => SDL_GetLogPriority()
|
||||
* SDL_LogResetPriorities() => SDL_ResetLogPriorities()
|
||||
* SDL_LogSetAllPriority() => SDL_SetLogPriorities()
|
||||
* SDL_LogSetOutputFunction() => SDL_SetLogOutputFunction()
|
||||
* SDL_LogSetPriority() => SDL_SetLogPriority()
|
||||
|
||||
## SDL_main.h
|
||||
|
||||
|
@ -1088,12 +1104,14 @@ was used to figure out the index of a driver, so one would call it in a for-loop
|
|||
for the driver named "opengl" or whatnot. SDL_GetRenderDriver() has been added for this
|
||||
functionality, which returns only the name of the driver.
|
||||
|
||||
Additionally, SDL_CreateRenderer()'s second argument is no longer an integer index, but a
|
||||
SDL_CreateRenderer()'s second argument is no longer an integer index, but a
|
||||
`const char *` representing a renderer's name; if you were just using a for-loop to find
|
||||
which index is the "opengl" or whatnot driver, you can just pass that string directly
|
||||
here, now. Passing NULL is the same as passing -1 here in SDL2, to signify you want SDL
|
||||
to decide for you.
|
||||
|
||||
SDL_CreateRenderer()'s flags parameter has been removed. See specific flags below for how to achieve the same functionality in SDL 3.0.
|
||||
|
||||
SDL_CreateWindowAndRenderer() now takes the window title as the first parameter.
|
||||
|
||||
Mouse and touch events are no longer filtered to change their coordinates, instead you
|
||||
|
@ -1165,6 +1183,7 @@ The following symbols have been renamed:
|
|||
|
||||
The following symbols have been removed:
|
||||
* SDL_RENDERER_ACCELERATED - all renderers except `SDL_SOFTWARE_RENDERER` are accelerated
|
||||
* SDL_RENDERER_PRESENTVSYNC - replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during renderer creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation
|
||||
* SDL_RENDERER_SOFTWARE - you can check whether the name of the renderer is `SDL_SOFTWARE_RENDERER`
|
||||
* SDL_RENDERER_TARGETTEXTURE - all renderers support target texture functionality
|
||||
|
||||
|
@ -1504,6 +1523,9 @@ The following functions have been renamed:
|
|||
* SDL_UpperBlit() => SDL_BlitSurface()
|
||||
* SDL_UpperBlitScaled() => SDL_BlitSurfaceScaled()
|
||||
|
||||
The following symbols have been removed:
|
||||
* SDL_SWSURFACE
|
||||
|
||||
The following functions have been removed:
|
||||
* SDL_GetYUVConversionMode()
|
||||
* SDL_GetYUVConversionModeForResolution()
|
||||
|
@ -1663,9 +1685,14 @@ The following functions have been removed:
|
|||
|
||||
SDL_GetRevisionNumber() has been removed from the API, it always returned 0 in SDL 2.0.
|
||||
|
||||
SDL_GetVersion() returns the version number, which can be directly compared with another version wrapped with SDL_VERSIONNUM().
|
||||
|
||||
The following structures have been renamed:
|
||||
* SDL_version => SDL_Version
|
||||
The following structures have been removed:
|
||||
* SDL_version
|
||||
|
||||
The following symbols have been renamed:
|
||||
* SDL_COMPILEDVERSION => SDL_VERSION
|
||||
* SDL_PATCHLEVEL => SDL_MICRO_VERSION
|
||||
|
||||
## SDL_video.h
|
||||
|
||||
|
|
|
@ -16,10 +16,6 @@ cmake --build build
|
|||
cmake --install build
|
||||
```
|
||||
|
||||
## Hints
|
||||
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC`.
|
||||
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of dropping FPS to 30.
|
||||
|
||||
## Notes
|
||||
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the connection with your computer.
|
||||
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
|
||||
|
|
|
@ -88,7 +88,7 @@ Here's a sample SDL snippet to verify everything is setup in your IDE:
|
|||
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
window = SDL_CreateWindow("Hello SDL", WIDTH, HEIGHT, 0);
|
||||
renderer = SDL_CreateRenderer(window, NULL, SDL_RENDERER_PRESENTVSYNC);
|
||||
renderer = SDL_CreateRenderer(window, NULL);
|
||||
|
||||
SDL_DestroyRenderer(renderer);
|
||||
SDL_DestroyWindow(window);
|
||||
|
|
|
@ -186,7 +186,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
/* Create a renderer */
|
||||
sdlRenderer = SDL_CreateRenderer(sdlWindow, NULL, 0);
|
||||
sdlRenderer = SDL_CreateRenderer(sdlWindow, NULL);
|
||||
if (!sdlRenderer) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
@ -88,9 +88,9 @@ Here is a rough list of what works, and what doesn't:
|
|||
UWP itself).
|
||||
* turning off VSync when rendering on Windows Phone. Attempts to turn VSync
|
||||
off on Windows Phone result either in Direct3D not drawing anything, or it
|
||||
forcing VSync back on. As such, SDL_RENDERER_PRESENTVSYNC will always get
|
||||
turned-on on Windows Phone. This limitation is not present in non-Phone
|
||||
WinRT (such as Windows 8.x), where turning off VSync appears to work.
|
||||
forcing VSync back on. As such, vsync will always get turned-on on Windows
|
||||
Phone. This limitation is not present in non-Phone WinRT (such as Windows 8.x),
|
||||
where turning off VSync appears to work.
|
||||
* probably anything else that's not listed as supported
|
||||
|
||||
|
||||
|
|
|
@ -1297,7 +1297,7 @@ INCLUDE_FILE_PATTERNS =
|
|||
# instead of the = operator.
|
||||
|
||||
PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \
|
||||
DECLSPEC= \
|
||||
SDL_DECLSPEC= \
|
||||
SDLCALL= \
|
||||
_WIN32=1
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
/**
|
||||
* \file SDL.h
|
||||
*
|
||||
* Main include header for the SDL library
|
||||
* Main include header for the SDL library, version 3.1.2
|
||||
*/
|
||||
|
||||
#ifndef SDL_h_
|
||||
|
@ -43,6 +43,7 @@
|
|||
#include <SDL3/SDL_events.h>
|
||||
#include <SDL3/SDL_filesystem.h>
|
||||
#include <SDL3/SDL_gamepad.h>
|
||||
#include <SDL3/SDL_gpu.h>
|
||||
#include <SDL3/SDL_guid.h>
|
||||
#include <SDL3/SDL_haptic.h>
|
||||
#include <SDL3/SDL_hidapi.h>
|
||||
|
|
|
@ -20,9 +20,40 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_assert.h
|
||||
* # CategoryAssert
|
||||
*
|
||||
* Header file for assertion SDL API functions
|
||||
* A helpful assertion macro!
|
||||
*
|
||||
* SDL assertions operate like your usual `assert` macro, but with some added
|
||||
* features:
|
||||
*
|
||||
* - It uses a trick with the `sizeof` operator, so disabled assertions
|
||||
* vaporize out of the compiled code, but variables only referenced in the
|
||||
* assertion won't trigger compiler warnings about being unused.
|
||||
* - It is safe to use with a dangling-else: `if (x) SDL_assert(y); else
|
||||
* do_something();`
|
||||
* - It works the same everywhere, instead of counting on various platforms'
|
||||
* compiler and C runtime to behave.
|
||||
* - It provides multiple levels of assertion (SDL_assert, SDL_assert_release,
|
||||
* SDL_assert_paranoid) instead of a single all-or-nothing option.
|
||||
* - It offers a variety of responses when an assertion fails (retry, trigger
|
||||
* the debugger, abort the program, ignore the failure once, ignore it for
|
||||
* the rest of the program's run).
|
||||
* - It tries to show the user a dialog by default, if possible, but the app
|
||||
* can provide a callback to handle assertion failures however they like.
|
||||
* - It lets failed assertions be retried. Perhaps you had a network failure
|
||||
* and just want to retry the test after plugging your network cable back
|
||||
* in? You can.
|
||||
* - It lets the user ignore an assertion failure, if there's a harmless
|
||||
* problem that one can continue past.
|
||||
* - It lets the user mark an assertion as ignored for the rest of the
|
||||
* program's run; if there's a harmless problem that keeps popping up.
|
||||
* - It provides statistics and data on all failed assertions to the app.
|
||||
* - It allows the default assertion handler to be controlled with environment
|
||||
* variables, in case an automated script needs to control it.
|
||||
*
|
||||
* To use it: do a debug build and just sprinkle around tests to check your
|
||||
* code!
|
||||
*/
|
||||
|
||||
#ifndef SDL_assert_h_
|
||||
|
@ -209,7 +240,7 @@ typedef struct SDL_AssertData
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
|
||||
extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
|
||||
const char *func,
|
||||
const char *file, int line)
|
||||
#ifdef __clang__
|
||||
|
@ -433,7 +464,7 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
|
|||
*
|
||||
* \sa SDL_GetAssertionHandler
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
||||
SDL_AssertionHandler handler,
|
||||
void *userdata);
|
||||
|
||||
|
@ -452,7 +483,7 @@ extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
|
|||
*
|
||||
* \sa SDL_GetAssertionHandler
|
||||
*/
|
||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
|
||||
extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
|
||||
|
||||
/**
|
||||
* Get the current assertion handler.
|
||||
|
@ -475,7 +506,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void
|
|||
*
|
||||
* \sa SDL_SetAssertionHandler
|
||||
*/
|
||||
extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
|
||||
extern SDL_DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
|
||||
|
||||
/**
|
||||
* Get a list of all assertion failures.
|
||||
|
@ -503,7 +534,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puse
|
|||
*
|
||||
* \sa SDL_ResetAssertionReport
|
||||
*/
|
||||
extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
||||
extern SDL_DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
||||
|
||||
/**
|
||||
* Clear the list of all assertion failures.
|
||||
|
@ -517,7 +548,7 @@ extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
|
|||
*
|
||||
* \sa SDL_GetAssertionReport
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,31 +20,29 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_atomic.h
|
||||
* # CategoryAtomic
|
||||
*
|
||||
* Atomic operations.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* If you are not an expert in concurrent lockless programming, you should
|
||||
* not be using any functions in this file. You should be protecting your
|
||||
* data structures with full mutexes instead.
|
||||
* IMPORTANT: If you are not an expert in concurrent lockless programming, you
|
||||
* should not be using any functions in this file. You should be protecting
|
||||
* your data structures with full mutexes instead.
|
||||
*
|
||||
* Seriously, here be dragons!
|
||||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
* ***Seriously, here be dragons!***
|
||||
*
|
||||
* You can find out a little more about lockless programming and the
|
||||
* subtle issues that can arise here:
|
||||
* You can find out a little more about lockless programming and the subtle
|
||||
* issues that can arise here:
|
||||
* https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming
|
||||
*
|
||||
* There's also lots of good information here:
|
||||
* http://www.1024cores.net/home/lock-free-algorithms
|
||||
* http://preshing.com/
|
||||
*
|
||||
* These operations may or may not actually be implemented using
|
||||
* processor specific atomic operations. When possible they are
|
||||
* implemented as true processor specific atomic operations. When that
|
||||
* is not possible the are implemented using locks that *do* use the
|
||||
* available atomic operations.
|
||||
* - https://www.1024cores.net/home/lock-free-algorithms
|
||||
* - https://preshing.com/
|
||||
*
|
||||
* These operations may or may not actually be implemented using processor
|
||||
* specific atomic operations. When possible they are implemented as true
|
||||
* processor specific atomic operations. When that is not possible the are
|
||||
* implemented using locks that *do* use the available atomic operations.
|
||||
*
|
||||
* All of the atomic operations that modify memory are full memory barriers.
|
||||
*/
|
||||
|
@ -98,7 +96,7 @@ typedef int SDL_SpinLock;
|
|||
* \sa SDL_LockSpinlock
|
||||
* \sa SDL_UnlockSpinlock
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Lock a spin lock by setting it to a non-zero value.
|
||||
|
@ -113,7 +111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
|||
* \sa SDL_TryLockSpinlock
|
||||
* \sa SDL_UnlockSpinlock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Unlock a spin lock by setting it to 0.
|
||||
|
@ -130,7 +128,7 @@ extern DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
|
|||
* \sa SDL_LockSpinlock
|
||||
* \sa SDL_TryLockSpinlock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
|
||||
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
|
||||
|
@ -194,7 +192,7 @@ extern __inline void SDL_CompilerBarrier(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
||||
|
||||
/**
|
||||
* Insert a memory acquire barrier.
|
||||
|
@ -209,7 +207,7 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
|
|||
*
|
||||
* \sa SDL_MemoryBarrierReleaseFunction
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
||||
|
||||
/* !!! FIXME: this should have documentation! */
|
||||
#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
|
||||
|
@ -344,7 +342,7 @@ typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
|
|||
*
|
||||
* \sa SDL_AtomicCompareAndSwapPointer
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int oldval, int newval);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int oldval, int newval);
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a value.
|
||||
|
@ -362,7 +360,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int
|
|||
*
|
||||
* \sa SDL_AtomicGet
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);
|
||||
|
||||
/**
|
||||
* Get the value of an atomic variable.
|
||||
|
@ -377,7 +375,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_AtomicInt *a, int v);
|
|||
*
|
||||
* \sa SDL_AtomicSet
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
|
||||
|
||||
/**
|
||||
* Add to an atomic variable.
|
||||
|
@ -396,7 +394,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_AtomicInt *a);
|
|||
* \sa SDL_AtomicDecRef
|
||||
* \sa SDL_AtomicIncRef
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
|
||||
|
||||
#ifndef SDL_AtomicIncRef
|
||||
|
||||
|
@ -450,7 +448,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
|
|||
* \sa SDL_AtomicGetPtr
|
||||
* \sa SDL_AtomicSetPtr
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval);
|
||||
|
||||
/**
|
||||
* Set a pointer to a value atomically.
|
||||
|
@ -467,7 +465,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void
|
|||
* \sa SDL_AtomicCompareAndSwapPointer
|
||||
* \sa SDL_AtomicGetPtr
|
||||
*/
|
||||
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
extern SDL_DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
|
||||
/**
|
||||
* Get the value of a pointer atomically.
|
||||
|
@ -483,7 +481,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
|||
* \sa SDL_AtomicCompareAndSwapPointer
|
||||
* \sa SDL_AtomicSetPtr
|
||||
*/
|
||||
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
||||
extern SDL_DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,11 +20,43 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_audio.h
|
||||
* # CategoryAudio
|
||||
*
|
||||
* Audio functionality for the SDL library.
|
||||
* Audio functionality for the SDL library.
|
||||
*
|
||||
* All audio in SDL3 revolves around SDL_AudioStream. Whether you want to play
|
||||
* or record audio, convert it, stream it, buffer it, or mix it, you're going
|
||||
* to be passing it through an audio stream.
|
||||
*
|
||||
* Audio streams are quite flexible; they can accept any amount of data at a
|
||||
* time, in any supported format, and output it as needed in any other format,
|
||||
* even if the data format changes on either side halfway through.
|
||||
*
|
||||
* An app opens an audio device and binds any number of audio streams to it,
|
||||
* feeding more data to it as available. When the devices needs more data, it
|
||||
* will pull it from all bound streams and mix them together for playback.
|
||||
*
|
||||
* Audio streams can also use an app-provided callback to supply data
|
||||
* on-demand, which maps pretty closely to the SDL2 audio model.
|
||||
*
|
||||
* SDL also provides a simple .WAV loader in SDL_LoadWAV (and SDL_LoadWAV_IO
|
||||
* if you aren't reading from a file) as a basic means to load sound data into
|
||||
* your program.
|
||||
*
|
||||
* For multi-channel audio, the default SDL channel mapping is:
|
||||
*
|
||||
* ```
|
||||
* 2: FL FR (stereo)
|
||||
* 3: FL FR LFE (2.1 surround)
|
||||
* 4: FL FR BL BR (quad)
|
||||
* 5: FL FR LFE BL BR (4.1 surround)
|
||||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
||||
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
||||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
||||
* ```
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_audio_h_
|
||||
#define SDL_audio_h_
|
||||
|
||||
|
@ -42,17 +74,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For multi-channel audio, the default SDL channel mapping is:
|
||||
* 2: FL FR (stereo)
|
||||
* 3: FL FR LFE (2.1 surround)
|
||||
* 4: FL FR BL BR (quad)
|
||||
* 5: FL FR LFE BL BR (4.1 surround)
|
||||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
||||
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
||||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Audio format flags.
|
||||
*
|
||||
|
@ -343,7 +364,7 @@ typedef struct SDL_AudioStream SDL_AudioStream;
|
|||
*
|
||||
* \sa SDL_GetAudioDriver
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
|
||||
/**
|
||||
* Use this function to get the name of a built in audio driver.
|
||||
|
@ -367,7 +388,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
|||
*
|
||||
* \sa SDL_GetNumAudioDrivers
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
|
@ -386,7 +407,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently-connected audio output devices.
|
||||
|
@ -411,7 +432,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
|
|||
* \sa SDL_OpenAudioDevice
|
||||
* \sa SDL_GetAudioCaptureDevices
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioOutputDevices(int *count);
|
||||
extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioOutputDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get a list of currently-connected audio capture devices.
|
||||
|
@ -436,7 +457,7 @@ extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioOutputDevices(int *count)
|
|||
* \sa SDL_OpenAudioDevice
|
||||
* \sa SDL_GetAudioOutputDevices
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioCaptureDevices(int *count);
|
||||
extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioCaptureDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get the human-readable name of a specific audio device.
|
||||
|
@ -455,7 +476,7 @@ extern DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioCaptureDevices(int *count
|
|||
* \sa SDL_GetAudioCaptureDevices
|
||||
* \sa SDL_GetDefaultAudioInfo
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
|
||||
|
||||
/**
|
||||
* Get the current audio format of a specific audio device.
|
||||
|
@ -490,7 +511,7 @@ extern DECLSPEC char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -566,7 +587,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SD
|
|||
* \sa SDL_CloseAudioDevice
|
||||
* \sa SDL_GetAudioDeviceFormat
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec);
|
||||
extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec);
|
||||
|
||||
/**
|
||||
* Use this function to pause audio playback on a specified device.
|
||||
|
@ -597,7 +618,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(SDL_AudioDeviceID
|
|||
* \sa SDL_ResumeAudioDevice
|
||||
* \sa SDL_AudioDevicePaused
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* Use this function to unpause audio playback on a specified device.
|
||||
|
@ -625,7 +646,7 @@ extern DECLSPEC int SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
|
|||
* \sa SDL_AudioDevicePaused
|
||||
* \sa SDL_PauseAudioDevice
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* Use this function to query if an audio device is paused.
|
||||
|
@ -647,7 +668,7 @@ extern DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
|
|||
* \sa SDL_PauseAudioDevice
|
||||
* \sa SDL_ResumeAudioDevice
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
|
||||
|
||||
/**
|
||||
* Close a previously-opened audio device.
|
||||
|
@ -668,7 +689,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
|
|||
*
|
||||
* \sa SDL_OpenAudioDevice
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
||||
|
||||
/**
|
||||
* Bind a list of audio streams to an audio device.
|
||||
|
@ -705,7 +726,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
|||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams);
|
||||
|
||||
/**
|
||||
* Bind a single audio stream to an audio device.
|
||||
|
@ -726,7 +747,7 @@ extern DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_Au
|
|||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Unbind a list of audio streams from their audio devices.
|
||||
|
@ -746,7 +767,7 @@ extern DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_Aud
|
|||
*
|
||||
* \sa SDL_BindAudioStreams
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, int num_streams);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, int num_streams);
|
||||
|
||||
/**
|
||||
* Unbind a single audio stream from its audio device.
|
||||
|
@ -762,7 +783,7 @@ extern DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, i
|
|||
*
|
||||
* \sa SDL_BindAudioStream
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Query an audio stream for its currently-bound device.
|
||||
|
@ -782,7 +803,7 @@ extern DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
|
|||
* \sa SDL_BindAudioStream
|
||||
* \sa SDL_BindAudioStreams
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Create a new audio stream.
|
||||
|
@ -803,7 +824,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStre
|
|||
* \sa SDL_ChangeAudioStreamOutput
|
||||
* \sa SDL_DestroyAudioStream
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
|
||||
extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec);
|
||||
|
||||
/**
|
||||
* Get the properties associated with an audio stream.
|
||||
|
@ -817,7 +838,7 @@ extern DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSp
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Query the current format of an audio stream.
|
||||
|
@ -832,7 +853,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioS
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
|
||||
SDL_AudioSpec *src_spec,
|
||||
SDL_AudioSpec *dst_spec);
|
||||
|
||||
|
@ -864,7 +885,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
|
|||
* \sa SDL_GetAudioStreamFormat
|
||||
* \sa SDL_SetAudioStreamFrequencyRatio
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
|
||||
const SDL_AudioSpec *src_spec,
|
||||
const SDL_AudioSpec *dst_spec);
|
||||
|
||||
|
@ -881,7 +902,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
|
|||
*
|
||||
* \sa SDL_SetAudioStreamFrequencyRatio
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Change the frequency ratio of an audio stream.
|
||||
|
@ -908,7 +929,7 @@ extern DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *
|
|||
* \sa SDL_GetAudioStreamFrequencyRatio
|
||||
* \sa SDL_SetAudioStreamFormat
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio);
|
||||
|
||||
/**
|
||||
* Add data to the stream.
|
||||
|
@ -938,7 +959,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *st
|
|||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamQueued
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
|
||||
|
||||
/**
|
||||
* Get converted/resampled data from the stream.
|
||||
|
@ -967,7 +988,7 @@ extern DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, cons
|
|||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len);
|
||||
|
||||
/**
|
||||
* Get the number of converted/resampled bytes available.
|
||||
|
@ -992,7 +1013,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void
|
|||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1024,7 +1045,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream)
|
|||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_ClearAudioStream
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1045,7 +1066,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
|
|||
*
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Clear any pending data in the stream.
|
||||
|
@ -1066,7 +1087,7 @@ extern DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
|||
* \sa SDL_GetAudioStreamQueued
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* Lock an audio stream for serialized access.
|
||||
|
@ -1094,7 +1115,7 @@ extern DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
|||
*
|
||||
* \sa SDL_UnlockAudioStream
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1113,7 +1134,7 @@ extern DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
|||
*
|
||||
* \sa SDL_LockAudioStream
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
/**
|
||||
* A callback that fires when data passes through an SDL_AudioStream.
|
||||
|
@ -1200,7 +1221,7 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream
|
|||
*
|
||||
* \sa SDL_SetAudioStreamPutCallback
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Set a callback that runs when data is added to an audio stream.
|
||||
|
@ -1248,7 +1269,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *strea
|
|||
*
|
||||
* \sa SDL_SetAudioStreamGetCallback
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1270,7 +1291,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *strea
|
|||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1327,7 +1348,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
|
|||
* \sa SDL_GetAudioStreamDevice
|
||||
* \sa SDL_ResumeAudioDevice
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* A callback that fires when data is about to be fed to an audio device.
|
||||
|
@ -1345,7 +1366,7 @@ extern DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDevi
|
|||
* always provided here in SDL_AUDIO_F32 format.
|
||||
*
|
||||
* \param userdata a pointer provided by the app through
|
||||
* SDL_SetAudioDevicePostmixCallback, for its own use.
|
||||
* SDL_SetAudioPostmixCallback, for its own use.
|
||||
* \param spec the current format of audio that is to be submitted to the
|
||||
* audio device.
|
||||
* \param buffer the buffer of audio samples to be submitted. The callback can
|
||||
|
@ -1358,7 +1379,7 @@ extern DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDevi
|
|||
*
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetAudioDevicePostmixCallback
|
||||
* \sa SDL_SetAudioPostmixCallback
|
||||
*/
|
||||
typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_AudioSpec *spec, float *buffer, int buflen);
|
||||
|
||||
|
@ -1414,7 +1435,7 @@ typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_Audio
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1495,7 +1516,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid,
|
|||
* \sa SDL_free
|
||||
* \sa SDL_LoadWAV
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
|
||||
SDL_AudioSpec * spec, Uint8 ** audio_buf,
|
||||
Uint32 * audio_len);
|
||||
|
||||
|
@ -1533,16 +1554,9 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
|
|||
* \sa SDL_free
|
||||
* \sa SDL_LoadWAV_IO
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
|
||||
Uint8 ** audio_buf, Uint32 * audio_len);
|
||||
|
||||
/**
|
||||
* Maximum volume allowed in calls to SDL_MixAudioFormat.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_MIX_MAXVOLUME 128
|
||||
|
||||
/**
|
||||
* Mix audio data in a specified format.
|
||||
*
|
||||
|
@ -1560,16 +1574,16 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
|
|||
*
|
||||
* It is a common misconception that this function is required to write audio
|
||||
* data to an output stream in an audio callback. While you can do that,
|
||||
* SDL_MixAudioFormat() is really only needed when you're mixing a single
|
||||
* audio stream with a volume adjustment.
|
||||
* SDL_MixAudio() is really only needed when you're mixing a single audio
|
||||
* stream with a volume adjustment.
|
||||
*
|
||||
* \param dst the destination for the mixed audio
|
||||
* \param src the source audio buffer to be mixed
|
||||
* \param format the SDL_AudioFormat structure representing the desired audio
|
||||
* format
|
||||
* \param len the length of the audio buffer in bytes
|
||||
* \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
|
||||
* for full audio volume
|
||||
* \param volume ranges from 0.0 - 1.0, and should be set to 1.0 for full
|
||||
* audio volume
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@ -1577,10 +1591,10 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||
const Uint8 * src,
|
||||
SDL_AudioFormat format,
|
||||
Uint32 len, int volume);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_MixAudio(Uint8 * dst,
|
||||
const Uint8 * src,
|
||||
SDL_AudioFormat format,
|
||||
Uint32 len, float volume);
|
||||
|
||||
/**
|
||||
* Convert some audio data of one format to another format.
|
||||
|
@ -1610,7 +1624,7 @@ extern DECLSPEC int SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec,
|
||||
const Uint8 *src_data,
|
||||
int src_len,
|
||||
const SDL_AudioSpec *dst_spec,
|
||||
|
@ -1632,7 +1646,7 @@ extern DECLSPEC int SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spe
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSilenceValueForFormat(SDL_AudioFormat format);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSilenceValueForFormat(SDL_AudioFormat format);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: BeginCode */
|
||||
|
||||
/**
|
||||
* \file SDL_begin_code.h
|
||||
*
|
||||
* This file sets things up for C dynamic library function definitions,
|
||||
* static inlined functions, and structures aligned at 4-byte alignment.
|
||||
* If you don't like ugly C preprocessor code, don't look at this file. :)
|
||||
* SDL_begin_code.h sets things up for C dynamic library function definitions,
|
||||
* static inlined functions, and structures aligned at 4-byte alignment.
|
||||
* If you don't like ugly C preprocessor code, don't look at this file. :)
|
||||
*/
|
||||
|
||||
/* This shouldn't be nested -- included it around code only. */
|
||||
|
@ -52,18 +52,18 @@
|
|||
#endif
|
||||
|
||||
/* Some compilers use a special export keyword */
|
||||
#ifndef DECLSPEC
|
||||
#ifndef SDL_DECLSPEC
|
||||
# if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_CYGWIN) || defined(SDL_PLATFORM_GDK)
|
||||
# ifdef DLL_EXPORT
|
||||
# define DECLSPEC __declspec(dllexport)
|
||||
# define SDL_DECLSPEC __declspec(dllexport)
|
||||
# else
|
||||
# define DECLSPEC
|
||||
# define SDL_DECLSPEC
|
||||
# endif
|
||||
# else
|
||||
# if defined(__GNUC__) && __GNUC__ >= 4
|
||||
# define DECLSPEC __attribute__ ((visibility("default")))
|
||||
# define SDL_DECLSPEC __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define DECLSPEC
|
||||
# define SDL_DECLSPEC
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
@ -171,6 +171,19 @@
|
|||
#endif /* C++17 or C2x */
|
||||
#endif /* SDL_FALLTHROUGH not defined */
|
||||
|
||||
#ifndef SDL_NODISCARD
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L)
|
||||
#define SDL_NODISCARD [[nodiscard]]
|
||||
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
||||
#define SDL_NODISCARD __attribute__((warn_unused_result))
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1700)
|
||||
#define SDL_NODISCARD _Check_return_
|
||||
#else
|
||||
#define SDL_NODISCARD
|
||||
#endif /* C++17 or C23 */
|
||||
#endif /* SDL_NODISCARD not defined */
|
||||
|
||||
#ifndef SDL_MALLOC
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 3)
|
||||
#define SDL_MALLOC __attribute__((malloc))
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_bits.h
|
||||
* # CategoryBits
|
||||
*
|
||||
* Functions for fiddling with bits and bitmasks.
|
||||
* Functions for fiddling with bits and bitmasks.
|
||||
*/
|
||||
|
||||
#ifndef SDL_bits_h_
|
||||
|
|
|
@ -20,14 +20,18 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_blendmode.h
|
||||
* # CategoryBlendmode
|
||||
*
|
||||
* Header file declaring the SDL_BlendMode enumeration
|
||||
* Blend modes decide how two colors will mix together. There are both
|
||||
* standard modes for basic needs and a means to create custom modes,
|
||||
* dictating what sort of math to do what on what color components.
|
||||
*/
|
||||
|
||||
#ifndef SDL_blendmode_h_
|
||||
#define SDL_blendmode_h_
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -186,7 +190,7 @@ typedef enum SDL_BlendFactor
|
|||
* \sa SDL_SetTextureBlendMode
|
||||
* \sa SDL_GetTextureBlendMode
|
||||
*/
|
||||
extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
|
||||
extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
|
||||
SDL_BlendFactor dstColorFactor,
|
||||
SDL_BlendOperation colorOperation,
|
||||
SDL_BlendFactor srcAlphaFactor,
|
||||
|
|
|
@ -20,9 +20,14 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_camera.h
|
||||
* # CategoryCamera
|
||||
*
|
||||
* Video Capture for the SDL library.
|
||||
* Video capture for the SDL library.
|
||||
*
|
||||
* This API lets apps read input from video sources, like webcams. Camera
|
||||
* devices can be enumerated, queried, and opened. Once opened, it will
|
||||
* provide SDL_Surface objects as new frames of video come in. These surfaces
|
||||
* can be uploaded to an SDL_Texture or processed as pixels in memory.
|
||||
*/
|
||||
|
||||
#ifndef SDL_camera_h_
|
||||
|
@ -116,7 +121,7 @@ typedef enum SDL_CameraPosition
|
|||
*
|
||||
* \sa SDL_GetCameraDriver
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void);
|
||||
|
||||
/**
|
||||
* Use this function to get the name of a built in camera driver.
|
||||
|
@ -140,7 +145,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void);
|
|||
*
|
||||
* \sa SDL_GetNumCameraDrivers
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index);
|
||||
|
||||
/**
|
||||
* Get the name of the current camera driver.
|
||||
|
@ -158,7 +163,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected camera devices.
|
||||
|
@ -175,7 +180,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void);
|
|||
*
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count);
|
||||
extern SDL_DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get the list of native formats/sizes a camera supports.
|
||||
|
@ -218,7 +223,7 @@ extern DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count);
|
|||
* \sa SDL_GetCameraDevices
|
||||
* \sa SDL_OpenCameraDevice
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID devid, int *count);
|
||||
extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID devid, int *count);
|
||||
|
||||
/**
|
||||
* Get human-readable device name for a camera.
|
||||
|
@ -236,7 +241,7 @@ extern DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraDeviceSupportedFormats(SDL_
|
|||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id);
|
||||
extern SDL_DECLSPEC char * SDLCALL SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id);
|
||||
|
||||
/**
|
||||
* Get the position of the camera in relation to the system.
|
||||
|
@ -255,7 +260,7 @@ extern DECLSPEC char * SDLCALL SDL_GetCameraDeviceName(SDL_CameraDeviceID instan
|
|||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraDevicePosition(SDL_CameraDeviceID instance_id);
|
||||
extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraDevicePosition(SDL_CameraDeviceID instance_id);
|
||||
|
||||
/**
|
||||
* Open a video capture device (a "camera").
|
||||
|
@ -301,7 +306,7 @@ extern DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraDevicePosition(SDL_Camer
|
|||
* \sa SDL_GetCameraDevices
|
||||
* \sa SDL_GetCameraFormat
|
||||
*/
|
||||
extern DECLSPEC SDL_Camera *SDLCALL SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_CameraSpec *spec);
|
||||
extern SDL_DECLSPEC SDL_Camera *SDLCALL SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_CameraSpec *spec);
|
||||
|
||||
/**
|
||||
* Query if camera access has been approved by the user.
|
||||
|
@ -334,7 +339,7 @@ extern DECLSPEC SDL_Camera *SDLCALL SDL_OpenCameraDevice(SDL_CameraDeviceID inst
|
|||
* \sa SDL_OpenCameraDevice
|
||||
* \sa SDL_CloseCamera
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened camera.
|
||||
|
@ -349,7 +354,7 @@ extern DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
|
|||
*
|
||||
* \sa SDL_OpenCameraDevice
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camera *camera);
|
||||
extern SDL_DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camera *camera);
|
||||
|
||||
/**
|
||||
* Get the properties associated with an opened camera.
|
||||
|
@ -365,7 +370,7 @@ extern DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camera *c
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera);
|
||||
|
||||
/**
|
||||
* Get the spec that a camera is using when generating images.
|
||||
|
@ -390,7 +395,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *cam
|
|||
*
|
||||
* \sa SDL_OpenCameraDevice
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
|
||||
|
||||
/**
|
||||
* Acquire a frame.
|
||||
|
@ -433,7 +438,7 @@ extern DECLSPEC int SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSp
|
|||
*
|
||||
* \sa SDL_ReleaseCameraFrame
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS);
|
||||
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS);
|
||||
|
||||
/**
|
||||
* Release a frame of video acquired from a camera.
|
||||
|
@ -463,7 +468,7 @@ extern DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *camera,
|
|||
*
|
||||
* \sa SDL_AcquireCameraFrame
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame);
|
||||
|
||||
/**
|
||||
* Use this function to shut down camera processing and close the camera
|
||||
|
@ -479,7 +484,7 @@ extern DECLSPEC int SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surfa
|
|||
* \sa SDL_OpenCameraWithSpec
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseCamera(SDL_Camera *camera);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CloseCamera(SDL_Camera *camera);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_clipboard.h
|
||||
* # CategoryClipboard
|
||||
*
|
||||
* Include file for SDL clipboard handling
|
||||
* SDL provides access to the system clipboard, both for reading information
|
||||
* from other processes and publishing information of its own.
|
||||
*
|
||||
* This is not just text! SDL apps can access and publish data by mimetype.
|
||||
*/
|
||||
|
||||
#ifndef SDL_clipboard_h_
|
||||
|
@ -51,7 +54,7 @@ extern "C" {
|
|||
* \sa SDL_GetClipboardText
|
||||
* \sa SDL_HasClipboardText
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
||||
|
||||
/**
|
||||
* Get UTF-8 text from the clipboard, which must be freed with SDL_free().
|
||||
|
@ -69,7 +72,7 @@ extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
|
|||
* \sa SDL_HasClipboardText
|
||||
* \sa SDL_SetClipboardText
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
||||
extern SDL_DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
||||
|
||||
/**
|
||||
* Query whether the clipboard exists and contains a non-empty text string.
|
||||
|
@ -81,7 +84,7 @@ extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
|||
* \sa SDL_GetClipboardText
|
||||
* \sa SDL_SetClipboardText
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||
|
||||
/**
|
||||
* Put UTF-8 text into the primary selection.
|
||||
|
@ -95,7 +98,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
|||
* \sa SDL_GetPrimarySelectionText
|
||||
* \sa SDL_HasPrimarySelectionText
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||
|
||||
/**
|
||||
* Get UTF-8 text from the primary selection, which must be freed with
|
||||
|
@ -114,7 +117,7 @@ extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
|||
* \sa SDL_HasPrimarySelectionText
|
||||
* \sa SDL_SetPrimarySelectionText
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||
extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||
|
||||
/**
|
||||
* Query whether the primary selection exists and contains a non-empty text
|
||||
|
@ -128,7 +131,7 @@ extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
|||
* \sa SDL_GetPrimarySelectionText
|
||||
* \sa SDL_SetPrimarySelectionText
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||
|
||||
/**
|
||||
* Callback function that will be called when data for the specified mime-type
|
||||
|
@ -194,7 +197,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
|||
* \sa SDL_GetClipboardData
|
||||
* \sa SDL_HasClipboardData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callback, SDL_ClipboardCleanupCallback cleanup, void *userdata, const char **mime_types, size_t num_mime_types);
|
||||
|
||||
/**
|
||||
* Clear the clipboard data.
|
||||
|
@ -206,7 +209,7 @@ extern DECLSPEC int SDLCALL SDL_SetClipboardData(SDL_ClipboardDataCallback callb
|
|||
*
|
||||
* \sa SDL_SetClipboardData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ClearClipboardData(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ClearClipboardData(void);
|
||||
|
||||
/**
|
||||
* Get the data from clipboard for a given mime type.
|
||||
|
@ -225,7 +228,7 @@ extern DECLSPEC int SDLCALL SDL_ClearClipboardData(void);
|
|||
* \sa SDL_HasClipboardData
|
||||
* \sa SDL_SetClipboardData
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size);
|
||||
|
||||
/**
|
||||
* Query whether there is data in the clipboard for the provided mime type.
|
||||
|
@ -239,7 +242,7 @@ extern DECLSPEC void *SDLCALL SDL_GetClipboardData(const char *mime_type, size_t
|
|||
* \sa SDL_SetClipboardData
|
||||
* \sa SDL_GetClipboardData
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardData(const char *mime_type);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardData(const char *mime_type);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,11 +19,9 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_close_code.h
|
||||
*
|
||||
* This file reverses the effects of SDL_begin_code.h and should be included
|
||||
* after you finish any function and structure declarations in your headers
|
||||
/*
|
||||
* This file reverses the effects of SDL_begin_code.h and should be included
|
||||
* after you finish any function and structure declarations in your headers
|
||||
*/
|
||||
|
||||
#ifndef SDL_begin_code_h
|
||||
|
|
|
@ -19,8 +19,4 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_copying.h
|
||||
*
|
||||
* Header file containing SDL's license.
|
||||
*/
|
||||
/* Header file containing SDL's license. */
|
||||
|
|
|
@ -19,10 +19,16 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: CPUInfo */
|
||||
|
||||
/**
|
||||
* \file SDL_cpuinfo.h
|
||||
* # CategoryCPUInfo
|
||||
*
|
||||
* CPU feature detection for SDL.
|
||||
* CPU feature detection for SDL.
|
||||
*
|
||||
* These functions are largely concerned with reporting if the system has
|
||||
* access to various SIMD instruction sets, but also has other important info
|
||||
* to share, such as system RAM size and number of logical CPU cores.
|
||||
*/
|
||||
|
||||
#ifndef SDL_cpuinfo_h_
|
||||
|
@ -56,7 +62,7 @@ extern "C" {
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
||||
|
||||
/**
|
||||
* Determine the L1 cache line size of the CPU.
|
||||
|
@ -68,7 +74,7 @@ extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AltiVec features.
|
||||
|
@ -80,7 +86,7 @@ extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has MMX features.
|
||||
|
@ -91,7 +97,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE features.
|
||||
|
@ -107,7 +113,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
|||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE2 features.
|
||||
|
@ -123,7 +129,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
|||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE3 features.
|
||||
|
@ -139,7 +145,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
|||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE4.1 features.
|
||||
|
@ -155,7 +161,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
|||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has SSE4.2 features.
|
||||
|
@ -171,7 +177,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
|||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX features.
|
||||
|
@ -185,7 +191,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
|||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX2 features.
|
||||
|
@ -199,7 +205,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
|||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX512F
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has AVX-512F (foundation) features.
|
||||
|
@ -213,7 +219,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
|||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has ARM SIMD (ARMv6) features.
|
||||
|
@ -228,7 +234,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
|||
*
|
||||
* \sa SDL_HasNEON
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has NEON (ARM SIMD) features.
|
||||
|
@ -239,7 +245,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
|
||||
|
@ -252,7 +258,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
||||
|
||||
/**
|
||||
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
|
||||
|
@ -265,7 +271,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
||||
|
||||
/**
|
||||
* Get the amount of RAM configured in the system.
|
||||
|
@ -274,7 +280,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
||||
|
||||
/**
|
||||
* Report the alignment this system needs for SIMD allocations.
|
||||
|
@ -296,7 +302,7 @@ extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
|
|||
* \sa SDL_aligned_alloc
|
||||
* \sa SDL_aligned_free
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_GetSIMDAlignment(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,6 +19,12 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryDialog
|
||||
*
|
||||
* File dialog support.
|
||||
*/
|
||||
|
||||
#ifndef SDL_dialog_h_
|
||||
#define SDL_dialog_h_
|
||||
|
||||
|
@ -77,6 +83,10 @@ typedef struct SDL_DialogFileFilter
|
|||
* entry) if no filter was selected, or -1 if the platform or method doesn't
|
||||
* support fetching the selected filter.
|
||||
*
|
||||
* \param userdata An app-provided pointer, for the callback's use.
|
||||
* \param filelist The file(s) chosen by the user.
|
||||
* \param filter Index of the selected filter.
|
||||
*
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_DialogFileFilter
|
||||
|
@ -136,7 +146,7 @@ typedef void(SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * const
|
|||
* \sa SDL_ShowSaveFileDialog
|
||||
* \sa SDL_ShowOpenFolderDialog
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, const char *default_location, SDL_bool allow_many);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, const char *default_location, SDL_bool allow_many);
|
||||
|
||||
/**
|
||||
* Displays a dialog that lets the user choose a new or existing file on their
|
||||
|
@ -186,7 +196,7 @@ extern DECLSPEC void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callb
|
|||
* \sa SDL_ShowOpenFileDialog
|
||||
* \sa SDL_ShowOpenFolderDialog
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, const char *default_location);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, const char *default_location);
|
||||
|
||||
/**
|
||||
* Displays a dialog that lets the user select a folder on their filesystem.
|
||||
|
@ -230,7 +240,7 @@ extern DECLSPEC void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callb
|
|||
* \sa SDL_ShowOpenFileDialog
|
||||
* \sa SDL_ShowSaveFileDialog
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_egl.h
|
||||
*
|
||||
* This is a simple file to encapsulate the EGL API headers.
|
||||
/*
|
||||
* This is a simple file to encapsulate the EGL API headers.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_endian.h
|
||||
* # CategoryEndian
|
||||
*
|
||||
* Functions for reading and writing endian-specific values
|
||||
* Functions for reading and writing endian-specific values.
|
||||
*/
|
||||
|
||||
#ifndef SDL_endian_h_
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_error.h
|
||||
* # CategoryError
|
||||
*
|
||||
* Simple error message routines for SDL.
|
||||
* Simple error message routines for SDL.
|
||||
*/
|
||||
|
||||
#ifndef SDL_error_h_
|
||||
|
@ -63,7 +63,7 @@ extern "C" {
|
|||
* \sa SDL_ClearError
|
||||
* \sa SDL_GetError
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/**
|
||||
* Set an error indicating that memory allocation failed.
|
||||
|
@ -74,7 +74,7 @@ extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fm
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_OutOfMemory(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_OutOfMemory(void);
|
||||
|
||||
/**
|
||||
* Retrieve a message about the last error that occurred on the current
|
||||
|
@ -111,7 +111,7 @@ extern DECLSPEC int SDLCALL SDL_OutOfMemory(void);
|
|||
* \sa SDL_ClearError
|
||||
* \sa SDL_SetError
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetError(void);
|
||||
|
||||
/**
|
||||
* Clear any previous error message for this thread.
|
||||
|
@ -123,7 +123,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetError(void);
|
|||
* \sa SDL_GetError
|
||||
* \sa SDL_SetError
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ClearError(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ClearError(void);
|
||||
|
||||
/**
|
||||
* \name Internal error functions
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_events.h
|
||||
* # CategoryEvents
|
||||
*
|
||||
* Include file for SDL event handling.
|
||||
* Event queue management.
|
||||
*/
|
||||
|
||||
#ifndef SDL_events_h_
|
||||
|
@ -48,7 +48,7 @@ extern "C" {
|
|||
|
||||
/* General keyboard/mouse state definitions */
|
||||
#define SDL_RELEASED 0
|
||||
#define SDL_PRESSED 1
|
||||
#define SDL_PRESSED 1
|
||||
|
||||
/**
|
||||
* The types of events that can be delivered.
|
||||
|
@ -225,7 +225,7 @@ typedef enum SDL_EventType
|
|||
/* Internal events */
|
||||
SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
|
||||
|
||||
/** Events ::SDL_EVENT_USER through ::SDL_EVENT_LAST are for your use,
|
||||
/** Events SDL_EVENT_USER through SDL_EVENT_LAST are for your use,
|
||||
* and should be allocated with SDL_RegisterEvents()
|
||||
*/
|
||||
SDL_EVENT_USER = 0x8000,
|
||||
|
@ -259,7 +259,7 @@ typedef struct SDL_CommonEvent
|
|||
*/
|
||||
typedef struct SDL_DisplayEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_DISPLAYEVENT_* */
|
||||
SDL_EventType type; /**< SDL_DISPLAYEVENT_* */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_DisplayID displayID;/**< The associated display */
|
||||
|
@ -273,7 +273,7 @@ typedef struct SDL_DisplayEvent
|
|||
*/
|
||||
typedef struct SDL_WindowEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_WINDOWEVENT_* */
|
||||
SDL_EventType type; /**< SDL_WINDOWEVENT_* */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The associated window */
|
||||
|
@ -288,7 +288,7 @@ typedef struct SDL_WindowEvent
|
|||
*/
|
||||
typedef struct SDL_KeyboardDeviceEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_KEYBOARD_ADDED or ::SDL_EVENT_KEYBOARD_REMOVED */
|
||||
SDL_EventType type; /**< SDL_EVENT_KEYBOARD_ADDED or SDL_EVENT_KEYBOARD_REMOVED */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_KeyboardID which; /**< The keyboard instance id */
|
||||
|
@ -301,12 +301,12 @@ typedef struct SDL_KeyboardDeviceEvent
|
|||
*/
|
||||
typedef struct SDL_KeyboardEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_KEY_DOWN or ::SDL_EVENT_KEY_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with keyboard focus, if any */
|
||||
SDL_KeyboardID which; /**< The keyboard instance id, or 0 if unknown or virtual */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 repeat; /**< Non-zero if this is a key repeat */
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
|
@ -323,7 +323,7 @@ typedef struct SDL_KeyboardEvent
|
|||
*/
|
||||
typedef struct SDL_TextEditingEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_TEXT_EDITING */
|
||||
SDL_EventType type; /**< SDL_EVENT_TEXT_EDITING */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with keyboard focus, if any */
|
||||
|
@ -342,7 +342,7 @@ typedef struct SDL_TextEditingEvent
|
|||
*/
|
||||
typedef struct SDL_TextInputEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_TEXT_INPUT */
|
||||
SDL_EventType type; /**< SDL_EVENT_TEXT_INPUT */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with keyboard focus, if any */
|
||||
|
@ -356,7 +356,7 @@ typedef struct SDL_TextInputEvent
|
|||
*/
|
||||
typedef struct SDL_MouseDeviceEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_MOUSE_ADDED or ::SDL_EVENT_MOUSE_REMOVED */
|
||||
SDL_EventType type; /**< SDL_EVENT_MOUSE_ADDED or SDL_EVENT_MOUSE_REMOVED */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_MouseID which; /**< The mouse instance id */
|
||||
|
@ -369,7 +369,7 @@ typedef struct SDL_MouseDeviceEvent
|
|||
*/
|
||||
typedef struct SDL_MouseMotionEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_MOUSE_MOTION */
|
||||
SDL_EventType type; /**< SDL_EVENT_MOUSE_MOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with mouse focus, if any */
|
||||
|
@ -388,13 +388,13 @@ typedef struct SDL_MouseMotionEvent
|
|||
*/
|
||||
typedef struct SDL_MouseButtonEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_MOUSE_BUTTON_DOWN or ::SDL_EVENT_MOUSE_BUTTON_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_MOUSE_BUTTON_DOWN or SDL_EVENT_MOUSE_BUTTON_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with mouse focus, if any */
|
||||
SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */
|
||||
Uint8 button; /**< The mouse button index */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
|
||||
Uint8 padding;
|
||||
float x; /**< X coordinate, relative to window */
|
||||
|
@ -408,7 +408,7 @@ typedef struct SDL_MouseButtonEvent
|
|||
*/
|
||||
typedef struct SDL_MouseWheelEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_MOUSE_WHEEL */
|
||||
SDL_EventType type; /**< SDL_EVENT_MOUSE_WHEEL */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with mouse focus, if any */
|
||||
|
@ -427,7 +427,7 @@ typedef struct SDL_MouseWheelEvent
|
|||
*/
|
||||
typedef struct SDL_JoyAxisEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_JOYSTICK_AXIS_MOTION */
|
||||
SDL_EventType type; /**< SDL_EVENT_JOYSTICK_AXIS_MOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -446,7 +446,7 @@ typedef struct SDL_JoyAxisEvent
|
|||
*/
|
||||
typedef struct SDL_JoyBallEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_JOYSTICK_BALL_MOTION */
|
||||
SDL_EventType type; /**< SDL_EVENT_JOYSTICK_BALL_MOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -465,15 +465,15 @@ typedef struct SDL_JoyBallEvent
|
|||
*/
|
||||
typedef struct SDL_JoyHatEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_JOYSTICK_HAT_MOTION */
|
||||
SDL_EventType type; /**< SDL_EVENT_JOYSTICK_HAT_MOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 hat; /**< The joystick hat index */
|
||||
Uint8 value; /**< The hat position value.
|
||||
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
|
||||
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
|
||||
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
|
||||
* \sa SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
|
||||
* \sa SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
|
||||
* \sa SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
|
||||
*
|
||||
* Note that zero means the POV is centered.
|
||||
*/
|
||||
|
@ -488,12 +488,12 @@ typedef struct SDL_JoyHatEvent
|
|||
*/
|
||||
typedef struct SDL_JoyButtonEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_JOYSTICK_BUTTON_DOWN or ::SDL_EVENT_JOYSTICK_BUTTON_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_JOYSTICK_BUTTON_DOWN or SDL_EVENT_JOYSTICK_BUTTON_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The joystick button index */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_JoyButtonEvent;
|
||||
|
@ -505,7 +505,7 @@ typedef struct SDL_JoyButtonEvent
|
|||
*/
|
||||
typedef struct SDL_JoyDeviceEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_JOYSTICK_ADDED or ::SDL_EVENT_JOYSTICK_REMOVED or ::SDL_EVENT_JOYSTICK_UPDATE_COMPLETE */
|
||||
SDL_EventType type; /**< SDL_EVENT_JOYSTICK_ADDED or SDL_EVENT_JOYSTICK_REMOVED or SDL_EVENT_JOYSTICK_UPDATE_COMPLETE */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -518,7 +518,7 @@ typedef struct SDL_JoyDeviceEvent
|
|||
*/
|
||||
typedef struct SDL_JoyBatteryEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_JOYSTICK_BATTERY_UPDATED */
|
||||
SDL_EventType type; /**< SDL_EVENT_JOYSTICK_BATTERY_UPDATED */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -533,7 +533,7 @@ typedef struct SDL_JoyBatteryEvent
|
|||
*/
|
||||
typedef struct SDL_GamepadAxisEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_GAMEPAD_AXIS_MOTION */
|
||||
SDL_EventType type; /**< SDL_EVENT_GAMEPAD_AXIS_MOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -553,12 +553,12 @@ typedef struct SDL_GamepadAxisEvent
|
|||
*/
|
||||
typedef struct SDL_GamepadButtonEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_GAMEPAD_BUTTON_DOWN or ::SDL_EVENT_GAMEPAD_BUTTON_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_GAMEPAD_BUTTON_DOWN or SDL_EVENT_GAMEPAD_BUTTON_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 button; /**< The gamepad button (SDL_GamepadButton) */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
} SDL_GamepadButtonEvent;
|
||||
|
@ -571,7 +571,7 @@ typedef struct SDL_GamepadButtonEvent
|
|||
*/
|
||||
typedef struct SDL_GamepadDeviceEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_GAMEPAD_ADDED, ::SDL_EVENT_GAMEPAD_REMOVED, or ::SDL_EVENT_GAMEPAD_REMAPPED, ::SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or ::SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED */
|
||||
SDL_EventType type; /**< SDL_EVENT_GAMEPAD_ADDED, SDL_EVENT_GAMEPAD_REMOVED, or SDL_EVENT_GAMEPAD_REMAPPED, SDL_EVENT_GAMEPAD_UPDATE_COMPLETE or SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -584,7 +584,7 @@ typedef struct SDL_GamepadDeviceEvent
|
|||
*/
|
||||
typedef struct SDL_GamepadTouchpadEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or ::SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or ::SDL_EVENT_GAMEPAD_TOUCHPAD_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_GAMEPAD_TOUCHPAD_DOWN or SDL_EVENT_GAMEPAD_TOUCHPAD_MOTION or SDL_EVENT_GAMEPAD_TOUCHPAD_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
|
@ -602,11 +602,11 @@ typedef struct SDL_GamepadTouchpadEvent
|
|||
*/
|
||||
typedef struct SDL_GamepadSensorEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_GAMEPAD_SENSOR_UPDATE */
|
||||
SDL_EventType type; /**< SDL_EVENT_GAMEPAD_SENSOR_UPDATE */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
||||
Sint32 sensor; /**< The type of the sensor, one of the values of SDL_SensorType */
|
||||
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
||||
Uint64 sensor_timestamp; /**< The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock */
|
||||
} SDL_GamepadSensorEvent;
|
||||
|
@ -618,7 +618,7 @@ typedef struct SDL_GamepadSensorEvent
|
|||
*/
|
||||
typedef struct SDL_AudioDeviceEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_AUDIO_DEVICE_ADDED, or ::SDL_EVENT_AUDIO_DEVICE_REMOVED, or ::SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED */
|
||||
SDL_EventType type; /**< SDL_EVENT_AUDIO_DEVICE_ADDED, or SDL_EVENT_AUDIO_DEVICE_REMOVED, or SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_AudioDeviceID which; /**< SDL_AudioDeviceID for the device being added or removed or changing */
|
||||
|
@ -635,7 +635,7 @@ typedef struct SDL_AudioDeviceEvent
|
|||
*/
|
||||
typedef struct SDL_CameraDeviceEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_CAMERA_DEVICE_ADDED, ::SDL_EVENT_CAMERA_DEVICE_REMOVED, ::SDL_EVENT_CAMERA_DEVICE_APPROVED, ::SDL_EVENT_CAMERA_DEVICE_DENIED */
|
||||
SDL_EventType type; /**< SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_CameraDeviceID which; /**< SDL_CameraDeviceID for the device being added or removed or changing */
|
||||
|
@ -648,7 +648,7 @@ typedef struct SDL_CameraDeviceEvent
|
|||
*/
|
||||
typedef struct SDL_TouchFingerEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_FINGER_MOTION or ::SDL_EVENT_FINGER_DOWN or ::SDL_EVENT_FINGER_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_FINGER_MOTION or SDL_EVENT_FINGER_DOWN or SDL_EVENT_FINGER_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_TouchID touchID; /**< The touch device id */
|
||||
|
@ -669,17 +669,17 @@ typedef struct SDL_TouchFingerEvent
|
|||
*/
|
||||
typedef struct SDL_PenTipEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_PEN_DOWN or ::SDL_EVENT_PEN_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_PEN_DOWN or SDL_EVENT_PEN_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with pen focus, if any */
|
||||
SDL_PenID which; /**< The pen instance id */
|
||||
Uint8 tip; /**< ::SDL_PEN_TIP_INK when using a regular pen tip, or ::SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */
|
||||
Uint8 state; /**< ::SDL_PRESSED on ::SDL_EVENT_PEN_DOWN and ::SDL_RELEASED on ::SDL_EVENT_PEN_UP */
|
||||
Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), ::SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and ::SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */
|
||||
Uint8 tip; /**< SDL_PEN_TIP_INK when using a regular pen tip, or SDL_PEN_TIP_ERASER if the pen is being used as an eraser (e.g., flipped to use the eraser tip) */
|
||||
Uint8 state; /**< SDL_PRESSED on SDL_EVENT_PEN_DOWN and SDL_RELEASED on SDL_EVENT_PEN_UP */
|
||||
Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */
|
||||
float x; /**< X coordinate, relative to window */
|
||||
float y; /**< Y coordinate, relative to window */
|
||||
float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per ::SDL_PenAxis) */
|
||||
float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */
|
||||
} SDL_PenTipEvent;
|
||||
|
||||
/**
|
||||
|
@ -690,17 +690,17 @@ typedef struct SDL_PenTipEvent
|
|||
*/
|
||||
typedef struct SDL_PenMotionEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_PEN_MOTION */
|
||||
SDL_EventType type; /**< SDL_EVENT_PEN_MOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with pen focus, if any */
|
||||
SDL_PenID which; /**< The pen instance id */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), ::SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and ::SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */
|
||||
Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */
|
||||
float x; /**< X coordinate, relative to window */
|
||||
float y; /**< Y coordinate, relative to window */
|
||||
float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per ::SDL_PenAxis) */
|
||||
float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */
|
||||
} SDL_PenMotionEvent;
|
||||
|
||||
/**
|
||||
|
@ -710,17 +710,17 @@ typedef struct SDL_PenMotionEvent
|
|||
*/
|
||||
typedef struct SDL_PenButtonEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_PEN_BUTTON_DOWN or ::SDL_EVENT_PEN_BUTTON_UP */
|
||||
SDL_EventType type; /**< SDL_EVENT_PEN_BUTTON_DOWN or SDL_EVENT_PEN_BUTTON_UP */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window with pen focus, if any */
|
||||
SDL_PenID which; /**< The pen instance id */
|
||||
Uint8 button; /**< The pen button index (1 represents the pen tip for compatibility with mouse events) */
|
||||
Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
|
||||
Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), ::SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and ::SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */
|
||||
Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
|
||||
Uint16 pen_state; /**< Pen button masks (where SDL_BUTTON(1) is the first button, SDL_BUTTON(2) is the second button etc.), SDL_PEN_DOWN_MASK is set if the pen is touching the surface, and SDL_PEN_ERASER_MASK is set if the pen is (used as) an eraser. */
|
||||
float x; /**< X coordinate, relative to window */
|
||||
float y; /**< Y coordinate, relative to window */
|
||||
float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per ::SDL_PenAxis) */
|
||||
float axes[SDL_PEN_NUM_AXES]; /**< Pen axes such as pressure and tilt (ordered as per SDL_PenAxis) */
|
||||
} SDL_PenButtonEvent;
|
||||
|
||||
/**
|
||||
|
@ -734,7 +734,7 @@ typedef struct SDL_PenButtonEvent
|
|||
*/
|
||||
typedef struct SDL_DropEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_DROP_BEGIN or ::SDL_EVENT_DROP_FILE or ::SDL_EVENT_DROP_TEXT or ::SDL_EVENT_DROP_COMPLETE or ::SDL_EVENT_DROP_POSITION */
|
||||
SDL_EventType type; /**< SDL_EVENT_DROP_BEGIN or SDL_EVENT_DROP_FILE or SDL_EVENT_DROP_TEXT or SDL_EVENT_DROP_COMPLETE or SDL_EVENT_DROP_POSITION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The window that was dropped on, if any */
|
||||
|
@ -752,7 +752,7 @@ typedef struct SDL_DropEvent
|
|||
*/
|
||||
typedef struct SDL_ClipboardEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_CLIPBOARD_UPDATE */
|
||||
SDL_EventType type; /**< SDL_EVENT_CLIPBOARD_UPDATE */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
} SDL_ClipboardEvent;
|
||||
|
@ -764,7 +764,7 @@ typedef struct SDL_ClipboardEvent
|
|||
*/
|
||||
typedef struct SDL_SensorEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_SENSOR_UPDATE */
|
||||
SDL_EventType type; /**< SDL_EVENT_SENSOR_UPDATE */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_SensorID which; /**< The instance ID of the sensor */
|
||||
|
@ -779,7 +779,7 @@ typedef struct SDL_SensorEvent
|
|||
*/
|
||||
typedef struct SDL_QuitEvent
|
||||
{
|
||||
SDL_EventType type; /**< ::SDL_EVENT_QUIT */
|
||||
SDL_EventType type; /**< SDL_EVENT_QUIT */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
} SDL_QuitEvent;
|
||||
|
@ -797,7 +797,7 @@ typedef struct SDL_QuitEvent
|
|||
*/
|
||||
typedef struct SDL_UserEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_USER through ::SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration */
|
||||
Uint32 type; /**< SDL_EVENT_USER through SDL_EVENT_LAST-1, Uint32 because these are not in the SDL_EventType enumeration */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The associated window if any */
|
||||
|
@ -893,7 +893,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NUL
|
|||
* \sa SDL_PollEvent
|
||||
* \sa SDL_WaitEvent
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
|
||||
/* @{ */
|
||||
typedef enum SDL_EventAction
|
||||
|
@ -941,7 +941,7 @@ typedef enum SDL_EventAction
|
|||
* \sa SDL_PumpEvents
|
||||
* \sa SDL_PushEvent
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, SDL_EventAction action, Uint32 minType, Uint32 maxType);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, SDL_EventAction action, Uint32 minType, Uint32 maxType);
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
|
@ -958,7 +958,7 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, SDL
|
|||
*
|
||||
* \sa SDL_HasEvents
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -977,7 +977,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
|
|||
*
|
||||
* \sa SDL_HasEvents
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
|
||||
/**
|
||||
* Clear events of a specific type from the event queue.
|
||||
|
@ -1003,7 +1003,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
|||
*
|
||||
* \sa SDL_FlushEvents
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
||||
|
||||
/**
|
||||
* Clear events of a range of types from the event queue.
|
||||
|
@ -1028,7 +1028,7 @@ extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
|
|||
*
|
||||
* \sa SDL_FlushEvent
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
||||
|
||||
/**
|
||||
* Poll for currently pending events.
|
||||
|
@ -1073,7 +1073,7 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
|
|||
* \sa SDL_WaitEvent
|
||||
* \sa SDL_WaitEventTimeout
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Wait indefinitely for the next available event.
|
||||
|
@ -1095,7 +1095,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PollEvent(SDL_Event *event);
|
|||
* \sa SDL_PushEvent
|
||||
* \sa SDL_WaitEventTimeout
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Wait until the specified timeout (in milliseconds) for the next available
|
||||
|
@ -1123,7 +1123,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WaitEvent(SDL_Event *event);
|
|||
* \sa SDL_PushEvent
|
||||
* \sa SDL_WaitEvent
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS);
|
||||
|
||||
/**
|
||||
* Add an event to the event queue.
|
||||
|
@ -1157,7 +1157,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WaitEventTimeout(SDL_Event *event, Sint32 t
|
|||
* \sa SDL_PollEvent
|
||||
* \sa SDL_RegisterEvents
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
|
||||
|
||||
/**
|
||||
* A function pointer used for callbacks that watch the event queue.
|
||||
|
@ -1195,7 +1195,7 @@ typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event);
|
|||
* interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
|
||||
* application at the next event poll.
|
||||
*
|
||||
* There is one caveat when dealing with the ::SDL_QuitEvent event type. The
|
||||
* There is one caveat when dealing with the SDL_QuitEvent event type. The
|
||||
* event filter is only called when the window manager desires to close the
|
||||
* application window. If the event filter returns 1, then the window will be
|
||||
* closed, otherwise the window will remain open if possible.
|
||||
|
@ -1225,7 +1225,7 @@ typedef int (SDLCALL *SDL_EventFilter)(void *userdata, SDL_Event *event);
|
|||
* \sa SDL_PeepEvents
|
||||
* \sa SDL_PushEvent
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void *userdata);
|
||||
|
||||
/**
|
||||
* Query the current event filter.
|
||||
|
@ -1242,7 +1242,7 @@ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, void *us
|
|||
*
|
||||
* \sa SDL_SetEventFilter
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata);
|
||||
|
||||
/**
|
||||
* Add a callback to be triggered when an event is added to the event queue.
|
||||
|
@ -1272,7 +1272,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, voi
|
|||
* \sa SDL_DelEventWatch
|
||||
* \sa SDL_SetEventFilter
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove an event watch callback added with SDL_AddEventWatch().
|
||||
|
@ -1287,7 +1287,7 @@ extern DECLSPEC int SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *user
|
|||
*
|
||||
* \sa SDL_AddEventWatch
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata);
|
||||
|
||||
/**
|
||||
* Run a specific filter function on the current event queue, removing any
|
||||
|
@ -1305,7 +1305,7 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *use
|
|||
* \sa SDL_GetEventFilter
|
||||
* \sa SDL_SetEventFilter
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *userdata);
|
||||
|
||||
/**
|
||||
* Set the state of processing events by type.
|
||||
|
@ -1317,7 +1317,7 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, void *user
|
|||
*
|
||||
* \sa SDL_EventEnabled
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Query the state of processing events by type.
|
||||
|
@ -1329,7 +1329,7 @@ extern DECLSPEC void SDLCALL SDL_SetEventEnabled(Uint32 type, SDL_bool enabled);
|
|||
*
|
||||
* \sa SDL_SetEventEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
|
||||
|
||||
/**
|
||||
* Allocate a set of user-defined events, and return the beginning event
|
||||
|
@ -1343,7 +1343,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
|
|||
*
|
||||
* \sa SDL_PushEvent
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
||||
|
||||
/**
|
||||
* Allocate dynamic memory for an SDL event.
|
||||
|
@ -1357,7 +1357,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size);
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_filesystem.h
|
||||
* # CategoryFilesystem
|
||||
*
|
||||
* Include file for filesystem SDL API functions
|
||||
* SDL Filesystem API.
|
||||
*/
|
||||
|
||||
#ifndef SDL_filesystem_h_
|
||||
|
@ -80,7 +80,7 @@ extern "C" {
|
|||
*
|
||||
* \sa SDL_GetPrefPath
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
||||
|
||||
/**
|
||||
* Get the user-and-app-specific path where files can be written.
|
||||
|
@ -137,7 +137,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
|||
*
|
||||
* \sa SDL_GetBasePath
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
|
||||
|
||||
/**
|
||||
* The type of the OS-provided default folder for a specific purpose.
|
||||
|
@ -240,7 +240,7 @@ typedef enum SDL_Folder
|
|||
*
|
||||
* \sa SDL_Folder
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetUserFolder(SDL_Folder folder);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_GetUserFolder(SDL_Folder folder);
|
||||
|
||||
|
||||
/* Abstract filesystem interface */
|
||||
|
@ -262,6 +262,18 @@ typedef struct SDL_PathInfo
|
|||
SDL_Time access_time; /* the last time the path was read */
|
||||
} SDL_PathInfo;
|
||||
|
||||
/**
|
||||
* Flags for path matching
|
||||
*
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GlobDirectory
|
||||
* \sa SDL_GlobStorageDirectory
|
||||
*/
|
||||
typedef Uint32 SDL_GlobFlags;
|
||||
|
||||
#define SDL_GLOB_CASEINSENSITIVE (1u << 0)
|
||||
|
||||
/**
|
||||
* Create a directory.
|
||||
*
|
||||
|
@ -271,7 +283,7 @@ typedef struct SDL_PathInfo
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CreateDirectory(const char *path);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CreateDirectory(const char *path);
|
||||
|
||||
/* Callback for directory enumeration. Return 1 to keep enumerating,
|
||||
0 to stop enumerating (no error), -1 to stop enumerating and
|
||||
|
@ -294,7 +306,7 @@ typedef int (SDLCALL *SDL_EnumerateDirectoryCallback)(void *userdata, const char
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove a file or an empty directory.
|
||||
|
@ -305,7 +317,7 @@ extern DECLSPEC int SDLCALL SDL_EnumerateDirectory(const char *path, SDL_Enumera
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RemovePath(const char *path);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RemovePath(const char *path);
|
||||
|
||||
/**
|
||||
* Rename a file or directory.
|
||||
|
@ -317,7 +329,7 @@ extern DECLSPEC int SDLCALL SDL_RemovePath(const char *path);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenamePath(const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path.
|
||||
|
@ -330,10 +342,7 @@ extern DECLSPEC int SDLCALL SDL_RenamePath(const char *oldpath, const char *newp
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
|
||||
|
||||
#define SDL_GLOB_CASEINSENSITIVE (1u << 0)
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
|
||||
/**
|
||||
* Enumerate a directory tree, filtered by pattern, and return a list.
|
||||
|
@ -368,7 +377,7 @@ extern DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC char **SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, Uint32 flags, int *count);
|
||||
extern SDL_DECLSPEC char **SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,37 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_gamepad.h
|
||||
* # CategoryGamepad
|
||||
*
|
||||
* Include file for SDL gamepad event handling
|
||||
* SDL provides a low-level joystick API, which just treats joysticks as an
|
||||
* arbitrary pile of buttons, axes, and hat switches. If you're planning to
|
||||
* write your own control configuration screen, this can give you a lot of
|
||||
* flexibility, but that's a lot of work, and most things that we consider
|
||||
* "joysticks" now are actually console-style gamepads. So SDL provides the
|
||||
* gamepad API on top of the lower-level joystick functionality.
|
||||
*
|
||||
* The difference betweena joystick and a gamepad is that a gamepad tells you
|
||||
* _where_ a button or axis is on the device. You don't speak to gamepads in
|
||||
* terms of arbitrary numbers like "button 3" or "axis 2" but in standard
|
||||
* locations: the d-pad, the shoulder buttons, triggers, A/B/X/Y (or
|
||||
* X/O/Square/Triangle, if you will).
|
||||
*
|
||||
* One turns a joystick into a gamepad by providing a magic configuration
|
||||
* string, which tells SDL the details of a specific device: when you see this
|
||||
* specific hardware, if button 2 gets pressed, this is actually D-Pad Up,
|
||||
* etc.
|
||||
*
|
||||
* SDL has many popular controllers configured out of the box, and users can
|
||||
* add their own controller details through an environment variable if it's
|
||||
* otherwise unknown to SDL.
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called with the
|
||||
* SDL_INIT_GAMEPAD flag. This causes SDL to scan the system for gamepads, and
|
||||
* load appropriate drivers.
|
||||
*
|
||||
* If you would like to receive gamepad updates while the application is in
|
||||
* the background, you should set the following hint before calling
|
||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
||||
*/
|
||||
|
||||
#ifndef SDL_gamepad_h_
|
||||
|
@ -41,18 +69,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \file SDL_gamepad.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the ::SDL_INIT_GAMEPAD flag. This causes SDL to scan the system
|
||||
* for gamepads, and load appropriate drivers.
|
||||
*
|
||||
* If you would like to receive gamepad updates while the application
|
||||
* is in the background, you should set the following hint before calling
|
||||
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* The structure used to identify an SDL gamepad
|
||||
*
|
||||
|
@ -292,7 +308,7 @@ typedef struct SDL_GamepadBinding
|
|||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from an SDL_IOStream.
|
||||
|
@ -324,7 +340,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
|||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a file.
|
||||
|
@ -350,7 +366,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_
|
|||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
|
||||
/**
|
||||
* Reinitialize the SDL mapping database to its initial state.
|
||||
|
@ -362,7 +378,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
|
||||
/**
|
||||
* Get the current gamepad mappings.
|
||||
|
@ -377,7 +393,7 @@ extern DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count);
|
||||
extern SDL_DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count);
|
||||
|
||||
/**
|
||||
* Get the gamepad mapping string for a given GUID.
|
||||
|
@ -393,7 +409,7 @@ extern DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count);
|
|||
* \sa SDL_GetJoystickInstanceGUID
|
||||
* \sa SDL_GetJoystickGUID
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid);
|
||||
extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid);
|
||||
|
||||
/**
|
||||
* Get the current mapping of a gamepad.
|
||||
|
@ -413,7 +429,7 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID gui
|
|||
* \sa SDL_GetGamepadMappingForGUID
|
||||
* \sa SDL_SetGamepadMapping
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Set the current mapping of a joystick or gamepad.
|
||||
|
@ -431,7 +447,7 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
|||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_GetGamepadMapping
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
|
||||
|
||||
/**
|
||||
* Return whether a gamepad is currently connected.
|
||||
|
@ -442,7 +458,7 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, co
|
|||
*
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected gamepads.
|
||||
|
@ -457,7 +473,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
|||
* \sa SDL_HasGamepad
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
|
||||
/**
|
||||
* Check if the given joystick is supported by the gamepad interface.
|
||||
|
@ -471,7 +487,7 @@ extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
|||
* \sa SDL_GetJoysticks
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a gamepad.
|
||||
|
@ -487,7 +503,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
|||
* \sa SDL_GetGamepadName
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent path of a gamepad.
|
||||
|
@ -503,7 +519,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID in
|
|||
* \sa SDL_GetGamepadPath
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the player index of a gamepad.
|
||||
|
@ -518,7 +534,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID in
|
|||
* \sa SDL_GetGamepadPlayerIndex
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent GUID of a gamepad.
|
||||
|
@ -535,7 +551,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID ins
|
|||
* \sa SDL_GetGamepadGUIDString
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of a gamepad, if available.
|
||||
|
@ -552,7 +568,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_Joystick
|
|||
* \sa SDL_GetGamepadVendor
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the USB product ID of a gamepad, if available.
|
||||
|
@ -569,7 +585,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID insta
|
|||
* \sa SDL_GetGamepadProduct
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the product version of a gamepad, if available.
|
||||
|
@ -586,7 +602,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID inst
|
|||
* \sa SDL_GetGamepadProductVersion
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the type of a gamepad.
|
||||
|
@ -602,7 +618,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_Joystick
|
|||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetRealGamepadInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the type of a gamepad, ignoring any mapping override.
|
||||
|
@ -618,7 +634,7 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickI
|
|||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetRealGamepadType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the mapping of a gamepad.
|
||||
|
@ -634,7 +650,7 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_Joyst
|
|||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetGamepadMapping
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Open a gamepad for use.
|
||||
|
@ -648,7 +664,7 @@ extern DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID insta
|
|||
* \sa SDL_CloseGamepad
|
||||
* \sa SDL_IsGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the SDL_Gamepad associated with a joystick instance ID, if it has been
|
||||
|
@ -660,7 +676,7 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromInstanceID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromInstanceID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the SDL_Gamepad associated with a player index.
|
||||
|
@ -673,7 +689,7 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromInstanceID(SDL_JoystickID
|
|||
* \sa SDL_GetGamepadPlayerIndex
|
||||
* \sa SDL_SetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_index);
|
||||
extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_index);
|
||||
|
||||
/**
|
||||
* Get the properties associated with an opened gamepad.
|
||||
|
@ -703,7 +719,7 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_in
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *gamepad);
|
||||
|
||||
#define SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN
|
||||
|
@ -721,7 +737,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *g
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent name for an opened gamepad.
|
||||
|
@ -735,7 +751,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gam
|
|||
*
|
||||
* \sa SDL_GetGamepadInstanceName
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent path for an opened gamepad.
|
||||
|
@ -749,7 +765,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \sa SDL_GetGamepadInstancePath
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the type of an opened gamepad.
|
||||
|
@ -762,7 +778,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \sa SDL_GetGamepadInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the type of an opened gamepad, ignoring any mapping override.
|
||||
|
@ -775,7 +791,7 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *gamepad)
|
|||
*
|
||||
* \sa SDL_GetRealGamepadInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened gamepad.
|
||||
|
@ -789,7 +805,7 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *game
|
|||
*
|
||||
* \sa SDL_SetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Set the player index of an opened gamepad.
|
||||
|
@ -804,7 +820,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \sa SDL_GetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of an opened gamepad, if available.
|
||||
|
@ -818,7 +834,7 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int
|
|||
*
|
||||
* \sa SDL_GetGamepadInstanceVendor
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the USB product ID of an opened gamepad, if available.
|
||||
|
@ -832,7 +848,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \sa SDL_GetGamepadInstanceProduct
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the product version of an opened gamepad, if available.
|
||||
|
@ -846,7 +862,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \sa SDL_GetGamepadInstanceProductVersion
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the firmware version of an opened gamepad, if available.
|
||||
|
@ -858,7 +874,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the serial number of an opened gamepad, if available.
|
||||
|
@ -870,7 +886,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *gamepa
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetGamepadSerial(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadSerial(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the Steam Input handle of an opened gamepad, if available.
|
||||
|
@ -883,7 +899,7 @@ extern DECLSPEC const char * SDLCALL SDL_GetGamepadSerial(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetGamepadSteamHandle(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetGamepadSteamHandle(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the connection state of a gamepad.
|
||||
|
@ -895,7 +911,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetGamepadSteamHandle(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetGamepadConnectionState(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetGamepadConnectionState(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the battery state of a gamepad.
|
||||
|
@ -915,7 +931,7 @@ extern DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetGamepadConnectionStat
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetGamepadPowerInfo(SDL_Gamepad *gamepad, int *percent);
|
||||
extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetGamepadPowerInfo(SDL_Gamepad *gamepad, int *percent);
|
||||
|
||||
/**
|
||||
* Check if a gamepad has been opened and is currently connected.
|
||||
|
@ -927,7 +943,7 @@ extern DECLSPEC SDL_PowerState SDLCALL SDL_GetGamepadPowerInfo(SDL_Gamepad *game
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the underlying joystick from a gamepad.
|
||||
|
@ -946,7 +962,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Set the state of gamepad event processing.
|
||||
|
@ -961,7 +977,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepa
|
|||
* \sa SDL_GamepadEventsEnabled
|
||||
* \sa SDL_UpdateGamepads
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Query the state of gamepad event processing.
|
||||
|
@ -976,7 +992,7 @@ extern DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
|||
*
|
||||
* \sa SDL_SetGamepadEventsEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
|
||||
|
||||
/**
|
||||
* Get the SDL joystick layer bindings for a gamepad.
|
||||
|
@ -989,7 +1005,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadBinding **SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count);
|
||||
extern SDL_DECLSPEC SDL_GamepadBinding **SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count);
|
||||
|
||||
/**
|
||||
* Manually pump gamepad updates if not using the loop.
|
||||
|
@ -1000,7 +1016,7 @@ extern DECLSPEC SDL_GamepadBinding **SDLCALL SDL_GetGamepadBindings(SDL_Gamepad
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateGamepads(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UpdateGamepads(void);
|
||||
|
||||
/**
|
||||
* Convert a string into SDL_GamepadType enum.
|
||||
|
@ -1018,7 +1034,7 @@ extern DECLSPEC void SDLCALL SDL_UpdateGamepads(void);
|
|||
*
|
||||
* \sa SDL_GetGamepadStringForType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const char *str);
|
||||
extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const char *str);
|
||||
|
||||
/**
|
||||
* Convert from an SDL_GamepadType enum to a string.
|
||||
|
@ -1034,7 +1050,7 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const char
|
|||
*
|
||||
* \sa SDL_GetGamepadTypeFromString
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType type);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType type);
|
||||
|
||||
/**
|
||||
* Convert a string into SDL_GamepadAxis enum.
|
||||
|
@ -1056,7 +1072,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType
|
|||
*
|
||||
* \sa SDL_GetGamepadStringForAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const char *str);
|
||||
extern SDL_DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const char *str);
|
||||
|
||||
/**
|
||||
* Convert from an SDL_GamepadAxis enum to a string.
|
||||
|
@ -1072,7 +1088,7 @@ extern DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const char
|
|||
*
|
||||
* \sa SDL_GetGamepadAxisFromString
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has a given axis.
|
||||
|
@ -1089,7 +1105,7 @@ extern DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis
|
|||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Get the current state of an axis control on a gamepad.
|
||||
|
@ -1113,7 +1129,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_Ga
|
|||
* \sa SDL_GamepadHasAxis
|
||||
* \sa SDL_GetGamepadButton
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Convert a string into an SDL_GamepadButton enum.
|
||||
|
@ -1131,7 +1147,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_Game
|
|||
*
|
||||
* \sa SDL_GetGamepadStringForButton
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(const char *str);
|
||||
extern SDL_DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(const char *str);
|
||||
|
||||
/**
|
||||
* Convert from an SDL_GamepadButton enum to a string.
|
||||
|
@ -1147,7 +1163,7 @@ extern DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(const c
|
|||
*
|
||||
* \sa SDL_GetGamepadButtonFromString
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has a given button.
|
||||
|
@ -1163,7 +1179,7 @@ extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadBut
|
|||
*
|
||||
* \sa SDL_GamepadHasAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Get the current state of a button on a gamepad.
|
||||
|
@ -1178,7 +1194,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_
|
|||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Get the label of a button on a gamepad.
|
||||
|
@ -1191,7 +1207,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_Gam
|
|||
*
|
||||
* \sa SDL_GetGamepadButtonLabel
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabelForType(SDL_GamepadType type, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabelForType(SDL_GamepadType type, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Get the label of a button on a gamepad.
|
||||
|
@ -1204,7 +1220,7 @@ extern DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabelForType(
|
|||
*
|
||||
* \sa SDL_GetGamepadButtonLabelForType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabel(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabel(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Get the number of touchpads on a gamepad.
|
||||
|
@ -1216,7 +1232,7 @@ extern DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabel(SDL_Gam
|
|||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Get the number of supported simultaneous fingers on a touchpad on a game
|
||||
|
@ -1231,7 +1247,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
|||
* \sa SDL_GetGamepadTouchpadFinger
|
||||
* \sa SDL_GetNumGamepadTouchpads
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad);
|
||||
|
||||
/**
|
||||
* Get the current state of a finger on a touchpad on a gamepad.
|
||||
|
@ -1240,8 +1256,10 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepa
|
|||
* \param touchpad a touchpad
|
||||
* \param finger a finger
|
||||
* \param state filled with state
|
||||
* \param x filled with x position
|
||||
* \param y filled with y position
|
||||
* \param x filled with x position, normalized 0 to 1, with the origin in the
|
||||
* upper left
|
||||
* \param y filled with y position, normalized 0 to 1, with the origin in the
|
||||
* upper left
|
||||
* \param pressure filled with pressure value
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
|
@ -1250,7 +1268,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepa
|
|||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
|
||||
|
||||
/**
|
||||
* Return whether a gamepad has a particular sensor.
|
||||
|
@ -1265,7 +1283,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, i
|
|||
* \sa SDL_GetGamepadSensorDataRate
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
/**
|
||||
* Set whether data reporting for a gamepad sensor is enabled.
|
||||
|
@ -1281,7 +1299,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_
|
|||
* \sa SDL_GamepadHasSensor
|
||||
* \sa SDL_GamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Query whether sensor data reporting is enabled for a gamepad.
|
||||
|
@ -1294,7 +1312,7 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SD
|
|||
*
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
/**
|
||||
* Get the data rate (number of events per second) of a gamepad sensor.
|
||||
|
@ -1305,7 +1323,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
/**
|
||||
* Get the current state of a gamepad sensor.
|
||||
|
@ -1322,7 +1340,7 @@ extern DECLSPEC float SDLCALL SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Start a rumble effect on a gamepad.
|
||||
|
@ -1343,7 +1361,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_S
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Start a rumble effect in the gamepad's triggers.
|
||||
|
@ -1371,7 +1389,7 @@ extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_f
|
|||
*
|
||||
* \sa SDL_RumbleGamepad
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Update a gamepad's LED color.
|
||||
|
@ -1391,7 +1409,7 @@ extern DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue);
|
||||
|
||||
/**
|
||||
* Send a gamepad specific effect packet.
|
||||
|
@ -1404,7 +1422,7 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, U
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size);
|
||||
|
||||
/**
|
||||
* Close a gamepad previously opened with SDL_OpenGamepad().
|
||||
|
@ -1416,7 +1434,7 @@ extern DECLSPEC int SDLCALL SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const vo
|
|||
*
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Return the sfSymbolsName for a given button on a gamepad on Apple
|
||||
|
@ -1430,7 +1448,7 @@ extern DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad);
|
|||
*
|
||||
* \sa SDL_GetGamepadAppleSFSymbolsNameForAxis
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
/**
|
||||
* Return the sfSymbolsName for a given axis on a gamepad on Apple platforms.
|
||||
|
@ -1443,7 +1461,7 @@ extern DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SD
|
|||
*
|
||||
* \sa SDL_GetGamepadAppleSFSymbolsNameForButton
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -19,10 +19,13 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: GUID */
|
||||
|
||||
/**
|
||||
* \file SDL_guid.h
|
||||
* # CategoryGUID
|
||||
*
|
||||
* Include file for handling ::SDL_GUID values.
|
||||
* A GUID is a 128-bit value that represents something that is uniquely
|
||||
* identifiable by this value: "globally unique."
|
||||
*/
|
||||
|
||||
#ifndef SDL_guid_h_
|
||||
|
@ -61,11 +64,11 @@ typedef struct SDL_GUID {
|
|||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Get an ASCII string representation for a given ::SDL_GUID.
|
||||
* Get an ASCII string representation for a given SDL_GUID.
|
||||
*
|
||||
* You should supply at least 33 bytes for pszGUID.
|
||||
*
|
||||
* \param guid the ::SDL_GUID you wish to convert to string
|
||||
* \param guid the SDL_GUID you wish to convert to string
|
||||
* \param pszGUID buffer in which to write the ASCII string
|
||||
* \param cbGUID the size of pszGUID
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
|
@ -75,23 +78,23 @@ typedef struct SDL_GUID {
|
|||
*
|
||||
* \sa SDL_GUIDFromString
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
||||
|
||||
/**
|
||||
* Convert a GUID string into a ::SDL_GUID structure.
|
||||
* Convert a GUID string into a SDL_GUID structure.
|
||||
*
|
||||
* Performs no error checking. If this function is given a string containing
|
||||
* an invalid GUID, the function will silently succeed, but the GUID generated
|
||||
* will not be useful.
|
||||
*
|
||||
* \param pchGUID string containing an ASCII representation of a GUID
|
||||
* \returns a ::SDL_GUID structure.
|
||||
* \returns a SDL_GUID structure.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GUIDToString
|
||||
*/
|
||||
extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
|
||||
extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,21 +20,21 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_haptic.h
|
||||
* # CategoryHaptic
|
||||
*
|
||||
* The SDL haptic subsystem manages haptic (force feedback) devices.
|
||||
* The SDL haptic subsystem manages haptic (force feedback) devices.
|
||||
*
|
||||
* The basic usage is as follows:
|
||||
* The basic usage is as follows:
|
||||
*
|
||||
* - Initialize the subsystem (SDL_INIT_HAPTIC).
|
||||
* - Open a haptic device.
|
||||
* - SDL_OpenHaptic() to open from index.
|
||||
* - SDL_OpenHapticFromJoystick() to open from an existing joystick.
|
||||
* - Create an effect (SDL_HapticEffect).
|
||||
* - Upload the effect with SDL_CreateHapticEffect().
|
||||
* - Run the effect with SDL_RunHapticEffect().
|
||||
* - (optional) Free the effect with SDL_DestroyHapticEffect().
|
||||
* - Close the haptic device with SDL_CloseHaptic().
|
||||
* - Initialize the subsystem (SDL_INIT_HAPTIC).
|
||||
* - Open a haptic device.
|
||||
* - SDL_OpenHaptic() to open from index.
|
||||
* - SDL_OpenHapticFromJoystick() to open from an existing joystick.
|
||||
* - Create an effect (SDL_HapticEffect).
|
||||
* - Upload the effect with SDL_CreateHapticEffect().
|
||||
* - Run the effect with SDL_RunHapticEffect().
|
||||
* - (optional) Free the effect with SDL_DestroyHapticEffect().
|
||||
* - Close the haptic device with SDL_CloseHaptic().
|
||||
*
|
||||
* Simple rumble example:
|
||||
*
|
||||
|
@ -113,6 +113,7 @@
|
|||
* Note that the SDL haptic subsystem is not thread-safe.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_haptic_h_
|
||||
#define SDL_haptic_h_
|
||||
|
||||
|
@ -940,7 +941,7 @@ typedef Uint32 SDL_HapticID;
|
|||
*
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count);
|
||||
extern SDL_DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a haptic device.
|
||||
|
@ -957,7 +958,7 @@ extern DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count);
|
|||
* \sa SDL_GetHapticName
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetHapticInstanceName(SDL_HapticID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticInstanceName(SDL_HapticID instance_id);
|
||||
|
||||
/**
|
||||
* Open a haptic device for use.
|
||||
|
@ -982,7 +983,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetHapticInstanceName(SDL_HapticID insta
|
|||
* \sa SDL_SetHapticAutocenter
|
||||
* \sa SDL_SetHapticGain
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -994,7 +995,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromInstanceID(SDL_HapticID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromInstanceID(SDL_HapticID instance_id);
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened haptic device.
|
||||
|
@ -1005,7 +1006,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromInstanceID(SDL_HapticID ins
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticInstanceID(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticInstanceID(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a haptic device.
|
||||
|
@ -1019,7 +1020,7 @@ extern DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticInstanceID(SDL_Haptic *haptic)
|
|||
*
|
||||
* \sa SDL_GetHapticInstanceName
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Query whether or not the current mouse has haptic capabilities.
|
||||
|
@ -1030,7 +1031,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
|||
*
|
||||
* \sa SDL_OpenHapticFromMouse
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void);
|
||||
|
||||
/**
|
||||
* Try to open a haptic device from the current mouse.
|
||||
|
@ -1043,7 +1044,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void);
|
|||
* \sa SDL_CloseHaptic
|
||||
* \sa SDL_IsMouseHaptic
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromMouse(void);
|
||||
extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromMouse(void);
|
||||
|
||||
/**
|
||||
* Query if a joystick has haptic features.
|
||||
|
@ -1055,7 +1056,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromMouse(void);
|
|||
*
|
||||
* \sa SDL_OpenHapticFromJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Open a haptic device for use from a joystick device.
|
||||
|
@ -1077,7 +1078,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
|
|||
* \sa SDL_CloseHaptic
|
||||
* \sa SDL_IsJoystickHaptic
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromJoystick(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromJoystick(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Close a haptic device previously opened with SDL_OpenHaptic().
|
||||
|
@ -1088,7 +1089,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromJoystick(SDL_Joystick *joy
|
|||
*
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseHaptic(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CloseHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the number of effects a haptic device can store.
|
||||
|
@ -1106,7 +1107,7 @@ extern DECLSPEC void SDLCALL SDL_CloseHaptic(SDL_Haptic *haptic);
|
|||
* \sa SDL_GetMaxHapticEffectsPlaying
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetMaxHapticEffects(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetMaxHapticEffects(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the number of effects a haptic device can play at the same time.
|
||||
|
@ -1123,7 +1124,7 @@ extern DECLSPEC int SDLCALL SDL_GetMaxHapticEffects(SDL_Haptic *haptic);
|
|||
* \sa SDL_GetMaxHapticEffects
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetMaxHapticEffectsPlaying(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetMaxHapticEffectsPlaying(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the haptic device's supported features in bitwise manner.
|
||||
|
@ -1137,7 +1138,7 @@ extern DECLSPEC int SDLCALL SDL_GetMaxHapticEffectsPlaying(SDL_Haptic *haptic);
|
|||
* \sa SDL_HapticEffectSupported
|
||||
* \sa SDL_GetMaxHapticEffects
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetHapticFeatures(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetHapticFeatures(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the number of haptic axes the device has.
|
||||
|
@ -1151,7 +1152,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetHapticFeatures(SDL_Haptic *haptic);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Check to see if an effect is supported by a haptic device.
|
||||
|
@ -1165,7 +1166,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
|
|||
* \sa SDL_CreateHapticEffect
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
|
||||
/**
|
||||
* Create a new haptic effect on a specified device.
|
||||
|
@ -1182,7 +1183,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, c
|
|||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_UpdateHapticEffect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
|
||||
/**
|
||||
* Update the properties of an effect.
|
||||
|
@ -1204,7 +1205,7 @@ extern DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL
|
|||
* \sa SDL_CreateHapticEffect
|
||||
* \sa SDL_RunHapticEffect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
|
||||
|
||||
/**
|
||||
* Run the haptic effect on its associated haptic device.
|
||||
|
@ -1228,7 +1229,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effec
|
|||
* \sa SDL_StopHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
|
||||
|
||||
/**
|
||||
* Stop the haptic effect on its associated haptic device.
|
||||
|
@ -1243,7 +1244,7 @@ extern DECLSPEC int SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect,
|
|||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Destroy a haptic effect on the device.
|
||||
|
@ -1258,7 +1259,7 @@ extern DECLSPEC int SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect)
|
|||
*
|
||||
* \sa SDL_CreateHapticEffect
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Get the status of the current effect on the specified haptic device.
|
||||
|
@ -1272,7 +1273,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int eff
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Set the global gain of the specified haptic device.
|
||||
|
@ -1293,7 +1294,7 @@ extern DECLSPEC int SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int ef
|
|||
*
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
|
||||
|
||||
/**
|
||||
* Set the global autocenter of the device.
|
||||
|
@ -1312,7 +1313,7 @@ extern DECLSPEC int SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
|
|||
*
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
|
||||
|
||||
/**
|
||||
* Pause a haptic device.
|
||||
|
@ -1331,7 +1332,7 @@ extern DECLSPEC int SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int auto
|
|||
*
|
||||
* \sa SDL_ResumeHaptic
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Resume a haptic device.
|
||||
|
@ -1346,7 +1347,7 @@ extern DECLSPEC int SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
|||
*
|
||||
* \sa SDL_PauseHaptic
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Stop all the currently playing effects on a haptic device.
|
||||
|
@ -1360,7 +1361,7 @@ extern DECLSPEC int SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
|||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Check whether rumble is supported on a haptic device.
|
||||
|
@ -1372,7 +1373,7 @@ extern DECLSPEC int SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
|
|||
*
|
||||
* \sa SDL_InitHapticRumble
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Initialize a haptic device for simple rumble playback.
|
||||
|
@ -1387,7 +1388,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
|
|||
* \sa SDL_StopHapticRumble
|
||||
* \sa SDL_HapticRumbleSupported
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Run a simple rumble effect on a haptic device.
|
||||
|
@ -1403,7 +1404,7 @@ extern DECLSPEC int SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
|||
* \sa SDL_InitHapticRumble
|
||||
* \sa SDL_StopHapticRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
|
||||
|
||||
/**
|
||||
* Stop the simple rumble on a haptic device.
|
||||
|
@ -1416,7 +1417,7 @@ extern DECLSPEC int SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float stren
|
|||
*
|
||||
* \sa SDL_PlayHapticRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,44 +19,49 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: HIDAPI */
|
||||
|
||||
/**
|
||||
* \file SDL_hidapi.h
|
||||
* # CategoryHIDAPI
|
||||
*
|
||||
* Header file for SDL HIDAPI functions.
|
||||
* Header file for SDL HIDAPI functions.
|
||||
*
|
||||
* This is an adaptation of the original HIDAPI interface by Alan Ott,
|
||||
* and includes source code licensed under the following BSD license:
|
||||
* This is an adaptation of the original HIDAPI interface by Alan Ott, and
|
||||
* includes source code licensed under the following BSD license:
|
||||
*
|
||||
Copyright (c) 2010, Alan Ott, Signal 11 Software
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Signal 11 Software nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
* ```
|
||||
* Copyright (c) 2010, Alan Ott, Signal 11 Software
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Signal 11 Software nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* ```
|
||||
*
|
||||
* If you would like a version of SDL without this code, you can build SDL
|
||||
* with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example
|
||||
* on iOS or tvOS to avoid a dependency on the CoreBluetooth framework.
|
||||
* with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for
|
||||
* example on iOS or tvOS to avoid a dependency on the CoreBluetooth
|
||||
* framework.
|
||||
*/
|
||||
|
||||
#ifndef SDL_hidapi_h_
|
||||
|
@ -183,7 +188,7 @@ typedef struct SDL_hid_device_info
|
|||
*
|
||||
* \sa SDL_hid_exit
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_init(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_init(void);
|
||||
|
||||
/**
|
||||
* Finalize the HIDAPI library.
|
||||
|
@ -198,7 +203,7 @@ extern DECLSPEC int SDLCALL SDL_hid_init(void);
|
|||
*
|
||||
* \sa SDL_hid_init
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_exit(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_exit(void);
|
||||
|
||||
/**
|
||||
* Check to see if devices may have been added or removed.
|
||||
|
@ -219,7 +224,7 @@ extern DECLSPEC int SDLCALL SDL_hid_exit(void);
|
|||
*
|
||||
* \sa SDL_hid_enumerate
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void);
|
||||
|
||||
/**
|
||||
* Enumerate the HID Devices.
|
||||
|
@ -247,7 +252,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void);
|
|||
*
|
||||
* \sa SDL_hid_device_change_count
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id);
|
||||
extern SDL_DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id);
|
||||
|
||||
/**
|
||||
* Free an enumeration linked list.
|
||||
|
@ -259,7 +264,7 @@ extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short v
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs);
|
||||
|
||||
/**
|
||||
* Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally
|
||||
|
@ -277,7 +282,7 @@ extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
|
||||
extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
|
||||
|
||||
/**
|
||||
* Open a HID device by its path name.
|
||||
|
@ -291,7 +296,7 @@ extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path);
|
||||
extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path);
|
||||
|
||||
/**
|
||||
* Write an Output report to a HID device.
|
||||
|
@ -317,7 +322,7 @@ extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Read an Input report from a HID device with timeout.
|
||||
|
@ -338,7 +343,7 @@ extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned ch
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds);
|
||||
|
||||
/**
|
||||
* Read an Input report from a HID device.
|
||||
|
@ -358,7 +363,7 @@ extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned c
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Set the device handle to be non-blocking.
|
||||
|
@ -377,7 +382,7 @@ extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *dat
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock);
|
||||
|
||||
/**
|
||||
* Send a Feature report to the device.
|
||||
|
@ -401,7 +406,7 @@ extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int non
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Get a feature report from a HID device.
|
||||
|
@ -423,7 +428,7 @@ extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, con
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Get an input report from a HID device.
|
||||
|
@ -445,7 +450,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsi
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_input_report(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_input_report(SDL_hid_device *dev, unsigned char *data, size_t length);
|
||||
|
||||
/**
|
||||
* Close a HID device.
|
||||
|
@ -456,7 +461,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_input_report(SDL_hid_device *dev, unsign
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_close(SDL_hid_device *dev);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_close(SDL_hid_device *dev);
|
||||
|
||||
/**
|
||||
* Get The Manufacturer String from a HID device.
|
||||
|
@ -469,7 +474,7 @@ extern DECLSPEC int SDLCALL SDL_hid_close(SDL_hid_device *dev);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get The Product String from a HID device.
|
||||
|
@ -482,7 +487,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get The Serial Number String from a HID device.
|
||||
|
@ -495,7 +500,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wcha
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get a string from a HID device, based on its string index.
|
||||
|
@ -509,7 +514,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Get the device info from a HID device.
|
||||
|
@ -522,7 +527,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_get_device_info(SDL_hid_device *dev);
|
||||
extern SDL_DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_get_device_info(SDL_hid_device *dev);
|
||||
|
||||
/**
|
||||
* Get a report descriptor from a HID device.
|
||||
|
@ -538,7 +543,7 @@ extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_get_device_info(SDL_hid_de
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_hid_get_report_descriptor(SDL_hid_device *dev, unsigned char *buf, size_t buf_size);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_hid_get_report_descriptor(SDL_hid_device *dev, unsigned char *buf, size_t buf_size);
|
||||
|
||||
/**
|
||||
* Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers.
|
||||
|
@ -547,7 +552,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_report_descriptor(SDL_hid_device *dev, u
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,20 +20,20 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_hints.h
|
||||
* # CategoryHints
|
||||
*
|
||||
* Official documentation for SDL configuration variables
|
||||
* Official documentation for SDL configuration variables
|
||||
*
|
||||
* This file contains functions to set and get configuration hints,
|
||||
* as well as listing each of them alphabetically.
|
||||
* This file contains functions to set and get configuration hints, as well as
|
||||
* listing each of them alphabetically.
|
||||
*
|
||||
* The convention for naming hints is SDL_HINT_X, where "SDL_X" is
|
||||
* the environment variable that can be used to override the default.
|
||||
* The convention for naming hints is SDL_HINT_X, where "SDL_X" is the
|
||||
* environment variable that can be used to override the default.
|
||||
*
|
||||
* In general these hints are just that - they may or may not be
|
||||
* supported or applicable on any given platform, but they provide
|
||||
* a way for an application or user to give the library a hint as
|
||||
* to how they would like the library to work.
|
||||
* In general these hints are just that - they may or may not be supported or
|
||||
* applicable on any given platform, but they provide a way for an application
|
||||
* or user to give the library a hint as to how they would like the library to
|
||||
* work.
|
||||
*/
|
||||
|
||||
#ifndef SDL_hints_h_
|
||||
|
@ -292,6 +292,29 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME"
|
||||
|
||||
/**
|
||||
* Specify an application icon name for an audio device.
|
||||
*
|
||||
* Some audio backends (such as Pulseaudio and Pipewire) allow you to set an
|
||||
* XDG icon name for your application. Among other things, this icon might
|
||||
* show up in a system control panel that lets the user adjust the volume on
|
||||
* specific audio streams instead of using one giant master volume slider.
|
||||
* Note that this is unrelated to the icon used by the windowing system, which
|
||||
* may be set with SDL_SetWindowIcon (or via desktop file on Wayland).
|
||||
*
|
||||
* Setting this to "" or leaving it unset will have SDL use a reasonable
|
||||
* default, "applications-games", which is likely to be installed. See
|
||||
* https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
|
||||
* and
|
||||
* https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
|
||||
* for the relevant XDG icon specs.
|
||||
*
|
||||
* This hint should be set before an audio device is opened.
|
||||
*
|
||||
* \since This hint is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_HINT_AUDIO_DEVICE_APP_ICON_NAME "SDL_AUDIO_DEVICE_APP_ICON_NAME"
|
||||
|
||||
/**
|
||||
* A variable controlling device buffer size.
|
||||
*
|
||||
|
@ -883,6 +906,20 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_GDK_TEXTINPUT_TITLE "SDL_GDK_TEXTINPUT_TITLE"
|
||||
|
||||
/**
|
||||
* A variable that specifies a GPU backend to use.
|
||||
*
|
||||
* By default, SDL will try all available GPU backends in a reasonable order
|
||||
* until it finds one that can work, but this hint allows the app or user to
|
||||
* force a specific target, such as "d3d11" if, say, your hardware supports
|
||||
* D3D12 but want to try using D3D11 instead.
|
||||
*
|
||||
* This hint should be set before SDL_GpuSelectBackend() is called.
|
||||
*
|
||||
* \since This hint is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_HINT_GPU_BACKEND "SDL_GPU_BACKEND"
|
||||
|
||||
/**
|
||||
* A variable to control whether SDL_hid_enumerate() enumerates all HID
|
||||
* devices or only controllers.
|
||||
|
@ -1350,6 +1387,21 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
|
||||
|
||||
/**
|
||||
* A variable controlling the update rate of the PS4 controller over Bluetooth
|
||||
* when using the HIDAPI driver.
|
||||
*
|
||||
* This defaults to 4 ms, to match the behavior over USB, and to be more
|
||||
* friendly to other Bluetooth devices and older Bluetooth hardware on the
|
||||
* computer. It can be set to "1" (1000Hz), "2" (500Hz) and "4" (250Hz)
|
||||
*
|
||||
* This hint can be set anytime, but only takes effect when extended input
|
||||
* reports are enabled.
|
||||
*
|
||||
* \since This hint is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL "SDL_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL"
|
||||
|
||||
/**
|
||||
* A variable controlling whether extended input reports should be used for
|
||||
* PS4 controllers when using the HIDAPI driver.
|
||||
|
@ -2547,22 +2599,6 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"
|
||||
|
||||
/**
|
||||
* A variable controlling whether vsync is automatically disabled if doesn't
|
||||
* reach enough FPS.
|
||||
*
|
||||
* The variable can be set to the following values:
|
||||
*
|
||||
* - "0": It will be using VSYNC as defined in the main flag. (default)
|
||||
* - "1": If VSYNC was previously enabled, then it will disable VSYNC if
|
||||
* doesn't reach enough speed
|
||||
*
|
||||
* This hint should be set before creating a renderer.
|
||||
*
|
||||
* \since This hint is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC "SDL_RENDER_PS2_DYNAMIC_VSYNC"
|
||||
|
||||
/**
|
||||
* A variable controlling whether updates to the SDL screen surface should be
|
||||
* synchronized with the vertical refresh, to avoid tearing.
|
||||
|
@ -2609,6 +2645,8 @@ extern "C" {
|
|||
* This hint should be set before SDL is initialized.
|
||||
*
|
||||
* \since This hint is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED
|
||||
*/
|
||||
#define SDL_HINT_ROG_GAMEPAD_MICE "SDL_ROG_GAMEPAD_MICE"
|
||||
|
||||
|
@ -3087,6 +3125,8 @@ extern "C" {
|
|||
/**
|
||||
* A variable forcing non-DPI-aware Wayland windows to output at 1:1 scaling.
|
||||
*
|
||||
* This must be set before initializing the video subsystem.
|
||||
*
|
||||
* When this hint is set, Wayland windows that are not flagged as being
|
||||
* DPI-aware will be output with scaling designed to force 1:1 pixel mapping.
|
||||
*
|
||||
|
@ -3095,12 +3135,15 @@ extern "C" {
|
|||
* configurations, as this forces the window to behave in a way that Wayland
|
||||
* desktops were not designed to accommodate:
|
||||
*
|
||||
* - Rounding errors can result with odd window sizes and/or desktop scales.
|
||||
* - The window may be unusably small.
|
||||
* - The window may jump in size at times.
|
||||
* - The window may appear to be larger than the desktop size to the
|
||||
* application.
|
||||
* - Possible loss of cursor precision.
|
||||
* - Rounding errors can result with odd window sizes and/or desktop scales,
|
||||
* which can cause the window contents to appear slightly blurry.
|
||||
* - The window may be unusably small on scaled desktops.
|
||||
* - The window may jump in size when moving between displays of different
|
||||
* scale factors.
|
||||
* - Displays may appear to overlap when using a multi-monitor setup with
|
||||
* scaling enabled.
|
||||
* - Possible loss of cursor precision due to the logical size of the window
|
||||
* being reduced.
|
||||
*
|
||||
* New applications should be designed with proper DPI awareness handling
|
||||
* instead of enabling this.
|
||||
|
@ -3720,7 +3763,7 @@ typedef enum SDL_HintPriority
|
|||
* \sa SDL_ResetHint
|
||||
* \sa SDL_SetHint
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
|
||||
const char *value,
|
||||
SDL_HintPriority priority);
|
||||
|
||||
|
@ -3741,7 +3784,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
|
|||
* \sa SDL_ResetHint
|
||||
* \sa SDL_SetHintWithPriority
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
|
||||
const char *value);
|
||||
|
||||
/**
|
||||
|
@ -3759,7 +3802,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
|
|||
* \sa SDL_SetHint
|
||||
* \sa SDL_ResetHints
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
|
||||
|
||||
/**
|
||||
* Reset all hints to the default values.
|
||||
|
@ -3772,7 +3815,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
|
|||
*
|
||||
* \sa SDL_ResetHint
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ResetHints(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void);
|
||||
|
||||
/**
|
||||
* Get the value of a hint.
|
||||
|
@ -3785,7 +3828,7 @@ extern DECLSPEC void SDLCALL SDL_ResetHints(void);
|
|||
* \sa SDL_SetHint
|
||||
* \sa SDL_SetHintWithPriority
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
||||
|
||||
/**
|
||||
* Get the boolean value of a hint variable.
|
||||
|
@ -3800,7 +3843,7 @@ extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
|
|||
* \sa SDL_GetHint
|
||||
* \sa SDL_SetHint
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
|
||||
|
||||
/**
|
||||
* Type definition of the hint callback function.
|
||||
|
@ -3828,7 +3871,7 @@ typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
|
|||
*
|
||||
* \sa SDL_DelHintCallback
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name,
|
||||
SDL_HintCallback callback,
|
||||
void *userdata);
|
||||
|
||||
|
@ -3844,7 +3887,7 @@ extern DECLSPEC int SDLCALL SDL_AddHintCallback(const char *name,
|
|||
*
|
||||
* \sa SDL_AddHintCallback
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
|
||||
SDL_HintCallback callback,
|
||||
void *userdata);
|
||||
|
||||
|
|
|
@ -20,11 +20,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_init.h
|
||||
* # CategoryInit
|
||||
*
|
||||
* Init and quit header for the SDL library
|
||||
* SDL subsystem init and quit functions.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_init_h_
|
||||
#define SDL_init_h_
|
||||
|
||||
|
@ -84,7 +85,8 @@ typedef Uint32 SDL_InitFlags;
|
|||
* `flags` may be any of the following OR'd together:
|
||||
*
|
||||
* - `SDL_INIT_TIMER`: timer subsystem
|
||||
* - `SDL_INIT_AUDIO`: audio subsystem
|
||||
* - `SDL_INIT_AUDIO`: audio subsystem; automatically initializes the events
|
||||
* subsystem
|
||||
* - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
|
||||
* subsystem
|
||||
* - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
|
||||
|
@ -93,7 +95,10 @@ typedef Uint32 SDL_InitFlags;
|
|||
* - `SDL_INIT_GAMEPAD`: gamepad subsystem; automatically initializes the
|
||||
* joystick subsystem
|
||||
* - `SDL_INIT_EVENTS`: events subsystem
|
||||
* - `SDL_INIT_SENSOR`: sensor subsystem
|
||||
* - `SDL_INIT_SENSOR`: sensor subsystem; automatically initializes the events
|
||||
* subsystem
|
||||
* - `SDL_INIT_CAMERA`: camera subsystem; automatically initializes the events
|
||||
* subsystem
|
||||
*
|
||||
* Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
|
||||
* for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
|
||||
|
@ -111,7 +116,7 @@ typedef Uint32 SDL_InitFlags;
|
|||
* \sa SDL_SetMainReady
|
||||
* \sa SDL_WasInit
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Init(SDL_InitFlags flags);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_Init(SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Compatibility function to initialize the SDL library.
|
||||
|
@ -128,7 +133,7 @@ extern DECLSPEC int SDLCALL SDL_Init(SDL_InitFlags flags);
|
|||
* \sa SDL_Quit
|
||||
* \sa SDL_QuitSubSystem
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Shut down specific SDL subsystems.
|
||||
|
@ -143,7 +148,7 @@ extern DECLSPEC int SDLCALL SDL_InitSubSystem(SDL_InitFlags flags);
|
|||
* \sa SDL_InitSubSystem
|
||||
* \sa SDL_Quit
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(SDL_InitFlags flags);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_QuitSubSystem(SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Get a mask of the specified subsystems which are currently initialized.
|
||||
|
@ -157,7 +162,7 @@ extern DECLSPEC void SDLCALL SDL_QuitSubSystem(SDL_InitFlags flags);
|
|||
* \sa SDL_Init
|
||||
* \sa SDL_InitSubSystem
|
||||
*/
|
||||
extern DECLSPEC SDL_InitFlags SDLCALL SDL_WasInit(SDL_InitFlags flags);
|
||||
extern SDL_DECLSPEC SDL_InitFlags SDLCALL SDL_WasInit(SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Clean up all initialized subsystems.
|
||||
|
@ -175,7 +180,7 @@ extern DECLSPEC SDL_InitFlags SDLCALL SDL_WasInit(SDL_InitFlags flags);
|
|||
* \sa SDL_Init
|
||||
* \sa SDL_QuitSubSystem
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_Quit(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_intrin.h
|
||||
*
|
||||
/*
|
||||
* Header file for CPU intrinsics for SDL
|
||||
*/
|
||||
|
||||
|
|
|
@ -19,14 +19,17 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: IOStream */
|
||||
|
||||
/**
|
||||
* \file SDL_iostream.h
|
||||
* # CategoryIOStream
|
||||
*
|
||||
* This file provides a general interface for SDL to read and write
|
||||
* data streams. It can easily be extended to files, memory, etc.
|
||||
* SDL provides an abstract interface for reading and writing data streams. It
|
||||
* offers implementations for files, memory, etc, and the app can provideo
|
||||
* their own implementations, too.
|
||||
*
|
||||
* SDL_IOStream is not related to the standard C++ iostream class, other
|
||||
* than both are abstract interfaces to read/write data.
|
||||
* SDL_IOStream is not related to the standard C++ iostream class, other than
|
||||
* both are abstract interfaces to read/write data.
|
||||
*/
|
||||
|
||||
#ifndef SDL_iostream_h_
|
||||
|
@ -213,7 +216,7 @@ typedef struct SDL_IOStream SDL_IOStream;
|
|||
* \sa SDL_TellIO
|
||||
* \sa SDL_WriteIO
|
||||
*/
|
||||
extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromFile(const char *file, const char *mode);
|
||||
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromFile(const char *file, const char *mode);
|
||||
|
||||
#define SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER "SDL.iostream.windows.handle"
|
||||
#define SDL_PROP_IOSTREAM_STDIO_FILE_POINTER "SDL.iostream.stdio.file"
|
||||
|
@ -248,7 +251,7 @@ extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromFile(const char *file, const cha
|
|||
* \sa SDL_TellIO
|
||||
* \sa SDL_WriteIO
|
||||
*/
|
||||
extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromMem(void *mem, size_t size);
|
||||
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromMem(void *mem, size_t size);
|
||||
|
||||
/**
|
||||
* Use this function to prepare a read-only memory buffer for use with
|
||||
|
@ -280,7 +283,7 @@ extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromMem(void *mem, size_t size);
|
|||
* \sa SDL_SeekIO
|
||||
* \sa SDL_TellIO
|
||||
*/
|
||||
extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromConstMem(const void *mem, size_t size);
|
||||
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromConstMem(const void *mem, size_t size);
|
||||
|
||||
/**
|
||||
* Use this function to create an SDL_IOStream that is backed by dynamically
|
||||
|
@ -305,7 +308,7 @@ extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromConstMem(const void *mem, size_t
|
|||
* \sa SDL_TellIO
|
||||
* \sa SDL_WriteIO
|
||||
*/
|
||||
extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromDynamicMem(void);
|
||||
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromDynamicMem(void);
|
||||
|
||||
#define SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER "SDL.iostream.dynamic.memory"
|
||||
#define SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER "SDL.iostream.dynamic.chunksize"
|
||||
|
@ -339,7 +342,7 @@ extern DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromDynamicMem(void);
|
|||
* \sa SDL_IOFromFile
|
||||
* \sa SDL_IOFromMem
|
||||
*/
|
||||
extern DECLSPEC SDL_IOStream *SDLCALL SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata);
|
||||
extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata);
|
||||
|
||||
/**
|
||||
* Close and free an allocated SDL_IOStream structure.
|
||||
|
@ -360,7 +363,7 @@ extern DECLSPEC SDL_IOStream *SDLCALL SDL_OpenIO(const SDL_IOStreamInterface *if
|
|||
*
|
||||
* \sa SDL_OpenIO
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CloseIO(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CloseIO(SDL_IOStream *context);
|
||||
|
||||
/**
|
||||
* Get the properties associated with an SDL_IOStream.
|
||||
|
@ -374,7 +377,7 @@ extern DECLSPEC int SDLCALL SDL_CloseIO(SDL_IOStream *context);
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetIOProperties(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetIOProperties(SDL_IOStream *context);
|
||||
|
||||
/* Possible `whence` values for SDL_IOStream seeking... */
|
||||
#define SDL_IO_SEEK_SET 0 /**< Seek from the beginning of data */
|
||||
|
@ -400,7 +403,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetIOProperties(SDL_IOStream *conte
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_IOStatus SDLCALL SDL_GetIOStatus(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC SDL_IOStatus SDLCALL SDL_GetIOStatus(SDL_IOStream *context);
|
||||
|
||||
/**
|
||||
* Use this function to get the size of the data stream in an SDL_IOStream.
|
||||
|
@ -412,7 +415,7 @@ extern DECLSPEC SDL_IOStatus SDLCALL SDL_GetIOStatus(SDL_IOStream *context);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_GetIOSize(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetIOSize(SDL_IOStream *context);
|
||||
|
||||
/**
|
||||
* Seek within an SDL_IOStream data stream.
|
||||
|
@ -439,7 +442,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_GetIOSize(SDL_IOStream *context);
|
|||
*
|
||||
* \sa SDL_TellIO
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_SeekIO(SDL_IOStream *context, Sint64 offset, int whence);
|
||||
extern SDL_DECLSPEC Sint64 SDLCALL SDL_SeekIO(SDL_IOStream *context, Sint64 offset, int whence);
|
||||
|
||||
/**
|
||||
* Determine the current read/write offset in an SDL_IOStream data stream.
|
||||
|
@ -457,7 +460,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_SeekIO(SDL_IOStream *context, Sint64 offset,
|
|||
*
|
||||
* \sa SDL_SeekIO
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context);
|
||||
extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context);
|
||||
|
||||
/**
|
||||
* Read from a data source.
|
||||
|
@ -478,7 +481,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context);
|
|||
* \sa SDL_WriteIO
|
||||
* \sa SDL_GetIOStatus
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_ReadIO(SDL_IOStream *context, void *ptr, size_t size);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_ReadIO(SDL_IOStream *context, void *ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Write to an SDL_IOStream data stream.
|
||||
|
@ -507,7 +510,7 @@ extern DECLSPEC size_t SDLCALL SDL_ReadIO(SDL_IOStream *context, void *ptr, size
|
|||
* \sa SDL_SeekIO
|
||||
* \sa SDL_GetIOStatus
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteIO(SDL_IOStream *context, const void *ptr, size_t size);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_WriteIO(SDL_IOStream *context, const void *ptr, size_t size);
|
||||
|
||||
/**
|
||||
* Print to an SDL_IOStream data stream.
|
||||
|
@ -526,7 +529,7 @@ extern DECLSPEC size_t SDLCALL SDL_WriteIO(SDL_IOStream *context, const void *pt
|
|||
* \sa SDL_IOvprintf
|
||||
* \sa SDL_WriteIO
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_IOprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_IOprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Print to an SDL_IOStream data stream.
|
||||
|
@ -544,7 +547,7 @@ extern DECLSPEC size_t SDLCALL SDL_IOprintf(SDL_IOStream *context, SDL_PRINTF_FO
|
|||
* \sa SDL_IOprintf
|
||||
* \sa SDL_WriteIO
|
||||
*/
|
||||
extern DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2);
|
||||
|
||||
/**
|
||||
* Load all the data from an SDL data stream.
|
||||
|
@ -565,7 +568,7 @@ extern DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_F
|
|||
*
|
||||
* \sa SDL_LoadFile
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Load all the data from a file path.
|
||||
|
@ -584,7 +587,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasiz
|
|||
*
|
||||
* \sa SDL_LoadFile_IO
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
||||
|
||||
/**
|
||||
* \name Read endian functions
|
||||
|
@ -603,7 +606,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of little-endian data from an
|
||||
|
@ -619,7 +622,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU8(SDL_IOStream *src, Uint8 *value);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of little-endian data from an
|
||||
|
@ -635,7 +638,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of big-endian data from an SDL_IOStream
|
||||
|
@ -651,7 +654,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 16 bits of big-endian data from an SDL_IOStream
|
||||
|
@ -667,7 +670,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of little-endian data from an
|
||||
|
@ -683,7 +686,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of little-endian data from an
|
||||
|
@ -699,7 +702,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of big-endian data from an SDL_IOStream
|
||||
|
@ -715,7 +718,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 32 bits of big-endian data from an SDL_IOStream
|
||||
|
@ -731,7 +734,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of little-endian data from an
|
||||
|
@ -747,7 +750,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of little-endian data from an
|
||||
|
@ -763,7 +766,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of big-endian data from an SDL_IOStream
|
||||
|
@ -779,7 +782,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);
|
||||
|
||||
/**
|
||||
* Use this function to read 64 bits of big-endian data from an SDL_IOStream
|
||||
|
@ -795,7 +798,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);
|
||||
/* @} *//* Read endian functions */
|
||||
|
||||
/**
|
||||
|
@ -815,7 +818,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
|
@ -832,7 +835,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
|
@ -849,7 +852,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
|
@ -865,7 +868,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 16 bits in native format to an SDL_IOStream as
|
||||
|
@ -881,7 +884,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
|
@ -898,7 +901,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
|
@ -915,7 +918,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
|
@ -931,7 +934,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 32 bits in native format to an SDL_IOStream as
|
||||
|
@ -947,7 +950,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
|
@ -964,7 +967,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
|
@ -981,7 +984,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
|
@ -997,7 +1000,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value);
|
||||
|
||||
/**
|
||||
* Use this function to write 64 bits in native format to an SDL_IOStream as
|
||||
|
@ -1013,7 +1016,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value);
|
||||
|
||||
/* @} *//* Write endian functions */
|
||||
|
||||
|
|
|
@ -20,19 +20,26 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_joystick.h
|
||||
* # CategoryJoystick
|
||||
*
|
||||
* Include file for SDL joystick event handling
|
||||
* SDL joystick support.
|
||||
*
|
||||
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
|
||||
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
|
||||
* This is the lower-level joystick handling. If you want the simpler option,
|
||||
* where what buttons does what is well-defined, you should use the gamepad
|
||||
* API instead.
|
||||
*
|
||||
* The term "player_index" is the number assigned to a player on a specific
|
||||
* controller. For XInput controllers this returns the XInput user index.
|
||||
* Many joysticks will not be able to supply this information.
|
||||
* The term "instance_id" is the current instantiation of a joystick device in
|
||||
* the system, if the joystick is removed and then re-inserted then it will
|
||||
* get a new instance_id, instance_id's are monotonically increasing
|
||||
* identifiers of a joystick plugged in.
|
||||
*
|
||||
* The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
|
||||
* the device (a X360 wired controller for example). This identifier is platform dependent.
|
||||
* The term "player_index" is the number assigned to a player on a specific
|
||||
* controller. For XInput controllers this returns the XInput user index. Many
|
||||
* joysticks will not be able to supply this information.
|
||||
*
|
||||
* The term SDL_JoystickGUID is a stable 128-bit identifier for a joystick
|
||||
* device that does not change over time, it identifies class of the device (a
|
||||
* X360 wired controller for example). This identifier is platform dependent.
|
||||
*/
|
||||
|
||||
#ifndef SDL_joystick_h_
|
||||
|
@ -44,6 +51,7 @@
|
|||
#include <SDL3/SDL_mutex.h>
|
||||
#include <SDL3/SDL_power.h>
|
||||
#include <SDL3/SDL_properties.h>
|
||||
#include <SDL3/SDL_sensor.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
@ -55,7 +63,7 @@ extern "C" {
|
|||
* \file SDL_joystick.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
|
||||
* for joysticks, and load appropriate drivers.
|
||||
*
|
||||
* If you would like to receive joystick updates while the application
|
||||
|
@ -183,14 +191,14 @@ typedef enum SDL_JoystickConnectionState
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||
|
||||
/**
|
||||
* Unlocking for atomic access to the joystick API.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
|
||||
|
||||
/**
|
||||
* Return whether a joystick is currently connected.
|
||||
|
@ -201,7 +209,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_
|
|||
*
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected joysticks.
|
||||
|
@ -216,7 +224,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
|
|||
* \sa SDL_HasJoystick
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count);
|
||||
extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
|
@ -232,7 +240,7 @@ extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count);
|
|||
* \sa SDL_GetJoystickName
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent path of a joystick.
|
||||
|
@ -248,7 +256,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_JoystickID i
|
|||
* \sa SDL_GetJoystickPath
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the player index of a joystick.
|
||||
|
@ -263,7 +271,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_JoystickID i
|
|||
* \sa SDL_GetJoystickPlayerIndex
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent GUID of a joystick.
|
||||
|
@ -279,7 +287,7 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID in
|
|||
* \sa SDL_GetJoystickGUID
|
||||
* \sa SDL_GetJoystickGUIDString
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickInstanceGUID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickInstanceGUID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of a joystick, if available.
|
||||
|
@ -296,7 +304,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickInstanceGUID(SDL_Joystic
|
|||
* \sa SDL_GetJoystickVendor
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the USB product ID of a joystick, if available.
|
||||
|
@ -313,7 +321,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID inst
|
|||
* \sa SDL_GetJoystickProduct
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the product version of a joystick, if available.
|
||||
|
@ -330,7 +338,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID ins
|
|||
* \sa SDL_GetJoystickProductVersion
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the type of a joystick, if available.
|
||||
|
@ -347,7 +355,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_Joystic
|
|||
* \sa SDL_GetJoystickType
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickInstanceType(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Open a joystick for use.
|
||||
|
@ -363,7 +371,7 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickInstanceType(SDL_Joystic
|
|||
*
|
||||
* \sa SDL_CloseJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the SDL_Joystick associated with an instance ID, if it has been opened.
|
||||
|
@ -374,7 +382,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_i
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Get the SDL_Joystick associated with a player index.
|
||||
|
@ -388,31 +396,65 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_Joystick
|
|||
* \sa SDL_GetJoystickPlayerIndex
|
||||
* \sa SDL_SetJoystickPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index);
|
||||
extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index);
|
||||
|
||||
/**
|
||||
* The structure that defines an extended virtual joystick description
|
||||
* The structure that describes a virtual joystick touchpad.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_VirtualJoystickDesc
|
||||
*/
|
||||
typedef struct SDL_VirtualJoystickTouchpadDesc
|
||||
{
|
||||
Uint16 nfingers; /**< the number of simultaneous fingers on this touchpad */
|
||||
Uint16 padding[3];
|
||||
} SDL_VirtualJoystickTouchpadDesc;
|
||||
|
||||
/**
|
||||
* The structure that describes a virtual joystick sensor.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_VirtualJoystickDesc
|
||||
*/
|
||||
typedef struct SDL_VirtualJoystickSensorDesc
|
||||
{
|
||||
SDL_SensorType type; /**< the type of this sensor */
|
||||
float rate; /**< the update frequency of this sensor, may be 0.0f */
|
||||
} SDL_VirtualJoystickSensorDesc;
|
||||
|
||||
/**
|
||||
* The structure that describes a virtual joystick.
|
||||
*
|
||||
* All elements of this structure are optional and can be left 0.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AttachVirtualJoystick
|
||||
* \sa SDL_VirtualJoystickSensorDesc
|
||||
* \sa SDL_VirtualJoystickTouchpadDesc
|
||||
*/
|
||||
typedef struct SDL_VirtualJoystickDesc
|
||||
{
|
||||
Uint16 type; /**< `SDL_JoystickType` */
|
||||
Uint16 naxes; /**< the number of axes on this joystick */
|
||||
Uint16 nbuttons; /**< the number of buttons on this joystick */
|
||||
Uint16 nhats; /**< the number of hats on this joystick */
|
||||
Uint16 padding; /**< unused */
|
||||
Uint16 vendor_id; /**< the USB vendor ID of this joystick */
|
||||
Uint16 product_id; /**< the USB product ID of this joystick */
|
||||
Uint16 padding; /**< unused */
|
||||
Uint16 naxes; /**< the number of axes on this joystick */
|
||||
Uint16 nbuttons; /**< the number of buttons on this joystick */
|
||||
Uint16 nballs; /**< the number of balls on this joystick */
|
||||
Uint16 nhats; /**< the number of hats on this joystick */
|
||||
Uint16 ntouchpads; /**< the number of touchpads on this joystick, requires `touchpads` to point at valid descriptions */
|
||||
Uint16 nsensors; /**< the number of sensors on this joystick, requires `sensors` to point at valid descriptions */
|
||||
Uint16 padding2[2]; /**< unused */
|
||||
Uint32 button_mask; /**< A mask of which buttons are valid for this controller
|
||||
e.g. (1u << SDL_GAMEPAD_BUTTON_SOUTH) */
|
||||
e.g. (1 << SDL_GAMEPAD_BUTTON_SOUTH) */
|
||||
Uint32 axis_mask; /**< A mask of which axes are valid for this controller
|
||||
e.g. (1u << SDL_GAMEPAD_AXIS_LEFTX) */
|
||||
e.g. (1 << SDL_GAMEPAD_AXIS_LEFTX) */
|
||||
const char *name; /**< the name of the joystick */
|
||||
const SDL_VirtualJoystickTouchpadDesc *touchpads; /**< A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0 */
|
||||
const SDL_VirtualJoystickSensorDesc *sensors; /**< A pointer to an array of sensor descriptions, required if `nsensors` is > 0 */
|
||||
|
||||
void *userdata; /**< User data pointer passed to callbacks */
|
||||
void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
|
||||
|
@ -421,6 +463,7 @@ typedef struct SDL_VirtualJoystickDesc
|
|||
int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_RumbleJoystickTriggers() */
|
||||
int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_SetJoystickLED() */
|
||||
int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_SendJoystickEffect() */
|
||||
int (SDLCALL *SetSensorsEnabled)(void *userdata, SDL_bool enabled); /**< Implements SDL_SetGamepadSensorEnabled() */
|
||||
} SDL_VirtualJoystickDesc;
|
||||
|
||||
/**
|
||||
|
@ -434,7 +477,7 @@ typedef struct SDL_VirtualJoystickDesc
|
|||
*
|
||||
* \sa SDL_DetachVirtualJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_VirtualJoystickDesc *desc);
|
||||
extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_VirtualJoystickDesc *desc);
|
||||
|
||||
/**
|
||||
* Detach a virtual joystick.
|
||||
|
@ -448,7 +491,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_Virtu
|
|||
*
|
||||
* \sa SDL_AttachVirtualJoystick
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Query whether or not a joystick is virtual.
|
||||
|
@ -458,10 +501,10 @@ extern DECLSPEC int SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
|
||||
|
||||
/**
|
||||
* Set values on an opened, virtual-joystick's axis.
|
||||
* Set the state of an axis on an opened virtual joystick.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_UpdateJoysticks, which can either be called directly, or can be called
|
||||
|
@ -474,17 +517,17 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_i
|
|||
* `SDL_JOYSTICK_AXIS_MIN`.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param axis the specific axis on the virtual joystick to set.
|
||||
* \param axis the index of the axis on the virtual joystick to update.
|
||||
* \param value the new value for the specified axis.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
|
||||
|
||||
/**
|
||||
* Set values on an opened, virtual-joystick's button.
|
||||
* Generate ball motion on an opened virtual joystick.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_UpdateJoysticks, which can either be called directly, or can be called
|
||||
|
@ -493,17 +536,37 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, i
|
|||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param button the specific button on the virtual joystick to set.
|
||||
* \param ball the index of the ball on the virtual joystick to update.
|
||||
* \param xrel the relative motion on the X axis.
|
||||
* \param yrel the relative motion on the Y axis.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel);
|
||||
|
||||
/**
|
||||
* Set the state of a button on an opened virtual joystick.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_UpdateJoysticks, which can either be called directly, or can be called
|
||||
* indirectly through various other SDL APIs, including, but not limited to
|
||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param button the index of the button on the virtual joystick to update.
|
||||
* \param value the new value for the specified button.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
|
||||
|
||||
/**
|
||||
* Set values on an opened, virtual-joystick's hat.
|
||||
* Set the state of a hat on an opened virtual joystick.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_UpdateJoysticks, which can either be called directly, or can be called
|
||||
|
@ -512,14 +575,63 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joystick,
|
|||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param hat the specific hat on the virtual joystick to set.
|
||||
* \param hat the index of the hat on the virtual joystick to update.
|
||||
* \param value the new value for the specified hat.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
|
||||
|
||||
/**
|
||||
* Set touchpad finger state on an opened virtual joystick.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_UpdateJoysticks, which can either be called directly, or can be called
|
||||
* indirectly through various other SDL APIs, including, but not limited to
|
||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param touchpad the index of the touchpad on the virtual joystick to
|
||||
* update.
|
||||
* \param finger the index of the finger on the touchpad to set.
|
||||
* \param state `SDL_PRESSED` if the finger is pressed, `SDL_RELEASED` if the
|
||||
* finger is released
|
||||
* \param x the x coordinate of the finger on the touchpad, normalized 0 to 1,
|
||||
* with the origin in the upper left
|
||||
* \param y the y coordinate of the finger on the touchpad, normalized 0 to 1,
|
||||
* with the origin in the upper left
|
||||
* \param pressure the pressure of the finger
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, Uint8 state, float x, float y, float pressure);
|
||||
|
||||
/**
|
||||
* Send a sensor update for an opened virtual joystick.
|
||||
*
|
||||
* Please note that values set here will not be applied until the next call to
|
||||
* SDL_UpdateJoysticks, which can either be called directly, or can be called
|
||||
* indirectly through various other SDL APIs, including, but not limited to
|
||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||
* SDL_WaitEvent.
|
||||
*
|
||||
* \param joystick the virtual joystick on which to set state.
|
||||
* \param type the type of the sensor on the virtual joystick to update.
|
||||
* \param sensor_timestamp a 64-bit timestamp in nanoseconds associated with
|
||||
* the sensor reading
|
||||
* \param data the data associated with the sensor reading
|
||||
* \param num_values the number of values pointed to by `data`
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a joystick.
|
||||
|
@ -546,7 +658,7 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, in
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick *joystick);
|
||||
|
||||
#define SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN "SDL.joystick.cap.mono_led"
|
||||
#define SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN "SDL.joystick.cap.rgb_led"
|
||||
|
@ -565,7 +677,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick
|
|||
*
|
||||
* \sa SDL_GetJoystickInstanceName
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent path of a joystick.
|
||||
|
@ -578,7 +690,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
|
|||
*
|
||||
* \sa SDL_GetJoystickInstancePath
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the player index of an opened joystick.
|
||||
|
@ -593,7 +705,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
|
|||
*
|
||||
* \sa SDL_SetJoystickPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Set the player index of an opened joystick.
|
||||
|
@ -608,7 +720,7 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
|
|||
*
|
||||
* \sa SDL_GetJoystickPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
|
||||
|
||||
/**
|
||||
* Get the implementation-dependent GUID for the joystick.
|
||||
|
@ -625,7 +737,7 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, i
|
|||
* \sa SDL_GetJoystickInstanceGUID
|
||||
* \sa SDL_GetJoystickGUIDString
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the USB vendor ID of an opened joystick, if available.
|
||||
|
@ -639,7 +751,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joyst
|
|||
*
|
||||
* \sa SDL_GetJoystickInstanceVendor
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the USB product ID of an opened joystick, if available.
|
||||
|
@ -653,7 +765,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
|
|||
*
|
||||
* \sa SDL_GetJoystickInstanceProduct
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the product version of an opened joystick, if available.
|
||||
|
@ -667,7 +779,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
|
|||
*
|
||||
* \sa SDL_GetJoystickInstanceProductVersion
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the firmware version of an opened joystick, if available.
|
||||
|
@ -680,7 +792,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joyst
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the serial number of an opened joystick, if available.
|
||||
|
@ -693,7 +805,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick *joys
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the type of an opened joystick.
|
||||
|
@ -705,7 +817,7 @@ extern DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystic
|
|||
*
|
||||
* \sa SDL_GetJoystickInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get an ASCII string representation for a given SDL_JoystickGUID.
|
||||
|
@ -724,7 +836,7 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joyst
|
|||
* \sa SDL_GetJoystickGUID
|
||||
* \sa SDL_GetJoystickGUIDFromString
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
|
||||
|
||||
/**
|
||||
* Convert a GUID string into a SDL_JoystickGUID structure.
|
||||
|
@ -740,7 +852,7 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, cha
|
|||
*
|
||||
* \sa SDL_GetJoystickGUIDString
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const char *pchGUID);
|
||||
extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const char *pchGUID);
|
||||
|
||||
/**
|
||||
* Get the device information encoded in a SDL_JoystickGUID structure.
|
||||
|
@ -759,7 +871,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const cha
|
|||
*
|
||||
* \sa SDL_GetJoystickInstanceGUID
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
|
||||
|
||||
/**
|
||||
* Get the status of a specified joystick.
|
||||
|
@ -770,7 +882,7 @@ extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened joystick.
|
||||
|
@ -781,7 +893,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of general axis controls on a joystick.
|
||||
|
@ -802,7 +914,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *j
|
|||
* \sa SDL_GetNumJoystickButtons
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of trackballs on a joystick.
|
||||
|
@ -823,7 +935,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
|
|||
* \sa SDL_GetNumJoystickButtons
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of POV hats on a joystick.
|
||||
|
@ -839,7 +951,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
|
|||
* \sa SDL_GetNumJoystickBalls
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of buttons on a joystick.
|
||||
|
@ -855,7 +967,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
|
|||
* \sa SDL_GetNumJoystickBalls
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Set the state of joystick event processing.
|
||||
|
@ -871,7 +983,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
|
|||
* \sa SDL_JoystickEventsEnabled
|
||||
* \sa SDL_UpdateJoysticks
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Query the state of joystick event processing.
|
||||
|
@ -887,7 +999,7 @@ extern DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
|
|||
*
|
||||
* \sa SDL_SetJoystickEventsEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickEventsEnabled(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickEventsEnabled(void);
|
||||
|
||||
/**
|
||||
* Update the current state of the open joysticks.
|
||||
|
@ -897,7 +1009,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickEventsEnabled(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateJoysticks(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UpdateJoysticks(void);
|
||||
|
||||
/**
|
||||
* Get the current state of an axis control on a joystick.
|
||||
|
@ -921,7 +1033,7 @@ extern DECLSPEC void SDLCALL SDL_UpdateJoysticks(void);
|
|||
*
|
||||
* \sa SDL_GetNumJoystickAxes
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis);
|
||||
extern SDL_DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis);
|
||||
|
||||
/**
|
||||
* Get the initial state of an axis control on a joystick.
|
||||
|
@ -937,7 +1049,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, int a
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
|
||||
|
||||
/**
|
||||
* Get the ball axis change since the last poll.
|
||||
|
@ -958,7 +1070,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *j
|
|||
*
|
||||
* \sa SDL_GetNumJoystickBalls
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
|
||||
/**
|
||||
* Get the current state of a POV hat on a joystick.
|
||||
|
@ -973,7 +1085,7 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball
|
|||
*
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int hat);
|
||||
extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int hat);
|
||||
|
||||
#define SDL_HAT_CENTERED 0x00u
|
||||
#define SDL_HAT_UP 0x01u
|
||||
|
@ -997,7 +1109,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int hat
|
|||
*
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
|
||||
extern SDL_DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
|
||||
|
||||
/**
|
||||
* Start a rumble effect.
|
||||
|
@ -1018,7 +1130,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Start a rumble effect in the joystick's triggers.
|
||||
|
@ -1047,7 +1159,7 @@ extern DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 lo
|
|||
*
|
||||
* \sa SDL_RumbleJoystick
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Update a joystick's LED color.
|
||||
|
@ -1067,7 +1179,7 @@ extern DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, U
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
|
||||
|
||||
/**
|
||||
* Send a joystick specific effect packet.
|
||||
|
@ -1080,7 +1192,7 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size);
|
||||
|
||||
/**
|
||||
* Close a joystick previously opened with SDL_OpenJoystick().
|
||||
|
@ -1091,7 +1203,7 @@ extern DECLSPEC int SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const
|
|||
*
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the connection state of a joystick.
|
||||
|
@ -1103,7 +1215,7 @@ extern DECLSPEC void SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetJoystickConnectionState(SDL_Joystick *joystick);
|
||||
extern SDL_DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetJoystickConnectionState(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the battery state of a joystick.
|
||||
|
@ -1124,7 +1236,7 @@ extern DECLSPEC SDL_JoystickConnectionState SDLCALL SDL_GetJoystickConnectionSta
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetJoystickPowerInfo(SDL_Joystick *joystick, int *percent);
|
||||
extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetJoystickPowerInfo(SDL_Joystick *joystick, int *percent);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_keyboard.h
|
||||
* # CategoryKeyboard
|
||||
*
|
||||
* Include file for SDL keyboard event handling
|
||||
* SDL keyboard management.
|
||||
*/
|
||||
|
||||
#ifndef SDL_keyboard_h_
|
||||
|
@ -56,16 +56,19 @@ typedef Uint32 SDL_KeyboardID;
|
|||
* The SDL keysym structure, used in key events.
|
||||
*
|
||||
* If you are looking for translated character input, see the
|
||||
* ::SDL_EVENT_TEXT_INPUT event.
|
||||
* SDL_EVENT_TEXT_INPUT event.
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Scancode
|
||||
* \sa SDL_Keycode
|
||||
*/
|
||||
typedef struct SDL_Keysym
|
||||
{
|
||||
SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
|
||||
SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */
|
||||
Uint16 mod; /**< current key modifiers */
|
||||
Uint32 unused;
|
||||
SDL_Scancode scancode; /**< SDL physical key code - see SDL_Scancode for details */
|
||||
SDL_Keycode sym; /**< SDL virtual key code - see SDL_Keycode for details */
|
||||
SDL_Keymod mod; /**< current key modifiers */
|
||||
Uint16 unused;
|
||||
} SDL_Keysym;
|
||||
|
||||
/* Function prototypes */
|
||||
|
@ -79,7 +82,7 @@ typedef struct SDL_Keysym
|
|||
*
|
||||
* \sa SDL_GetKeyboards
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected keyboards.
|
||||
|
@ -99,7 +102,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
|
|||
* \sa SDL_GetKeyboardInstanceName
|
||||
* \sa SDL_HasKeyboard
|
||||
*/
|
||||
extern DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count);
|
||||
extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count);
|
||||
|
||||
/**
|
||||
* Get the name of a keyboard.
|
||||
|
@ -114,7 +117,7 @@ extern DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count);
|
|||
*
|
||||
* \sa SDL_GetKeyboards
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyboardInstanceName(SDL_KeyboardID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyboardInstanceName(SDL_KeyboardID instance_id);
|
||||
|
||||
/**
|
||||
* Query the window which currently has keyboard focus.
|
||||
|
@ -123,7 +126,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyboardInstanceName(SDL_KeyboardID i
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
||||
extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
||||
|
||||
/**
|
||||
* Get a snapshot of the current state of the keyboard.
|
||||
|
@ -154,7 +157,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
|||
* \sa SDL_PumpEvents
|
||||
* \sa SDL_ResetKeyboard
|
||||
*/
|
||||
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
extern SDL_DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||
|
||||
/**
|
||||
* Clear the state of the keyboard.
|
||||
|
@ -165,7 +168,7 @@ extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
|||
*
|
||||
* \sa SDL_GetKeyboardState
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
|
||||
|
||||
/**
|
||||
* Get the current key modifier state for the keyboard.
|
||||
|
@ -178,7 +181,7 @@ extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
|
|||
* \sa SDL_GetKeyboardState
|
||||
* \sa SDL_SetModState
|
||||
*/
|
||||
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
||||
extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
||||
|
||||
/**
|
||||
* Set the current key modifier state for the keyboard.
|
||||
|
@ -197,7 +200,7 @@ extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
|||
*
|
||||
* \sa SDL_GetModState
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
||||
|
||||
/**
|
||||
* Get the key code corresponding to the given scancode according to the
|
||||
|
@ -213,7 +216,7 @@ extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
|||
* \sa SDL_GetKeyName
|
||||
* \sa SDL_GetScancodeFromKey
|
||||
*/
|
||||
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
||||
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
||||
|
||||
/**
|
||||
* Get the scancode corresponding to the given key code according to the
|
||||
|
@ -229,7 +232,7 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode
|
|||
* \sa SDL_GetKeyFromScancode
|
||||
* \sa SDL_GetScancodeName
|
||||
*/
|
||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
||||
extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
||||
|
||||
/**
|
||||
* Get a human-readable name for a scancode.
|
||||
|
@ -254,7 +257,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
|||
* \sa SDL_GetScancodeFromKey
|
||||
* \sa SDL_GetScancodeFromName
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
||||
|
||||
/**
|
||||
* Get a scancode from a human-readable name.
|
||||
|
@ -269,7 +272,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
|||
* \sa SDL_GetScancodeFromKey
|
||||
* \sa SDL_GetScancodeName
|
||||
*/
|
||||
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
||||
extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
||||
|
||||
/**
|
||||
* Get a human-readable name for a key.
|
||||
|
@ -288,7 +291,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
|||
* \sa SDL_GetKeyFromScancode
|
||||
* \sa SDL_GetScancodeFromKey
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
||||
|
||||
/**
|
||||
* Get a key code from a human-readable name.
|
||||
|
@ -303,7 +306,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
|||
* \sa SDL_GetKeyName
|
||||
* \sa SDL_GetScancodeFromName
|
||||
*/
|
||||
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
||||
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
||||
|
||||
/**
|
||||
* Start accepting Unicode text input events.
|
||||
|
@ -322,7 +325,7 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
|||
* \sa SDL_SetTextInputRect
|
||||
* \sa SDL_StopTextInput
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
||||
|
||||
/**
|
||||
* Check whether or not Unicode text input events are enabled.
|
||||
|
@ -333,7 +336,7 @@ extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
|||
*
|
||||
* \sa SDL_StartTextInput
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(void);
|
||||
|
||||
/**
|
||||
* Stop receiving any text input events.
|
||||
|
@ -344,7 +347,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(void);
|
|||
*
|
||||
* \sa SDL_StartTextInput
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
||||
|
||||
/**
|
||||
* Dismiss the composition window/IME without disabling the subsystem.
|
||||
|
@ -354,7 +357,7 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
|||
* \sa SDL_StartTextInput
|
||||
* \sa SDL_StopTextInput
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
||||
|
||||
/**
|
||||
* Set the rectangle used to type Unicode text inputs.
|
||||
|
@ -379,7 +382,7 @@ extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
|||
*
|
||||
* \sa SDL_StartTextInput
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Check whether the platform has screen keyboard support.
|
||||
|
@ -392,7 +395,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
|
|||
* \sa SDL_StartTextInput
|
||||
* \sa SDL_ScreenKeyboardShown
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
||||
|
||||
/**
|
||||
* Check whether the screen keyboard is shown for given window.
|
||||
|
@ -404,7 +407,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
|||
*
|
||||
* \sa SDL_HasScreenKeyboardSupport
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenKeyboardShown(SDL_Window *window);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_keycode.h
|
||||
* # CategoryKeycode
|
||||
*
|
||||
* Defines constants which identify keyboard keys and modifiers.
|
||||
* Defines constants which identify keyboard keys and modifiers.
|
||||
*/
|
||||
|
||||
#ifndef SDL_keycode_h_
|
||||
|
@ -57,12 +57,12 @@ typedef Uint32 SDL_Keycode;
|
|||
#define SDLK_TAB '\t'
|
||||
#define SDLK_SPACE ' '
|
||||
#define SDLK_EXCLAIM '!'
|
||||
#define SDLK_QUOTEDBL '"'
|
||||
#define SDLK_DBLAPOSTROPHE '"'
|
||||
#define SDLK_HASH '#'
|
||||
#define SDLK_PERCENT '%'
|
||||
#define SDLK_DOLLAR '$'
|
||||
#define SDLK_AMPERSAND '&'
|
||||
#define SDLK_QUOTE '\''
|
||||
#define SDLK_APOSTROPHE '\''
|
||||
#define SDLK_LEFTPAREN '('
|
||||
#define SDLK_RIGHTPAREN ')'
|
||||
#define SDLK_ASTERISK '*'
|
||||
|
@ -93,7 +93,7 @@ typedef Uint32 SDL_Keycode;
|
|||
#define SDLK_RIGHTBRACKET ']'
|
||||
#define SDLK_CARET '^'
|
||||
#define SDLK_UNDERSCORE '_'
|
||||
#define SDLK_BACKQUOTE '`'
|
||||
#define SDLK_GRAVE '`'
|
||||
#define SDLK_a 'a'
|
||||
#define SDLK_b 'b'
|
||||
#define SDLK_c 'c'
|
||||
|
@ -300,7 +300,7 @@ typedef Uint32 SDL_Keycode;
|
|||
*
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*/
|
||||
typedef Uint32 SDL_Keymod;
|
||||
typedef Uint16 SDL_Keymod;
|
||||
|
||||
#define SDL_KMOD_NONE 0x0000u /**< no modifier is applicable. */
|
||||
#define SDL_KMOD_LSHIFT 0x0001u /**< the left Shift key is down. */
|
||||
|
|
|
@ -19,23 +19,25 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: SharedObject */
|
||||
|
||||
/**
|
||||
* \file SDL_loadso.h
|
||||
* # CategorySharedObject
|
||||
*
|
||||
* System dependent library loading routines
|
||||
* System-dependent library loading routines.
|
||||
*
|
||||
* Some things to keep in mind:
|
||||
* \li These functions only work on C function names. Other languages may
|
||||
* have name mangling and intrinsic language support that varies from
|
||||
* compiler to compiler.
|
||||
* \li Make sure you declare your function pointers with the same calling
|
||||
* convention as the actual library function. Your code will crash
|
||||
* mysteriously if you do not do this.
|
||||
* \li Avoid namespace collisions. If you load a symbol from the library,
|
||||
* it is not defined whether or not it goes into the global symbol
|
||||
* namespace for the application. If it does and it conflicts with
|
||||
* symbols in your code or other shared libraries, you will not get
|
||||
* the results you expect. :)
|
||||
* Some things to keep in mind:
|
||||
*
|
||||
* - These functions only work on C function names. Other languages may have
|
||||
* name mangling and intrinsic language support that varies from compiler to
|
||||
* compiler.
|
||||
* - Make sure you declare your function pointers with the same calling
|
||||
* convention as the actual library function. Your code will crash
|
||||
* mysteriously if you do not do this.
|
||||
* - Avoid namespace collisions. If you load a symbol from the library, it is
|
||||
* not defined whether or not it goes into the global symbol namespace for
|
||||
* the application. If it does and it conflicts with symbols in your code or
|
||||
* other shared libraries, you will not get the results you expect. :)
|
||||
*/
|
||||
|
||||
#ifndef SDL_loadso_h_
|
||||
|
@ -62,7 +64,7 @@ extern "C" {
|
|||
* \sa SDL_LoadFunction
|
||||
* \sa SDL_UnloadObject
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
||||
|
||||
/**
|
||||
* Look up the address of the named function in a shared object.
|
||||
|
@ -88,7 +90,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
|||
*
|
||||
* \sa SDL_LoadObject
|
||||
*/
|
||||
extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_LoadFunction(void *handle, const char *name);
|
||||
extern SDL_DECLSPEC SDL_FunctionPointer SDLCALL SDL_LoadFunction(void *handle, const char *name);
|
||||
|
||||
/**
|
||||
* Unload a shared object from memory.
|
||||
|
@ -99,7 +101,7 @@ extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_LoadFunction(void *handle, const
|
|||
*
|
||||
* \sa SDL_LoadObject
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_locale.h
|
||||
* # CategoryLocale
|
||||
*
|
||||
* Include file for SDL locale services
|
||||
* SDL locale services.
|
||||
*/
|
||||
|
||||
#ifndef SDL_locale_h
|
||||
|
@ -100,7 +100,7 @@ typedef struct SDL_Locale
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
|
||||
extern SDL_DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,18 +20,19 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_log.h
|
||||
* # CategoryLog
|
||||
*
|
||||
* Simple log messages with categories and priorities.
|
||||
* Simple log messages with categories and priorities.
|
||||
*
|
||||
* By default logs are quiet, but if you're debugging SDL you might want:
|
||||
* By default logs are quiet, but if you're debugging SDL you might want:
|
||||
*
|
||||
* SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
|
||||
* SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN);
|
||||
*
|
||||
* Here's where the messages go on different platforms:
|
||||
* Windows: debug output stream
|
||||
* Android: log output
|
||||
* Others: standard error output (stderr)
|
||||
* Here's where the messages go on different platforms:
|
||||
*
|
||||
* - Windows: debug output stream
|
||||
* - Android: log output
|
||||
* - Others: standard error output (stderr)
|
||||
*/
|
||||
|
||||
#ifndef SDL_log_h_
|
||||
|
@ -113,10 +114,10 @@ typedef enum SDL_LogPriority
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogResetPriorities
|
||||
* \sa SDL_LogSetPriority
|
||||
* \sa SDL_ResetLogPriorities
|
||||
* \sa SDL_SetLogPriority
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetLogPriorities(SDL_LogPriority priority);
|
||||
|
||||
/**
|
||||
* Set the priority of a particular log category.
|
||||
|
@ -126,11 +127,11 @@ extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogGetPriority
|
||||
* \sa SDL_LogResetPriorities
|
||||
* \sa SDL_LogSetAllPriority
|
||||
* \sa SDL_GetLogPriority
|
||||
* \sa SDL_ResetLogPriorities
|
||||
* \sa SDL_SetLogPriorities
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetLogPriority(int category,
|
||||
SDL_LogPriority priority);
|
||||
|
||||
/**
|
||||
|
@ -141,9 +142,9 @@ extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogSetPriority
|
||||
* \sa SDL_SetLogPriority
|
||||
*/
|
||||
extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
|
||||
extern SDL_DECLSPEC SDL_LogPriority SDLCALL SDL_GetLogPriority(int category);
|
||||
|
||||
/**
|
||||
* Reset all priorities to default.
|
||||
|
@ -152,10 +153,10 @@ extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogSetAllPriority
|
||||
* \sa SDL_LogSetPriority
|
||||
* \sa SDL_SetLogPriorities
|
||||
* \sa SDL_SetLogPriority
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_ResetLogPriorities(void);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
|
||||
|
@ -175,7 +176,7 @@ extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_VERBOSE.
|
||||
|
@ -196,7 +197,7 @@ extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, .
|
|||
* \sa SDL_LogMessageV
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_DEBUG.
|
||||
|
@ -217,7 +218,7 @@ extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRI
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_INFO.
|
||||
|
@ -238,7 +239,7 @@ extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_WARN.
|
||||
|
@ -259,7 +260,7 @@ extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING
|
|||
* \sa SDL_LogMessageV
|
||||
* \sa SDL_LogVerbose
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_ERROR.
|
||||
|
@ -280,7 +281,7 @@ extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Log a message with SDL_LOG_PRIORITY_CRITICAL.
|
||||
|
@ -301,7 +302,7 @@ extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/**
|
||||
* Log a message with the specified category and priority.
|
||||
|
@ -323,7 +324,7 @@ extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STR
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
||||
SDL_LogPriority priority,
|
||||
SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
|
||||
|
||||
|
@ -346,7 +347,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
|
|||
* \sa SDL_LogVerbose
|
||||
* \sa SDL_LogWarn
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
||||
SDL_LogPriority priority,
|
||||
SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
|
||||
|
||||
|
@ -376,7 +377,7 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
|
|||
*
|
||||
* \sa SDL_SetLogOutputFunction
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetLogOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GetLogOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
||||
|
||||
/**
|
||||
* Replace the default log output function with one of your own.
|
||||
|
@ -388,7 +389,7 @@ extern DECLSPEC void SDLCALL SDL_GetLogOutputFunction(SDL_LogOutputFunction *cal
|
|||
*
|
||||
* \sa SDL_GetLogOutputFunction
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetLogOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetLogOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -19,15 +19,11 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef SDL_main_h_
|
||||
#define SDL_main_h_
|
||||
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_events.h>
|
||||
|
||||
/*
|
||||
/**
|
||||
* # CategoryMain
|
||||
*
|
||||
* Redefine main() on some platforms so that it is called by SDL.
|
||||
*
|
||||
* For details on how SDL_main works, and how to use it, please refer to:
|
||||
*
|
||||
* https://wiki.libsdl.org/SDL3/README/main-functions
|
||||
|
@ -35,11 +31,13 @@
|
|||
* (or docs/README-main-functions.md in the SDL source tree)
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_main.h
|
||||
*
|
||||
* Redefine main() on some platforms so that it is called by SDL.
|
||||
*/
|
||||
#ifndef SDL_main_h_
|
||||
#define SDL_main_h_
|
||||
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_events.h>
|
||||
|
||||
#ifndef SDL_MAIN_HANDLED
|
||||
#ifdef SDL_PLATFORM_WIN32
|
||||
|
@ -94,7 +92,7 @@
|
|||
#define SDL_MAIN_NEEDED
|
||||
|
||||
/* We need to export SDL_main so it can be launched from Java */
|
||||
#define SDLMAIN_DECLSPEC DECLSPEC
|
||||
#define SDLMAIN_DECLSPEC SDL_DECLSPEC
|
||||
|
||||
#elif defined(SDL_PLATFORM_PSP)
|
||||
/* On PSP SDL provides a main function that sets the module info,
|
||||
|
@ -438,7 +436,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_main(int argc, char *argv[]);
|
|||
*
|
||||
* \sa SDL_Init
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
||||
|
||||
/**
|
||||
* Initializes and launches an SDL application, by doing platform-specific
|
||||
|
@ -465,7 +463,7 @@ extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved);
|
||||
|
||||
/**
|
||||
* An entry point for SDL's use in SDL_MAIN_USE_CALLBACKS.
|
||||
|
@ -492,7 +490,7 @@ extern DECLSPEC int SDLCALL SDL_RunApp(int argc, char* argv[], SDL_main_func mai
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit);
|
||||
|
||||
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
|
@ -521,7 +519,7 @@ extern DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char* argv[], SD
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
|
||||
/**
|
||||
* Deregister the win32 window class from an SDL_RegisterApp call.
|
||||
|
@ -538,7 +536,7 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
|
||||
|
||||
|
@ -549,7 +547,7 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
||||
|
||||
#endif /* SDL_PLATFORM_GDK */
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: Main */
|
||||
|
||||
#ifndef SDL_main_impl_h_
|
||||
#define SDL_main_impl_h_
|
||||
|
||||
|
|
|
@ -19,6 +19,12 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryMessagebox
|
||||
*
|
||||
* Message box support routines.
|
||||
*/
|
||||
|
||||
#ifndef SDL_messagebox_h_
|
||||
#define SDL_messagebox_h_
|
||||
|
||||
|
@ -118,7 +124,7 @@ typedef struct SDL_MessageBoxData
|
|||
int numbuttons;
|
||||
const SDL_MessageBoxButtonData *buttons;
|
||||
|
||||
const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
|
||||
const SDL_MessageBoxColorScheme *colorScheme; /**< SDL_MessageBoxColorScheme, can be NULL to use system settings */
|
||||
} SDL_MessageBoxData;
|
||||
|
||||
/**
|
||||
|
@ -154,7 +160,7 @@ typedef struct SDL_MessageBoxData
|
|||
*
|
||||
* \sa SDL_ShowSimpleMessageBox
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
||||
|
||||
/**
|
||||
* Display a simple modal message box.
|
||||
|
@ -196,7 +202,7 @@ extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *message
|
|||
*
|
||||
* \sa SDL_ShowMessageBox
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char *title, const char *message, SDL_Window *window);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_metal.h
|
||||
* # CategoryMetal
|
||||
*
|
||||
* Header file for functions to creating Metal layers and views on SDL windows.
|
||||
* Functions to creating Metal layers and views on SDL windows.
|
||||
*/
|
||||
|
||||
#ifndef SDL_metal_h_
|
||||
|
@ -66,7 +66,7 @@ typedef void *SDL_MetalView;
|
|||
* \sa SDL_Metal_DestroyView
|
||||
* \sa SDL_Metal_GetLayer
|
||||
*/
|
||||
extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
|
||||
extern SDL_DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
|
||||
|
||||
/**
|
||||
* Destroy an existing SDL_MetalView object.
|
||||
|
@ -80,7 +80,7 @@ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
|
|||
*
|
||||
* \sa SDL_Metal_CreateView
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
|
||||
|
||||
/**
|
||||
* Get a pointer to the backing CAMetalLayer for the given view.
|
||||
|
@ -90,7 +90,7 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
||||
|
||||
/* @} *//* Metal support functions */
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_misc.h
|
||||
* # CategoryMisc
|
||||
*
|
||||
* Include file for SDL API functions that don't fit elsewhere.
|
||||
* SDL API functions that don't fit elsewhere.
|
||||
*/
|
||||
|
||||
#ifndef SDL_misc_h_
|
||||
|
@ -67,7 +67,7 @@ extern "C" {
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_mouse.h
|
||||
* # CategoryMouse
|
||||
*
|
||||
* Include file for SDL mouse event handling.
|
||||
* SDL mouse handling.
|
||||
*/
|
||||
|
||||
#ifndef SDL_mouse_h_
|
||||
|
@ -94,7 +94,7 @@ typedef enum SDL_MouseWheelDirection
|
|||
*
|
||||
* \sa SDL_GetMice
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected mice.
|
||||
|
@ -114,7 +114,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
|
|||
* \sa SDL_GetMouseInstanceName
|
||||
* \sa SDL_HasMouse
|
||||
*/
|
||||
extern DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count);
|
||||
extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count);
|
||||
|
||||
/**
|
||||
* Get the name of a mouse.
|
||||
|
@ -129,7 +129,7 @@ extern DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count);
|
|||
*
|
||||
* \sa SDL_GetMice
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetMouseInstanceName(SDL_MouseID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetMouseInstanceName(SDL_MouseID instance_id);
|
||||
|
||||
/**
|
||||
* Get the window which currently has mouse focus.
|
||||
|
@ -138,7 +138,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetMouseInstanceName(SDL_MouseID instanc
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
||||
extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
||||
|
||||
/**
|
||||
* Retrieve the current state of the mouse.
|
||||
|
@ -160,7 +160,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
|||
* \sa SDL_GetGlobalMouseState
|
||||
* \sa SDL_GetRelativeMouseState
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(float *x, float *y);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetMouseState(float *x, float *y);
|
||||
|
||||
/**
|
||||
* Get the current state of the mouse in relation to the desktop.
|
||||
|
@ -190,7 +190,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(float *x, float *y);
|
|||
* \sa SDL_CaptureMouse
|
||||
* \sa SDL_GetMouseState
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(float *x, float *y);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(float *x, float *y);
|
||||
|
||||
/**
|
||||
* Retrieve the relative state of the mouse.
|
||||
|
@ -209,7 +209,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(float *x, float *y);
|
|||
*
|
||||
* \sa SDL_GetMouseState
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(float *x, float *y);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(float *x, float *y);
|
||||
|
||||
/**
|
||||
* Move the mouse cursor to the given position within the window.
|
||||
|
@ -230,7 +230,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(float *x, float *y);
|
|||
*
|
||||
* \sa SDL_WarpMouseGlobal
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
||||
float x, float y);
|
||||
|
||||
/**
|
||||
|
@ -253,7 +253,7 @@ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
|
|||
*
|
||||
* \sa SDL_WarpMouseInWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(float x, float y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_WarpMouseGlobal(float x, float y);
|
||||
|
||||
/**
|
||||
* Set relative mouse mode.
|
||||
|
@ -272,7 +272,7 @@ extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(float x, float y);
|
|||
*
|
||||
* \sa SDL_GetRelativeMouseMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Capture the mouse and to track input outside an SDL window.
|
||||
|
@ -318,7 +318,7 @@ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
|||
*
|
||||
* \sa SDL_GetGlobalMouseState
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
|
||||
|
||||
/**
|
||||
* Query whether relative mouse mode is enabled.
|
||||
|
@ -329,7 +329,7 @@ extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
|
|||
*
|
||||
* \sa SDL_SetRelativeMouseMode
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
||||
|
||||
/**
|
||||
* Create a cursor using the specified bitmap data and mask (in MSB format).
|
||||
|
@ -373,7 +373,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
|||
* \sa SDL_DestroyCursor
|
||||
* \sa SDL_SetCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
||||
extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
||||
const Uint8 * mask,
|
||||
int w, int h, int hot_x,
|
||||
int hot_y);
|
||||
|
@ -394,7 +394,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
|||
* \sa SDL_DestroyCursor
|
||||
* \sa SDL_SetCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
||||
extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
||||
int hot_x,
|
||||
int hot_y);
|
||||
|
||||
|
@ -409,7 +409,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
|||
*
|
||||
* \sa SDL_DestroyCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
||||
extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
||||
|
||||
/**
|
||||
* Set the active cursor.
|
||||
|
@ -427,7 +427,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
|||
*
|
||||
* \sa SDL_GetCursor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
||||
|
||||
/**
|
||||
* Get the active cursor.
|
||||
|
@ -441,7 +441,7 @@ extern DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
|||
*
|
||||
* \sa SDL_SetCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
||||
extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
||||
|
||||
/**
|
||||
* Get the default cursor.
|
||||
|
@ -453,7 +453,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
||||
extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
||||
|
||||
/**
|
||||
* Free a previously-created cursor.
|
||||
|
@ -469,7 +469,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
|||
* \sa SDL_CreateCursor
|
||||
* \sa SDL_CreateSystemCursor
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor * cursor);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor * cursor);
|
||||
|
||||
/**
|
||||
* Show the cursor.
|
||||
|
@ -482,7 +482,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor * cursor);
|
|||
* \sa SDL_CursorVisible
|
||||
* \sa SDL_HideCursor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowCursor(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ShowCursor(void);
|
||||
|
||||
/**
|
||||
* Hide the cursor.
|
||||
|
@ -495,7 +495,7 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(void);
|
|||
* \sa SDL_CursorVisible
|
||||
* \sa SDL_ShowCursor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HideCursor(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_HideCursor(void);
|
||||
|
||||
/**
|
||||
* Return whether the cursor is currently being shown.
|
||||
|
@ -508,7 +508,7 @@ extern DECLSPEC int SDLCALL SDL_HideCursor(void);
|
|||
* \sa SDL_HideCursor
|
||||
* \sa SDL_ShowCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_CursorVisible(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_CursorVisible(void);
|
||||
|
||||
/**
|
||||
* Used as a mask when testing buttons in buttonstate.
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#define SDL_mutex_h_
|
||||
|
||||
/**
|
||||
* \file SDL_mutex.h
|
||||
* # CategoryMutex
|
||||
*
|
||||
* Functions to provide thread synchronization primitives.
|
||||
* Functions to provide thread synchronization primitives.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
@ -164,7 +164,7 @@ typedef struct SDL_Mutex SDL_Mutex;
|
|||
* \sa SDL_TryLockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern DECLSPEC SDL_Mutex *SDLCALL SDL_CreateMutex(void);
|
||||
extern SDL_DECLSPEC SDL_Mutex *SDLCALL SDL_CreateMutex(void);
|
||||
|
||||
/**
|
||||
* Lock the mutex.
|
||||
|
@ -188,7 +188,7 @@ extern DECLSPEC SDL_Mutex *SDLCALL SDL_CreateMutex(void);
|
|||
* \sa SDL_TryLockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
|
||||
|
||||
/**
|
||||
* Try to lock a mutex without blocking.
|
||||
|
@ -212,7 +212,7 @@ extern DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
|
|||
* \sa SDL_LockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||
|
||||
/**
|
||||
* Unlock the mutex.
|
||||
|
@ -231,7 +231,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0
|
|||
* \sa SDL_LockMutex
|
||||
* \sa SDL_TryLockMutex
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(mutex);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(mutex);
|
||||
|
||||
/**
|
||||
* Destroy a mutex created with SDL_CreateMutex().
|
||||
|
@ -248,7 +248,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(mutex
|
|||
*
|
||||
* \sa SDL_CreateMutex
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_Mutex *mutex);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_Mutex *mutex);
|
||||
|
||||
/* @} *//* Mutex functions */
|
||||
|
||||
|
@ -331,7 +331,7 @@ typedef struct SDL_RWLock SDL_RWLock;
|
|||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC SDL_RWLock *SDLCALL SDL_CreateRWLock(void);
|
||||
extern SDL_DECLSPEC SDL_RWLock *SDLCALL SDL_CreateRWLock(void);
|
||||
|
||||
/**
|
||||
* Lock the read/write lock for _read only_ operations.
|
||||
|
@ -368,7 +368,7 @@ extern DECLSPEC SDL_RWLock *SDLCALL SDL_CreateRWLock(void);
|
|||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_ACQUIRE_SHARED(rwlock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_ACQUIRE_SHARED(rwlock);
|
||||
|
||||
/**
|
||||
* Lock the read/write lock for _write_ operations.
|
||||
|
@ -399,7 +399,7 @@ extern DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_AC
|
|||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_ACQUIRE(rwlock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_ACQUIRE(rwlock);
|
||||
|
||||
/**
|
||||
* Try to lock a read/write lock _for reading_ without blocking.
|
||||
|
@ -427,7 +427,7 @@ extern DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_AC
|
|||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
||||
|
||||
/**
|
||||
* Try to lock a read/write lock _for writing_ without blocking.
|
||||
|
@ -460,7 +460,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_
|
|||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
||||
|
||||
/**
|
||||
* Unlock the read/write lock.
|
||||
|
@ -485,7 +485,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_
|
|||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEASE_GENERIC(rwlock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEASE_GENERIC(rwlock);
|
||||
|
||||
/**
|
||||
* Destroy a read/write lock created with SDL_CreateRWLock().
|
||||
|
@ -502,7 +502,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEASE_GE
|
|||
*
|
||||
* \sa SDL_CreateRWLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyRWLock(SDL_RWLock *rwlock);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyRWLock(SDL_RWLock *rwlock);
|
||||
|
||||
/* @} *//* Read/write lock functions */
|
||||
|
||||
|
@ -550,7 +550,7 @@ typedef struct SDL_Semaphore SDL_Semaphore;
|
|||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern DECLSPEC SDL_Semaphore *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
||||
extern SDL_DECLSPEC SDL_Semaphore *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
|
||||
|
||||
/**
|
||||
* Destroy a semaphore.
|
||||
|
@ -564,7 +564,7 @@ extern DECLSPEC SDL_Semaphore *SDLCALL SDL_CreateSemaphore(Uint32 initial_value)
|
|||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
|
||||
|
||||
/**
|
||||
* Wait until a semaphore has a positive value and then decrements it.
|
||||
|
@ -587,7 +587,7 @@ extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
|
|||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
||||
|
||||
/**
|
||||
* See if a semaphore has a positive value and decrement it if it does.
|
||||
|
@ -608,7 +608,7 @@ extern DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
|||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
|
||||
/**
|
||||
* Wait until a semaphore has a positive value and then decrements it.
|
||||
|
@ -630,7 +630,7 @@ extern DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
|||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_WaitSemaphore
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
|
||||
|
||||
/**
|
||||
* Atomically increment a semaphore's value and wake waiting threads.
|
||||
|
@ -645,7 +645,7 @@ extern DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32
|
|||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PostSemaphore(SDL_Semaphore *sem);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PostSemaphore(SDL_Semaphore *sem);
|
||||
|
||||
/**
|
||||
* Get the current value of a semaphore.
|
||||
|
@ -655,7 +655,7 @@ extern DECLSPEC int SDLCALL SDL_PostSemaphore(SDL_Semaphore *sem);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem);
|
||||
|
||||
/* @} *//* Semaphore functions */
|
||||
|
||||
|
@ -694,7 +694,7 @@ typedef struct SDL_Condition SDL_Condition;
|
|||
* \sa SDL_WaitConditionTimeout
|
||||
* \sa SDL_DestroyCondition
|
||||
*/
|
||||
extern DECLSPEC SDL_Condition *SDLCALL SDL_CreateCondition(void);
|
||||
extern SDL_DECLSPEC SDL_Condition *SDLCALL SDL_CreateCondition(void);
|
||||
|
||||
/**
|
||||
* Destroy a condition variable.
|
||||
|
@ -705,7 +705,7 @@ extern DECLSPEC SDL_Condition *SDLCALL SDL_CreateCondition(void);
|
|||
*
|
||||
* \sa SDL_CreateCondition
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
|
||||
|
||||
/**
|
||||
* Restart one of the threads that are waiting on the condition variable.
|
||||
|
@ -720,7 +720,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
|
|||
* \sa SDL_WaitCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
|
||||
|
||||
/**
|
||||
* Restart all threads that are waiting on the condition variable.
|
||||
|
@ -735,7 +735,7 @@ extern DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
|
|||
* \sa SDL_WaitCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
|
||||
|
||||
/**
|
||||
* Wait until a condition variable is signaled.
|
||||
|
@ -763,7 +763,7 @@ extern DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
|
|||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex);
|
||||
|
||||
/**
|
||||
* Wait until a condition variable is signaled or a certain time has passed.
|
||||
|
@ -792,7 +792,7 @@ extern DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mu
|
|||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitCondition
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
|
||||
SDL_Mutex *mutex, Sint32 timeoutMS);
|
||||
|
||||
/* @} *//* Condition variable functions */
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_oldnames.h
|
||||
*
|
||||
* Definitions to ease transition from SDL2 code
|
||||
/*
|
||||
* Definitions to ease transition from SDL2 code
|
||||
*/
|
||||
|
||||
#ifndef SDL_oldnames_h_
|
||||
|
@ -70,8 +68,12 @@
|
|||
#define SDL_FreeAudioStream SDL_DestroyAudioStream
|
||||
#define SDL_FreeWAV SDL_free
|
||||
#define SDL_LoadWAV_RW SDL_LoadWAV_IO
|
||||
#define SDL_MixAudioFormat SDL_MixAudio
|
||||
#define SDL_NewAudioStream SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_cpuinfo.h */
|
||||
#define SDL_SIMDGetAlignment SDL_GetSIMDAlignment
|
||||
|
||||
/* ##SDL_events.h */
|
||||
#define SDL_APP_DIDENTERBACKGROUND SDL_EVENT_DID_ENTER_BACKGROUND
|
||||
#define SDL_APP_DIDENTERFOREGROUND SDL_EVENT_DID_ENTER_FOREGROUND
|
||||
|
@ -291,7 +293,6 @@
|
|||
#define SDL_HINT_LINUX_HAT_DEADZONES SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
|
||||
#define SDL_HINT_LINUX_JOYSTICK_CLASSIC SDL_HINT_JOYSTICK_LINUX_CLASSIC
|
||||
#define SDL_HINT_LINUX_JOYSTICK_DEADZONES SDL_HINT_JOYSTICK_LINUX_DEADZONES
|
||||
#define SDL_HINT_PS2_DYNAMIC_VSYNC SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC
|
||||
|
||||
/* ##SDL_joystick.h */
|
||||
#define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMEPAD
|
||||
|
@ -357,10 +358,17 @@
|
|||
#define KMOD_RSHIFT SDL_KMOD_RSHIFT
|
||||
#define KMOD_SCROLL SDL_KMOD_SCROLL
|
||||
#define KMOD_SHIFT SDL_KMOD_SHIFT
|
||||
#define SDLK_BACKQUOTE SDLK_GRAVE
|
||||
#define SDLK_QUOTE SDLK_APOSTROPHE
|
||||
#define SDLK_QUOTEDBL SDLK_DBLAPOSTROPHE
|
||||
|
||||
/* ##SDL_log.h */
|
||||
#define SDL_LogGetOutputFunction SDL_GetLogOutputFunction
|
||||
#define SDL_LogGetPriority SDL_GetLogPriority
|
||||
#define SDL_LogResetPriorities SDL_ResetLogPriorities
|
||||
#define SDL_LogSetAllPriority SDL_SetLogPriorities
|
||||
#define SDL_LogSetOutputFunction SDL_SetLogOutputFunction
|
||||
#define SDL_LogSetPriority SDL_SetLogPriority
|
||||
|
||||
/* ##SDL_mouse.h */
|
||||
#define SDL_FreeCursor SDL_DestroyCursor
|
||||
|
@ -527,7 +535,8 @@
|
|||
#define SDL_GetTicks64 SDL_GetTicks
|
||||
|
||||
/* ##SDL_version.h */
|
||||
#define SDL_version SDL_Version
|
||||
#define SDL_COMPILEDVERSION SDL_VERSION
|
||||
#define SDL_PATCHLEVEL SDL_MICRO_VERSION
|
||||
|
||||
/* ##SDL_video.h */
|
||||
#define SDL_GetClosestDisplayMode SDL_GetClosestFullscreenDisplayMode
|
||||
|
@ -576,8 +585,12 @@
|
|||
#define SDL_FreeAudioStream SDL_FreeAudioStream_renamed_SDL_DestroyAudioStream
|
||||
#define SDL_FreeWAV SDL_FreeWAV_renamed_SDL_free
|
||||
#define SDL_LoadWAV_RW SDL_LoadWAV_RW_renamed_SDL_LoadWAV_IO
|
||||
#define SDL_MixAudioFormat SDL_MixAudioFormat_renamed_SDL_MixAudio
|
||||
#define SDL_NewAudioStream SDL_NewAudioStream_renamed_SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_cpuinfo.h */
|
||||
#define SDL_SIMDGetAlignment SDL_SIMDGetAlignment_renamed_SDL_GetSIMDAlignment
|
||||
|
||||
/* ##SDL_events.h */
|
||||
#define SDL_APP_DIDENTERBACKGROUND SDL_APP_DIDENTERBACKGROUND_renamed_SDL_EVENT_DID_ENTER_BACKGROUND
|
||||
#define SDL_APP_DIDENTERFOREGROUND SDL_APP_DIDENTERFOREGROUND_renamed_SDL_EVENT_DID_ENTER_FOREGROUND
|
||||
|
@ -798,7 +811,6 @@
|
|||
#define SDL_HINT_LINUX_HAT_DEADZONES SDL_HINT_LINUX_HAT_DEADZONES_renamed_SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
|
||||
#define SDL_HINT_LINUX_JOYSTICK_CLASSIC SDL_HINT_LINUX_JOYSTICK_CLASSIC_renamed_SDL_HINT_JOYSTICK_LINUX_CLASSIC
|
||||
#define SDL_HINT_LINUX_JOYSTICK_DEADZONES SDL_HINT_LINUX_JOYSTICK_DEADZONES_renamed_SDL_HINT_JOYSTICK_LINUX_DEADZONES
|
||||
#define SDL_HINT_PS2_DYNAMIC_VSYNC SDL_HINT_PS2_DYNAMIC_VSYNC_renamed_SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC
|
||||
|
||||
/* ##SDL_joystick.h */
|
||||
#define SDL_JOYSTICK_TYPE_GAMECONTROLLER SDL_JOYSTICK_TYPE_GAMECONTROLLER_renamed_SDL_JOYSTICK_TYPE_GAMEPAD
|
||||
|
@ -864,10 +876,17 @@
|
|||
#define KMOD_RSHIFT KMOD_RSHIFT_renamed_SDL_KMOD_RSHIFT
|
||||
#define KMOD_SCROLL KMOD_SCROLL_renamed_SDL_KMOD_SCROLL
|
||||
#define KMOD_SHIFT KMOD_SHIFT_renamed_SDL_KMOD_SHIFT
|
||||
#define SDLK_BACKQUOTE SDLK_BACKQUOTE_renamed_SDLK_GRAVE
|
||||
#define SDLK_QUOTE SDLK_QUOTE_renamed_SDLK_APOSTROPHE
|
||||
#define SDLK_QUOTEDBL SDLK_QUOTEDBL_renamed_SDLK_DBLAPOSTROPHE
|
||||
|
||||
/* ##SDL_log.h */
|
||||
#define SDL_LogGetOutputFunction SDL_LogGetOutputFunction_renamed_SDL_GetLogOutputFunction
|
||||
#define SDL_LogGetPriority SDL_LogGetPriority_renamed_SDL_GetLogPriority
|
||||
#define SDL_LogResetPriorities SDL_LogResetPriorities_renamed_SDL_ResetLogPriorities
|
||||
#define SDL_LogSetAllPriority SDL_LogSetAllPriority_renamed_SDL_SetLogPriorities
|
||||
#define SDL_LogSetOutputFunction SDL_LogSetOutputFunction_renamed_SDL_SetLogOutputFunction
|
||||
#define SDL_LogSetPriority SDL_LogSetPriority_renamed_SDL_SetLogPriority
|
||||
|
||||
/* ##SDL_mouse.h */
|
||||
#define SDL_FreeCursor SDL_FreeCursor_renamed_SDL_DestroyCursor
|
||||
|
@ -1034,7 +1053,8 @@
|
|||
#define SDL_GetTicks64 SDL_GetTicks64_renamed_SDL_GetTicks
|
||||
|
||||
/* ##SDL_version.h */
|
||||
#define SDL_version SDL_version_renamed_SDL_Version
|
||||
#define SDL_COMPILEDVERSION SDL_COMPILEDVERSION_renamed_SDL_VERSION
|
||||
#define SDL_PATCHLEVEL SDL_PATCHLEVEL_renamed_SDL_MICRO_VERSION
|
||||
|
||||
/* ##SDL_video.h */
|
||||
#define SDL_GetClosestDisplayMode SDL_GetClosestDisplayMode_renamed_SDL_GetClosestFullscreenDisplayMode
|
||||
|
|
|
@ -19,17 +19,11 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_opengl.h
|
||||
/*
|
||||
* This is a simple file to encapsulate the OpenGL API headers.
|
||||
*
|
||||
* This is a simple file to encapsulate the OpenGL API headers.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def NO_SDL_GLEXT
|
||||
*
|
||||
* Define this if you have your own version of glext.h and want to disable the
|
||||
* version included in SDL_opengl.h.
|
||||
* Define NO_SDL_GLEXT if you have your own version of glext.h and want
|
||||
* to disable the version included in SDL_opengl.h.
|
||||
*/
|
||||
|
||||
#ifndef SDL_opengl_h_
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_opengles.h
|
||||
*
|
||||
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
||||
/*
|
||||
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
|
|
|
@ -19,11 +19,10 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_opengles2.h
|
||||
*
|
||||
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
||||
/*
|
||||
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
|
|
|
@ -20,26 +20,26 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_pen.h
|
||||
* # CategoryPen
|
||||
*
|
||||
* Include file for SDL pen event handling.
|
||||
* Include file for SDL pen event handling.
|
||||
*
|
||||
* This file describes operations for pressure-sensitive pen (stylus and/or eraser) handling, e.g., for input
|
||||
* and drawing tablets or suitably equipped mobile / tablet devices.
|
||||
* This file describes operations for pressure-sensitive pen (stylus and/or
|
||||
* eraser) handling, e.g., for input and drawing tablets or suitably equipped
|
||||
* mobile / tablet devices.
|
||||
*
|
||||
* To get started with pens:
|
||||
* - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent
|
||||
* - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent and SDL_MouseButtonEvent
|
||||
* whenever "which" == SDL_PEN_MOUSEID.
|
||||
* To get started with pens:
|
||||
*
|
||||
* This header file describes advanced functionality that can be useful for managing user configuration
|
||||
* and understanding the capabilities of the attached pens.
|
||||
* - Listen to SDL_PenMotionEvent and SDL_PenButtonEvent
|
||||
* - To avoid treating pen events as mouse events, ignore SDL_MouseMotionEvent
|
||||
* and SDL_MouseButtonEvent whenever `which` == SDL_PEN_MOUSEID.
|
||||
*
|
||||
* We primarily identify pens by SDL_PenID. The implementation makes a best effort to relate each :SDL_PenID
|
||||
* to the same physical device during a session. Formerly valid SDL_PenID values remain valid
|
||||
* even if a device disappears.
|
||||
* We primarily identify pens by SDL_PenID. The implementation makes a best
|
||||
* effort to relate each SDL_PenID to the same physical device during a
|
||||
* session. Formerly valid SDL_PenID values remain valid even if a device
|
||||
* disappears.
|
||||
*
|
||||
* For identifying pens across sessions, the API provides the type SDL_GUID .
|
||||
* For identifying pens across sessions, the API provides the type SDL_GUID .
|
||||
*/
|
||||
|
||||
#ifndef SDL_pen_h_
|
||||
|
@ -157,7 +157,7 @@ typedef enum SDL_PenSubtype
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_PenID *SDLCALL SDL_GetPens(int *count);
|
||||
extern SDL_DECLSPEC SDL_PenID *SDLCALL SDL_GetPens(int *count);
|
||||
|
||||
/**
|
||||
* Retrieves the pen's current status.
|
||||
|
@ -178,7 +178,7 @@ extern DECLSPEC SDL_PenID *SDLCALL SDL_GetPens(int *count);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x, float *y, float *axes, size_t num_axes);
|
||||
|
||||
/**
|
||||
* Retrieves an SDL_PenID for the given SDL_GUID.
|
||||
|
@ -189,7 +189,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid);
|
||||
extern SDL_DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid);
|
||||
|
||||
/**
|
||||
* Retrieves the SDL_GUID for a given SDL_PenID.
|
||||
|
@ -200,7 +200,7 @@ extern DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id);
|
||||
extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id);
|
||||
|
||||
/**
|
||||
* Checks whether a pen is still attached.
|
||||
|
@ -214,7 +214,7 @@ extern DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id);
|
||||
|
||||
/**
|
||||
* Retrieves a human-readable description for a SDL_PenID.
|
||||
|
@ -230,7 +230,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetPenName(SDL_PenID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetPenName(SDL_PenID instance_id);
|
||||
|
||||
/**
|
||||
* Pen capabilities, as reported by SDL_GetPenCapabilities()
|
||||
|
@ -254,7 +254,7 @@ typedef struct SDL_PenCapabilityInfo
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo *capabilities);
|
||||
|
||||
/**
|
||||
* Retrieves the pen type for a given SDL_PenID.
|
||||
|
@ -269,7 +269,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetPenCapabilities(SDL_PenID instance_id, SDL
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id);
|
||||
extern SDL_DECLSPEC SDL_PenSubtype SDLCALL SDL_GetPenType(SDL_PenID instance_id);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,6 +19,12 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* # CategoryPixels
|
||||
*
|
||||
* Pixel management.
|
||||
*/
|
||||
|
||||
#ifndef SDL_pixels_h_
|
||||
#define SDL_pixels_h_
|
||||
|
||||
|
@ -762,7 +768,7 @@ typedef struct SDL_PixelFormat
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormatEnum format);
|
||||
extern SDL_DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormatEnum format);
|
||||
|
||||
/**
|
||||
* Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
|
||||
|
@ -780,7 +786,7 @@ extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormatEnum f
|
|||
*
|
||||
* \sa SDL_GetPixelFormatEnumForMasks
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format,
|
||||
int *bpp,
|
||||
Uint32 * Rmask,
|
||||
Uint32 * Gmask,
|
||||
|
@ -805,7 +811,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatE
|
|||
*
|
||||
* \sa SDL_GetMasksForPixelFormatEnum
|
||||
*/
|
||||
extern DECLSPEC SDL_PixelFormatEnum SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
|
||||
extern SDL_DECLSPEC SDL_PixelFormatEnum SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
|
||||
Uint32 Rmask,
|
||||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
|
@ -827,7 +833,7 @@ extern DECLSPEC SDL_PixelFormatEnum SDLCALL SDL_GetPixelFormatEnumForMasks(int b
|
|||
* \sa SDL_DestroyPixelFormat
|
||||
* \sa SDL_SetPixelFormatPalette
|
||||
*/
|
||||
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format);
|
||||
extern SDL_DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format);
|
||||
|
||||
/**
|
||||
* Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat().
|
||||
|
@ -838,7 +844,7 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(SDL_PixelFormatE
|
|||
*
|
||||
* \sa SDL_CreatePixelFormat
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
|
||||
|
||||
/**
|
||||
* Create a palette structure with the specified number of color entries.
|
||||
|
@ -856,7 +862,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
|
|||
* \sa SDL_SetPaletteColors
|
||||
* \sa SDL_SetPixelFormatPalette
|
||||
*/
|
||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
|
||||
extern SDL_DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
|
||||
|
||||
/**
|
||||
* Set the palette for a pixel format structure.
|
||||
|
@ -868,7 +874,7 @@ extern DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
||||
SDL_Palette *palette);
|
||||
|
||||
/**
|
||||
|
@ -883,7 +889,7 @@ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
const SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
|
||||
|
@ -896,7 +902,7 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
|||
*
|
||||
* \sa SDL_CreatePalette
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
|
||||
|
||||
/**
|
||||
* Map an RGB triple to an opaque pixel value for a given pixel format.
|
||||
|
@ -928,7 +934,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
|
|||
* \sa SDL_GetRGBA
|
||||
* \sa SDL_MapRGBA
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
/**
|
||||
|
@ -963,7 +969,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
|||
* \sa SDL_GetRGBA
|
||||
* \sa SDL_MapRGB
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b,
|
||||
Uint8 a);
|
||||
|
||||
|
@ -988,7 +994,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
|||
* \sa SDL_MapRGB
|
||||
* \sa SDL_MapRGBA
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
Uint8 * r, Uint8 * g, Uint8 * b);
|
||||
|
||||
|
@ -1017,7 +1023,7 @@ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
|||
* \sa SDL_MapRGB
|
||||
* \sa SDL_MapRGBA
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
Uint8 * r, Uint8 * g, Uint8 * b,
|
||||
Uint8 * a);
|
||||
|
|
|
@ -20,9 +20,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_platform.h
|
||||
* # CategoryPlatform
|
||||
*
|
||||
* Header file for platform functions.
|
||||
* SDL provides a means to identify the app's platform, both at compile time
|
||||
* and runtime.
|
||||
*/
|
||||
|
||||
#ifndef SDL_platform_h_
|
||||
|
@ -52,7 +53,7 @@ extern "C" {
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_platform_defines.h
|
||||
*
|
||||
* Try to get a standard set of platform defines.
|
||||
/* WIKI CATEGORY: Platform */
|
||||
|
||||
/*
|
||||
* SDL_platform_defines.h tries to get a standard set of platform defines.
|
||||
*/
|
||||
|
||||
#ifndef SDL_platform_defines_h_
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#define SDL_power_h_
|
||||
|
||||
/**
|
||||
* \file SDL_power.h
|
||||
* # CategoryPower
|
||||
*
|
||||
* Header for the SDL power management routines.
|
||||
* SDL power management routines.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
@ -82,7 +82,7 @@ typedef enum SDL_PowerState
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);
|
||||
extern SDL_DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,11 +20,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_properties.h
|
||||
* # CategoryProperties
|
||||
*
|
||||
* Header file for SDL properties.
|
||||
* SDL properties.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SDL_properties_h_
|
||||
#define SDL_properties_h_
|
||||
|
||||
|
@ -70,7 +71,7 @@ typedef enum SDL_PropertyType
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);
|
||||
|
||||
/**
|
||||
* Create a set of properties.
|
||||
|
@ -86,7 +87,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);
|
|||
*
|
||||
* \sa SDL_DestroyProperties
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
|
||||
|
||||
/**
|
||||
* Copy a set of properties.
|
||||
|
@ -105,7 +106,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
|
||||
|
||||
/**
|
||||
* Lock a set of properties.
|
||||
|
@ -129,7 +130,7 @@ extern DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_Propert
|
|||
*
|
||||
* \sa SDL_UnlockProperties
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockProperties(SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LockProperties(SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Unlock a set of properties.
|
||||
|
@ -142,7 +143,7 @@ extern DECLSPEC int SDLCALL SDL_LockProperties(SDL_PropertiesID props);
|
|||
*
|
||||
* \sa SDL_LockProperties
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Set a property on a set of properties with a cleanup function that is
|
||||
|
@ -167,7 +168,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, void (SDLCALL *cleanup)(void *userdata, void *value), void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, void (SDLCALL *cleanup)(void *userdata, void *value), void *userdata);
|
||||
|
||||
/**
|
||||
* Set a property on a set of properties.
|
||||
|
@ -190,7 +191,7 @@ extern DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, c
|
|||
* \sa SDL_SetPropertyWithCleanup
|
||||
* \sa SDL_SetStringProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value);
|
||||
|
||||
/**
|
||||
* Set a string property on a set of properties.
|
||||
|
@ -210,7 +211,7 @@ extern DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *
|
|||
*
|
||||
* \sa SDL_GetStringProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);
|
||||
|
||||
/**
|
||||
* Set an integer property on a set of properties.
|
||||
|
@ -227,7 +228,7 @@ extern DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const
|
|||
*
|
||||
* \sa SDL_GetNumberProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value);
|
||||
|
||||
/**
|
||||
* Set a floating point property on a set of properties.
|
||||
|
@ -244,7 +245,7 @@ extern DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const
|
|||
*
|
||||
* \sa SDL_GetFloatProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value);
|
||||
|
||||
/**
|
||||
* Set a boolean property on a set of properties.
|
||||
|
@ -261,7 +262,7 @@ extern DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const c
|
|||
*
|
||||
* \sa SDL_GetBooleanProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
|
||||
|
||||
/**
|
||||
* Return whether a property exists in a set of properties.
|
||||
|
@ -276,7 +277,7 @@ extern DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const
|
|||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
|
||||
|
||||
/**
|
||||
* Get the type of a property on a set of properties.
|
||||
|
@ -292,7 +293,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const c
|
|||
*
|
||||
* \sa SDL_HasProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID props, const char *name);
|
||||
extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID props, const char *name);
|
||||
|
||||
/**
|
||||
* Get a property on a set of properties.
|
||||
|
@ -324,7 +325,7 @@ extern DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID pr
|
|||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value);
|
||||
|
||||
/**
|
||||
* Get a string property on a set of properties.
|
||||
|
@ -343,7 +344,7 @@ extern DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char
|
|||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetStringProperty
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value);
|
||||
|
||||
/**
|
||||
* Get a number property on a set of properties.
|
||||
|
@ -365,7 +366,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props
|
|||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetNumberProperty
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 default_value);
|
||||
extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 default_value);
|
||||
|
||||
/**
|
||||
* Get a floating point property on a set of properties.
|
||||
|
@ -387,7 +388,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, con
|
|||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetFloatProperty
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float default_value);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float default_value);
|
||||
|
||||
/**
|
||||
* Get a boolean property on a set of properties.
|
||||
|
@ -409,7 +410,7 @@ extern DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const
|
|||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetBooleanProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value);
|
||||
|
||||
/**
|
||||
* Clear a property on a set of properties.
|
||||
|
@ -423,7 +424,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
|
||||
|
||||
typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_PropertiesID props, const char *name);
|
||||
|
||||
|
@ -443,7 +444,7 @@ typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_Prop
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Destroy a set of properties.
|
||||
|
@ -461,7 +462,7 @@ extern DECLSPEC int SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_
|
|||
*
|
||||
* \sa SDL_CreateProperties
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyProperties(SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyProperties(SDL_PropertiesID props);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_rect.h
|
||||
* # CategoryRect
|
||||
*
|
||||
* Header file for SDL_rect definition and management functions.
|
||||
* Some helper functions for managing rectangles and 2D points, in both
|
||||
* interger and floating point versions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_rect_h_
|
||||
|
@ -201,7 +202,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqual(const SDL_Rect *a, const SDL_Rect *b)
|
|||
*
|
||||
* \sa SDL_GetRectIntersection
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect * A,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect * A,
|
||||
const SDL_Rect * B);
|
||||
|
||||
/**
|
||||
|
@ -219,7 +220,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersection(const SDL_Rect * A,
|
|||
*
|
||||
* \sa SDL_HasRectIntersection
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect * A,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect * A,
|
||||
const SDL_Rect * B,
|
||||
SDL_Rect * result);
|
||||
|
||||
|
@ -235,7 +236,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect * A,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRectUnion(const SDL_Rect * A,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRectUnion(const SDL_Rect * A,
|
||||
const SDL_Rect * B,
|
||||
SDL_Rect * result);
|
||||
|
||||
|
@ -256,7 +257,7 @@ extern DECLSPEC int SDLCALL SDL_GetRectUnion(const SDL_Rect * A,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point * points,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point * points,
|
||||
int count,
|
||||
const SDL_Rect * clip,
|
||||
SDL_Rect * result);
|
||||
|
@ -279,7 +280,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPoints(const SDL_Point * po
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersection(const SDL_Rect *
|
||||
rect, int *X1,
|
||||
int *Y1, int *X2,
|
||||
int *Y2);
|
||||
|
@ -414,7 +415,7 @@ SDL_FORCE_INLINE SDL_bool SDL_RectsEqualFloat(const SDL_FRect *a, const SDL_FRec
|
|||
*
|
||||
* \sa SDL_GetRectIntersection
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect * A,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect * A,
|
||||
const SDL_FRect * B);
|
||||
|
||||
/**
|
||||
|
@ -432,7 +433,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasRectIntersectionFloat(const SDL_FRect *
|
|||
*
|
||||
* \sa SDL_HasRectIntersectionFloat
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect * A,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect * A,
|
||||
const SDL_FRect * B,
|
||||
SDL_FRect * result);
|
||||
|
||||
|
@ -448,7 +449,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A,
|
||||
const SDL_FRect * B,
|
||||
SDL_FRect * result);
|
||||
|
||||
|
@ -470,7 +471,7 @@ extern DECLSPEC int SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint * points,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoint * points,
|
||||
int count,
|
||||
const SDL_FRect * clip,
|
||||
SDL_FRect * result);
|
||||
|
@ -494,7 +495,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRectEnclosingPointsFloat(const SDL_FPoin
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRectAndLineIntersectionFloat(const SDL_FRect *
|
||||
rect, float *X1,
|
||||
float *Y1, float *X2,
|
||||
float *Y2);
|
||||
|
|
|
@ -20,29 +20,31 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_render.h
|
||||
* # CategoryRender
|
||||
*
|
||||
* Header file for SDL 2D rendering functions.
|
||||
* Header file for SDL 2D rendering functions.
|
||||
*
|
||||
* This API supports the following features:
|
||||
* * single pixel points
|
||||
* * single pixel lines
|
||||
* * filled rectangles
|
||||
* * texture images
|
||||
* This API supports the following features:
|
||||
*
|
||||
* The primitives may be drawn in opaque, blended, or additive modes.
|
||||
* - single pixel points
|
||||
* - single pixel lines
|
||||
* - filled rectangles
|
||||
* - texture images
|
||||
* - 2D polygons
|
||||
*
|
||||
* The texture images may be drawn in opaque, blended, or additive modes.
|
||||
* They can have an additional color tint or alpha modulation applied to
|
||||
* them, and may also be stretched with linear interpolation.
|
||||
* The primitives may be drawn in opaque, blended, or additive modes.
|
||||
*
|
||||
* This API is designed to accelerate simple 2D operations. You may
|
||||
* want more functionality such as polygons and particle effects and
|
||||
* in that case you should use SDL's OpenGL/Direct3D support or one
|
||||
* of the many good 3D engines.
|
||||
* The texture images may be drawn in opaque, blended, or additive modes. They
|
||||
* can have an additional color tint or alpha modulation applied to them, and
|
||||
* may also be stretched with linear interpolation.
|
||||
*
|
||||
* These functions must be called from the main thread.
|
||||
* See this bug for details: https://github.com/libsdl-org/SDL/issues/986
|
||||
* This API is designed to accelerate simple 2D operations. You may want more
|
||||
* functionality such as polygons and particle effects and in that case you
|
||||
* should use SDL's OpenGL/Direct3D support or one of the many good 3D
|
||||
* engines.
|
||||
*
|
||||
* These functions must be called from the main thread. See this bug for
|
||||
* details: https://github.com/libsdl-org/SDL/issues/986
|
||||
*/
|
||||
|
||||
#ifndef SDL_render_h_
|
||||
|
@ -68,15 +70,6 @@ extern "C" {
|
|||
*/
|
||||
#define SDL_SOFTWARE_RENDERER "software"
|
||||
|
||||
/**
|
||||
* Flags used when creating a rendering context.
|
||||
*
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*/
|
||||
typedef Uint32 SDL_RendererFlags;
|
||||
|
||||
#define SDL_RENDERER_PRESENTVSYNC 0x00000004u /**< Present is synchronized with the refresh rate */
|
||||
|
||||
/**
|
||||
* Information on the capabilities of a render driver or context.
|
||||
*
|
||||
|
@ -85,11 +78,8 @@ typedef Uint32 SDL_RendererFlags;
|
|||
typedef struct SDL_RendererInfo
|
||||
{
|
||||
const char *name; /**< The name of the renderer */
|
||||
SDL_RendererFlags flags; /**< Supported ::SDL_RendererFlags */
|
||||
int num_texture_formats; /**< The number of available texture formats */
|
||||
const SDL_PixelFormatEnum *texture_formats; /**< The available texture formats */
|
||||
int max_texture_width; /**< The maximum texture width */
|
||||
int max_texture_height; /**< The maximum texture height */
|
||||
} SDL_RendererInfo;
|
||||
|
||||
/**
|
||||
|
@ -135,7 +125,6 @@ typedef enum SDL_RendererLogicalPresentation
|
|||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
struct SDL_Renderer;
|
||||
typedef struct SDL_Renderer SDL_Renderer;
|
||||
|
||||
/**
|
||||
|
@ -143,7 +132,6 @@ typedef struct SDL_Renderer SDL_Renderer;
|
|||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*/
|
||||
struct SDL_Texture;
|
||||
typedef struct SDL_Texture SDL_Texture;
|
||||
|
||||
/* Function prototypes */
|
||||
|
@ -165,7 +153,7 @@ typedef struct SDL_Texture SDL_Texture;
|
|||
* \sa SDL_CreateRenderer
|
||||
* \sa SDL_GetRenderDriver
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
|
||||
|
||||
/**
|
||||
* Use this function to get the name of a built in 2D rendering driver.
|
||||
|
@ -190,7 +178,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
|
|||
*
|
||||
* \sa SDL_GetNumRenderDrivers
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetRenderDriver(int index);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetRenderDriver(int index);
|
||||
|
||||
/**
|
||||
* Create a window and default renderer.
|
||||
|
@ -210,7 +198,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetRenderDriver(int index);
|
|||
* \sa SDL_CreateRenderer
|
||||
* \sa SDL_CreateWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer);
|
||||
|
||||
/**
|
||||
* Create a 2D rendering context for a window.
|
||||
|
@ -228,7 +216,6 @@ extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int w
|
|||
* \param window the window where rendering is displayed
|
||||
* \param name the name of the rendering driver to initialize, or NULL to
|
||||
* initialize the first one supporting the requested flags
|
||||
* \param flags 0, or one or more SDL_RendererFlags OR'd together
|
||||
* \returns a valid rendering context or NULL if there was an error; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@ -241,7 +228,7 @@ extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(const char *title, int w
|
|||
* \sa SDL_GetRenderDriver
|
||||
* \sa SDL_GetRendererInfo
|
||||
*/
|
||||
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, const char *name, SDL_RendererFlags flags);
|
||||
extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, const char *name);
|
||||
|
||||
/**
|
||||
* Create a 2D rendering context for a window, with the specified properties.
|
||||
|
@ -261,8 +248,9 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, co
|
|||
* supports HDR output. If you select SDL_COLORSPACE_SRGB_LINEAR, drawing
|
||||
* still uses the sRGB colorspace, but values can go beyond 1.0 and float
|
||||
* (linear) format textures can be used for HDR content.
|
||||
* - `SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_BOOLEAN`: true if you want
|
||||
* present synchronized with the refresh rate
|
||||
* - `SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER`: non-zero if you want
|
||||
* present synchronized with the refresh rate. This property can take any
|
||||
* value that is supported by SDL_SetRenderVSync() for the renderer.
|
||||
*
|
||||
* With the vulkan renderer:
|
||||
*
|
||||
|
@ -291,13 +279,13 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, co
|
|||
* \sa SDL_DestroyRenderer
|
||||
* \sa SDL_GetRendererInfo
|
||||
*/
|
||||
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props);
|
||||
|
||||
#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name"
|
||||
#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window"
|
||||
#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface"
|
||||
#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace"
|
||||
#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_BOOLEAN "present_vsync"
|
||||
#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER "present_vsync"
|
||||
#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER "vulkan.instance"
|
||||
#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER "vulkan.surface"
|
||||
#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER "vulkan.physical_device"
|
||||
|
@ -322,7 +310,7 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_Prop
|
|||
*
|
||||
* \sa SDL_DestroyRenderer
|
||||
*/
|
||||
extern DECLSPEC SDL_Renderer *SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Get the renderer associated with a window.
|
||||
|
@ -333,7 +321,7 @@ extern DECLSPEC SDL_Renderer *SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *su
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Renderer *SDLCALL SDL_GetRenderer(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_GetRenderer(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the window associated with a renderer.
|
||||
|
@ -344,7 +332,7 @@ extern DECLSPEC SDL_Renderer *SDLCALL SDL_GetRenderer(SDL_Window *window);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Get information about a rendering context.
|
||||
|
@ -360,7 +348,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *renderer);
|
|||
* \sa SDL_CreateRenderer
|
||||
* \sa SDL_CreateRendererWithProperties
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a renderer.
|
||||
|
@ -372,6 +360,9 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
|
|||
* displayed, if any
|
||||
* - `SDL_PROP_RENDERER_SURFACE_POINTER`: the surface where rendering is
|
||||
* displayed, if this is a software renderer without a window
|
||||
* - `SDL_PROP_RENDERER_VSYNC_NUMBER`: the current vsync setting
|
||||
* - `SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER`: the maximum texture width
|
||||
* and height
|
||||
* - `SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER`: an SDL_ColorSpace value
|
||||
* describing the colorspace for output to the display, defaults to
|
||||
* SDL_COLORSPACE_SRGB.
|
||||
|
@ -397,11 +388,15 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
|
|||
*
|
||||
* - `SDL_PROP_RENDERER_D3D11_DEVICE_POINTER`: the ID3D11Device associated
|
||||
* with the renderer
|
||||
* - `SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER`: the IDXGISwapChain1
|
||||
* associated with the renderer. This may change when the window is resized.
|
||||
*
|
||||
* With the direct3d12 renderer:
|
||||
*
|
||||
* - `SDL_PROP_RENDERER_D3D12_DEVICE_POINTER`: the ID3D12Device associated
|
||||
* with the renderer
|
||||
* - `SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER`: the IDXGISwapChain4
|
||||
* associated with the renderer.
|
||||
* - `SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER`: the ID3D12CommandQueue
|
||||
* associated with the renderer
|
||||
*
|
||||
|
@ -432,18 +427,22 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer *renderer);
|
||||
|
||||
#define SDL_PROP_RENDERER_NAME_STRING "SDL.renderer.name"
|
||||
#define SDL_PROP_RENDERER_WINDOW_POINTER "SDL.renderer.window"
|
||||
#define SDL_PROP_RENDERER_SURFACE_POINTER "SDL.renderer.surface"
|
||||
#define SDL_PROP_RENDERER_VSYNC_NUMBER "SDL.renderer.vsync"
|
||||
#define SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER "SDL.renderer.max_texture_size"
|
||||
#define SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.output_colorspace"
|
||||
#define SDL_PROP_RENDERER_HDR_ENABLED_BOOLEAN "SDL.renderer.HDR_enabled"
|
||||
#define SDL_PROP_RENDERER_SDR_WHITE_POINT_FLOAT "SDL.renderer.SDR_white_point"
|
||||
#define SDL_PROP_RENDERER_HDR_HEADROOM_FLOAT "SDL.renderer.HDR_headroom"
|
||||
#define SDL_PROP_RENDERER_D3D9_DEVICE_POINTER "SDL.renderer.d3d9.device"
|
||||
#define SDL_PROP_RENDERER_D3D11_DEVICE_POINTER "SDL.renderer.d3d11.device"
|
||||
#define SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER "SDL.renderer.d3d11.swap_chain"
|
||||
#define SDL_PROP_RENDERER_D3D12_DEVICE_POINTER "SDL.renderer.d3d12.device"
|
||||
#define SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER "SDL.renderer.d3d12.swap_chain"
|
||||
#define SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER "SDL.renderer.d3d12.command_queue"
|
||||
#define SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER "SDL.renderer.vulkan.instance"
|
||||
#define SDL_PROP_RENDERER_VULKAN_SURFACE_NUMBER "SDL.renderer.vulkan.surface"
|
||||
|
@ -469,7 +468,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer
|
|||
*
|
||||
* \sa SDL_GetCurrentRenderOutputSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Get the current output size in pixels of a rendering context.
|
||||
|
@ -489,7 +488,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int
|
|||
*
|
||||
* \sa SDL_GetRenderOutputSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Create a texture for a rendering context.
|
||||
|
@ -511,7 +510,7 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *rendere
|
|||
* \sa SDL_QueryTexture
|
||||
* \sa SDL_UpdateTexture
|
||||
*/
|
||||
extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormatEnum format, int access, int w, int h);
|
||||
extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormatEnum format, int access, int w, int h);
|
||||
|
||||
/**
|
||||
* Create a texture from an existing surface.
|
||||
|
@ -538,7 +537,7 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, S
|
|||
* \sa SDL_DestroyTexture
|
||||
* \sa SDL_QueryTexture
|
||||
*/
|
||||
extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Create a texture for a rendering context with the specified properties.
|
||||
|
@ -649,7 +648,7 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *
|
|||
* \sa SDL_QueryTexture
|
||||
* \sa SDL_UpdateTexture
|
||||
*/
|
||||
extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props);
|
||||
|
||||
#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace"
|
||||
#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format"
|
||||
|
@ -767,7 +766,7 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Rendere
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Texture *texture);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Texture *texture);
|
||||
|
||||
#define SDL_PROP_TEXTURE_COLORSPACE_NUMBER "SDL.texture.colorspace"
|
||||
#define SDL_PROP_TEXTURE_SDR_WHITE_POINT_FLOAT "SDL.texture.SDR_white_point"
|
||||
|
@ -803,7 +802,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Texture *t
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Renderer *SDLCALL SDL_GetRendererFromTexture(SDL_Texture *texture);
|
||||
extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_GetRendererFromTexture(SDL_Texture *texture);
|
||||
|
||||
/**
|
||||
* Query the attributes of a texture.
|
||||
|
@ -825,7 +824,7 @@ extern DECLSPEC SDL_Renderer *SDLCALL SDL_GetRendererFromTexture(SDL_Texture *te
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture *texture, SDL_PixelFormatEnum *format, int *access, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture *texture, SDL_PixelFormatEnum *format, int *access, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Set an additional color value multiplied into render copy operations.
|
||||
|
@ -852,7 +851,7 @@ extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture *texture, SDL_PixelForm
|
|||
* \sa SDL_SetTextureAlphaMod
|
||||
* \sa SDL_SetTextureColorModFloat
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -880,7 +879,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r
|
|||
* \sa SDL_SetTextureAlphaModFloat
|
||||
* \sa SDL_SetTextureColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -899,7 +898,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureColorModFloat(SDL_Texture *texture, fl
|
|||
* \sa SDL_GetTextureColorModFloat
|
||||
* \sa SDL_SetTextureColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
|
||||
/**
|
||||
* Get the additional color value multiplied into render copy operations.
|
||||
|
@ -917,7 +916,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *
|
|||
* \sa SDL_GetTextureColorMod
|
||||
* \sa SDL_SetTextureColorModFloat
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b);
|
||||
|
||||
/**
|
||||
* Set an additional alpha value multiplied into render copy operations.
|
||||
|
@ -941,7 +940,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureColorModFloat(SDL_Texture *texture, fl
|
|||
* \sa SDL_SetTextureAlphaModFloat
|
||||
* \sa SDL_SetTextureColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha);
|
||||
|
||||
/**
|
||||
* Set an additional alpha value multiplied into render copy operations.
|
||||
|
@ -965,7 +964,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 a
|
|||
* \sa SDL_SetTextureAlphaMod
|
||||
* \sa SDL_SetTextureColorModFloat
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha);
|
||||
|
||||
/**
|
||||
* Get the additional alpha value multiplied into render copy operations.
|
||||
|
@ -981,7 +980,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureAlphaModFloat(SDL_Texture *texture, fl
|
|||
* \sa SDL_GetTextureColorMod
|
||||
* \sa SDL_SetTextureAlphaMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha);
|
||||
|
||||
/**
|
||||
* Get the additional alpha value multiplied into render copy operations.
|
||||
|
@ -997,7 +996,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *
|
|||
* \sa SDL_GetTextureColorModFloat
|
||||
* \sa SDL_SetTextureAlphaModFloat
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha);
|
||||
|
||||
/**
|
||||
* Set the blend mode for a texture, used by SDL_RenderTexture().
|
||||
|
@ -1014,7 +1013,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureAlphaModFloat(SDL_Texture *texture, fl
|
|||
*
|
||||
* \sa SDL_GetTextureBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode);
|
||||
|
||||
/**
|
||||
* Get the blend mode used for texture copy operations.
|
||||
|
@ -1028,7 +1027,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_Bl
|
|||
*
|
||||
* \sa SDL_SetTextureBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode);
|
||||
|
||||
/**
|
||||
* Set the scale mode used for texture scale operations.
|
||||
|
@ -1046,7 +1045,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_Bl
|
|||
*
|
||||
* \sa SDL_GetTextureScaleMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode);
|
||||
|
||||
/**
|
||||
* Get the scale mode used for texture scale operations.
|
||||
|
@ -1060,7 +1059,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_Sc
|
|||
*
|
||||
* \sa SDL_SetTextureScaleMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode);
|
||||
|
||||
/**
|
||||
* Update the given texture rectangle with new pixel data.
|
||||
|
@ -1092,7 +1091,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_Sc
|
|||
* \sa SDL_UpdateNVTexture
|
||||
* \sa SDL_UpdateYUVTexture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch);
|
||||
|
||||
/**
|
||||
* Update a rectangle within a planar YV12 or IYUV texture with new pixel
|
||||
|
@ -1122,7 +1121,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture *texture, const SDL_Re
|
|||
* \sa SDL_UpdateNVTexture
|
||||
* \sa SDL_UpdateTexture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture,
|
||||
const SDL_Rect *rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *Uplane, int Upitch,
|
||||
|
@ -1152,7 +1151,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture *texture,
|
|||
* \sa SDL_UpdateTexture
|
||||
* \sa SDL_UpdateYUVTexture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture,
|
||||
const SDL_Rect *rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *UVplane, int UVpitch);
|
||||
|
@ -1185,7 +1184,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture *texture,
|
|||
* \sa SDL_LockTextureToSurface
|
||||
* \sa SDL_UnlockTexture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture,
|
||||
const SDL_Rect *rect,
|
||||
void **pixels, int *pitch);
|
||||
|
||||
|
@ -1221,7 +1220,7 @@ extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture *texture,
|
|||
* \sa SDL_LockTexture
|
||||
* \sa SDL_UnlockTexture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
|
||||
const SDL_Rect *rect,
|
||||
SDL_Surface **surface);
|
||||
|
||||
|
@ -1242,7 +1241,7 @@ extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
|
|||
*
|
||||
* \sa SDL_LockTexture
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture);
|
||||
|
||||
/**
|
||||
* Set a texture as the current rendering target.
|
||||
|
@ -1262,7 +1261,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture);
|
|||
*
|
||||
* \sa SDL_GetRenderTarget
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture);
|
||||
|
||||
/**
|
||||
* Get the current render target.
|
||||
|
@ -1277,7 +1276,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Text
|
|||
*
|
||||
* \sa SDL_SetRenderTarget
|
||||
*/
|
||||
extern DECLSPEC SDL_Texture *SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Set a device independent resolution and presentation mode for rendering.
|
||||
|
@ -1306,7 +1305,7 @@ extern DECLSPEC SDL_Texture *SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer)
|
|||
* \sa SDL_ConvertEventToRenderCoordinates
|
||||
* \sa SDL_GetRenderLogicalPresentation
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode);
|
||||
|
||||
/**
|
||||
* Get device independent resolution and presentation mode for rendering.
|
||||
|
@ -1326,7 +1325,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *rende
|
|||
*
|
||||
* \sa SDL_SetRenderLogicalPresentation
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode);
|
||||
|
||||
/**
|
||||
* Get a point in render coordinates when given a point in window coordinates.
|
||||
|
@ -1344,7 +1343,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *rende
|
|||
* \sa SDL_SetRenderLogicalPresentation
|
||||
* \sa SDL_SetRenderScale
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y);
|
||||
|
||||
/**
|
||||
* Get a point in window coordinates when given a point in render coordinates.
|
||||
|
@ -1364,7 +1363,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCoordinatesFromWindow(SDL_Renderer *render
|
|||
* \sa SDL_SetRenderLogicalPresentation
|
||||
* \sa SDL_SetRenderScale
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y);
|
||||
|
||||
/**
|
||||
* Convert the coordinates in an event to render coordinates.
|
||||
|
@ -1383,7 +1382,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer
|
|||
*
|
||||
* \sa SDL_GetRenderCoordinatesFromWindowCoordinates
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Set the drawing area for rendering on the current target.
|
||||
|
@ -1399,7 +1398,7 @@ extern DECLSPEC int SDLCALL SDL_ConvertEventToRenderCoordinates(SDL_Renderer *re
|
|||
* \sa SDL_GetRenderViewport
|
||||
* \sa SDL_RenderViewportSet
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the drawing area for the current target.
|
||||
|
@ -1414,7 +1413,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderViewport(SDL_Renderer *renderer, const
|
|||
* \sa SDL_RenderViewportSet
|
||||
* \sa SDL_SetRenderViewport
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Return whether an explicit rectangle was set as the viewport.
|
||||
|
@ -1432,7 +1431,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Re
|
|||
* \sa SDL_GetRenderViewport
|
||||
* \sa SDL_SetRenderViewport
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Set the clip rectangle for rendering on the specified target.
|
||||
|
@ -1448,7 +1447,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *renderer);
|
|||
* \sa SDL_GetRenderClipRect
|
||||
* \sa SDL_RenderClipEnabled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the clip rectangle for the current target.
|
||||
|
@ -1464,7 +1463,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderClipRect(SDL_Renderer *renderer, const
|
|||
* \sa SDL_RenderClipEnabled
|
||||
* \sa SDL_SetRenderClipRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get whether clipping is enabled on the given renderer.
|
||||
|
@ -1478,7 +1477,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Re
|
|||
* \sa SDL_GetRenderClipRect
|
||||
* \sa SDL_SetRenderClipRect
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Set the drawing scale for rendering on the current target.
|
||||
|
@ -1501,7 +1500,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RenderClipEnabled(SDL_Renderer *renderer);
|
|||
*
|
||||
* \sa SDL_GetRenderScale
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY);
|
||||
|
||||
/**
|
||||
* Get the drawing scale for the current target.
|
||||
|
@ -1516,7 +1515,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float sca
|
|||
*
|
||||
* \sa SDL_SetRenderScale
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY);
|
||||
|
||||
/**
|
||||
* Set the color used for drawing operations.
|
||||
|
@ -1539,7 +1538,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *sc
|
|||
* \sa SDL_GetRenderDrawColor
|
||||
* \sa SDL_SetRenderDrawColorFloat
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
||||
|
||||
/**
|
||||
* Set the color used for drawing operations (Rect, Line and Clear).
|
||||
|
@ -1562,7 +1561,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8
|
|||
* \sa SDL_GetRenderDrawColorFloat
|
||||
* \sa SDL_SetRenderDrawColor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a);
|
||||
|
||||
/**
|
||||
* Get the color used for drawing operations (Rect, Line and Clear).
|
||||
|
@ -1584,7 +1583,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer,
|
|||
* \sa SDL_GetRenderDrawColorFloat
|
||||
* \sa SDL_SetRenderDrawColor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
|
||||
/**
|
||||
* Get the color used for drawing operations (Rect, Line and Clear).
|
||||
|
@ -1606,7 +1605,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8
|
|||
* \sa SDL_SetRenderDrawColorFloat
|
||||
* \sa SDL_GetRenderDrawColor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a);
|
||||
|
||||
/**
|
||||
* Set the color scale used for render operations.
|
||||
|
@ -1628,7 +1627,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer,
|
|||
*
|
||||
* \sa SDL_GetRenderColorScale
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale);
|
||||
|
||||
/**
|
||||
* Get the color scale used for render operations.
|
||||
|
@ -1642,7 +1641,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, floa
|
|||
*
|
||||
* \sa SDL_SetRenderColorScale
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale);
|
||||
|
||||
/**
|
||||
* Set the blend mode used for drawing operations (Fill and Line).
|
||||
|
@ -1658,7 +1657,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, floa
|
|||
*
|
||||
* \sa SDL_GetRenderDrawBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode);
|
||||
|
||||
/**
|
||||
* Get the blend mode used for drawing operations.
|
||||
|
@ -1672,7 +1671,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, S
|
|||
*
|
||||
* \sa SDL_SetRenderDrawBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode);
|
||||
|
||||
/**
|
||||
* Clear the current rendering target with the drawing color.
|
||||
|
@ -1688,7 +1687,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, S
|
|||
*
|
||||
* \sa SDL_SetRenderDrawColor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Draw a point on the current rendering target at subpixel precision.
|
||||
|
@ -1702,7 +1701,7 @@ extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer);
|
|||
*
|
||||
* \sa SDL_RenderPoints
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, float y);
|
||||
|
||||
/**
|
||||
* Draw multiple points on the current rendering target at subpixel precision.
|
||||
|
@ -1717,7 +1716,7 @@ extern DECLSPEC int SDLCALL SDL_RenderPoint(SDL_Renderer *renderer, float x, flo
|
|||
*
|
||||
* \sa SDL_RenderPoint
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count);
|
||||
|
||||
/**
|
||||
* Draw a line on the current rendering target at subpixel precision.
|
||||
|
@ -1733,7 +1732,7 @@ extern DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const SDL_F
|
|||
*
|
||||
* \sa SDL_RenderLines
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2);
|
||||
|
||||
/**
|
||||
* Draw a series of connected lines on the current rendering target at
|
||||
|
@ -1749,7 +1748,7 @@ extern DECLSPEC int SDLCALL SDL_RenderLine(SDL_Renderer *renderer, float x1, flo
|
|||
*
|
||||
* \sa SDL_RenderLine
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count);
|
||||
|
||||
/**
|
||||
* Draw a rectangle on the current rendering target at subpixel precision.
|
||||
|
@ -1763,7 +1762,7 @@ extern DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SDL_FP
|
|||
*
|
||||
* \sa SDL_RenderRects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect);
|
||||
|
||||
/**
|
||||
* Draw some number of rectangles on the current rendering target at subpixel
|
||||
|
@ -1779,7 +1778,7 @@ extern DECLSPEC int SDLCALL SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRe
|
|||
*
|
||||
* \sa SDL_RenderRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);
|
||||
|
||||
/**
|
||||
* Fill a rectangle on the current rendering target with the drawing color at
|
||||
|
@ -1794,7 +1793,7 @@ extern DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SDL_FR
|
|||
*
|
||||
* \sa SDL_RenderFillRects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect);
|
||||
|
||||
/**
|
||||
* Fill some number of rectangles on the current rendering target with the
|
||||
|
@ -1810,7 +1809,7 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer *renderer, const SDL
|
|||
*
|
||||
* \sa SDL_RenderFillRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count);
|
||||
|
||||
/**
|
||||
* Copy a portion of the texture to the current rendering target at subpixel
|
||||
|
@ -1828,7 +1827,7 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, const SD
|
|||
*
|
||||
* \sa SDL_RenderTextureRotated
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect);
|
||||
|
||||
/**
|
||||
* Copy a portion of the source texture to the current rendering target, with
|
||||
|
@ -1854,7 +1853,7 @@ extern DECLSPEC int SDLCALL SDL_RenderTexture(SDL_Renderer *renderer, SDL_Textur
|
|||
*
|
||||
* \sa SDL_RenderTexture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
const SDL_FRect *srcrect, const SDL_FRect *dstrect,
|
||||
const double angle, const SDL_FPoint *center,
|
||||
const SDL_FlipMode flip);
|
||||
|
@ -1878,7 +1877,7 @@ extern DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL
|
|||
*
|
||||
* \sa SDL_RenderGeometryRaw
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
|
||||
SDL_Texture *texture,
|
||||
const SDL_Vertex *vertices, int num_vertices,
|
||||
const int *indices, int num_indices);
|
||||
|
@ -1908,7 +1907,7 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
|
|||
*
|
||||
* \sa SDL_RenderGeometry
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
||||
SDL_Texture *texture,
|
||||
const float *xy, int xy_stride,
|
||||
const SDL_Color *color, int color_stride,
|
||||
|
@ -1942,7 +1941,7 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||
* \sa SDL_RenderGeometry
|
||||
* \sa SDL_RenderGeometryRaw
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderGeometryRawFloat(SDL_Renderer *renderer,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRawFloat(SDL_Renderer *renderer,
|
||||
SDL_Texture *texture,
|
||||
const float *xy, int xy_stride,
|
||||
const SDL_FColor *color, int color_stride,
|
||||
|
@ -1967,7 +1966,7 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometryRawFloat(SDL_Renderer *renderer,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Update the screen with any rendering performed since the previous call.
|
||||
|
@ -2008,7 +2007,7 @@ extern DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *rendere
|
|||
* \sa SDL_SetRenderDrawBlendMode
|
||||
* \sa SDL_SetRenderDrawColor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Destroy the specified texture.
|
||||
|
@ -2023,7 +2022,7 @@ extern DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer);
|
|||
* \sa SDL_CreateTexture
|
||||
* \sa SDL_CreateTextureFromSurface
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture);
|
||||
|
||||
/**
|
||||
* Destroy the rendering context for a window and free associated textures.
|
||||
|
@ -2037,7 +2036,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture);
|
|||
*
|
||||
* \sa SDL_CreateRenderer
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Force the rendering context to flush any pending commands and state.
|
||||
|
@ -2068,7 +2067,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Get the CAMetalLayer associated with the given Metal renderer.
|
||||
|
@ -2084,7 +2083,7 @@ extern DECLSPEC int SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer);
|
|||
*
|
||||
* \sa SDL_GetRenderMetalCommandEncoder
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Get the Metal command encoder for the current frame.
|
||||
|
@ -2105,7 +2104,7 @@ extern DECLSPEC void *SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer);
|
|||
*
|
||||
* \sa SDL_GetRenderMetalLayer
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2133,13 +2132,20 @@ extern DECLSPEC void *SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer *ren
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore);
|
||||
|
||||
/**
|
||||
* Toggle VSync of the given renderer.
|
||||
*
|
||||
* \param renderer The renderer to toggle
|
||||
* \param vsync 1 for on, 0 for off. All other values are reserved
|
||||
* \param vsync the vertical refresh sync interval, 1 to synchronize present
|
||||
* with every vertical refresh, 2 to synchronize present with
|
||||
* every second vertical refresh, etc.,
|
||||
* SDL_RENDERER_VSYNC_ADAPTIVE for late swap tearing (adaptive
|
||||
* vsync), or SDL_RENDERER_VSYNC_DISABLED to disable. Not every
|
||||
* value is supported by every renderer, so you should check the
|
||||
* return value to see whether the requested setting is
|
||||
* supported.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@ -2147,14 +2153,17 @@ extern DECLSPEC int SDLCALL SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer
|
|||
*
|
||||
* \sa SDL_GetRenderVSync
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync);
|
||||
|
||||
#define SDL_RENDERER_VSYNC_DISABLED 0
|
||||
#define SDL_RENDERER_VSYNC_ADAPTIVE (-1)
|
||||
|
||||
/**
|
||||
* Get VSync of the given renderer.
|
||||
*
|
||||
* \param renderer The renderer to toggle
|
||||
* \param vsync an int filled with 1 for on, 0 for off. All other values are
|
||||
* reserved
|
||||
* \param vsync an int filled with the current vertical refresh sync interval.
|
||||
* See SDL_SetRenderVSync for the meaning of the value.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
|
@ -2162,7 +2171,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync
|
|||
*
|
||||
* \sa SDL_SetRenderVSync
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -19,10 +19,12 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_revision.h
|
||||
*
|
||||
* Header file containing the SDL revision
|
||||
/* WIKI CATEGORY: Version */
|
||||
|
||||
/*
|
||||
* SDL_revision.h contains the SDL revision, which might be defined on the
|
||||
* compiler command line, or generated right into the header itself by the
|
||||
* build system.
|
||||
*/
|
||||
|
||||
#ifndef SDL_revision_h_
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_scancode.h
|
||||
* # CategoryScancode
|
||||
*
|
||||
* Defines keyboard scancodes.
|
||||
* Defines keyboard scancodes.
|
||||
*/
|
||||
|
||||
#ifndef SDL_scancode_h_
|
||||
|
@ -40,7 +40,7 @@
|
|||
* in the `keysym.scancode` field of the SDL_KeyboardEvent structure.
|
||||
*
|
||||
* The values in this enumeration are based on the USB usage page standard:
|
||||
* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
|
||||
* https://usb.org/sites/default/files/hut1_5.pdf
|
||||
*
|
||||
* \since This enum is available since SDL 3.0.0.
|
||||
*/
|
||||
|
@ -349,7 +349,6 @@ typedef enum SDL_Scancode
|
|||
* \name Usage page 0x0C
|
||||
*
|
||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
||||
* See https://usb.org/sites/default/files/hut1_2.pdf
|
||||
*
|
||||
* There are way more keys in the spec than we can represent in the
|
||||
* current scancode range, so pick the ones that commonly come up in
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_sensor.h
|
||||
* # CategorySensor
|
||||
*
|
||||
* Include file for SDL sensor event handling
|
||||
* SDL sensor management.
|
||||
*/
|
||||
|
||||
#ifndef SDL_sensor_h_
|
||||
|
@ -44,7 +44,7 @@ extern "C" {
|
|||
* SDL_sensor.h
|
||||
*
|
||||
* In order to use these functions, SDL_Init() must have been called
|
||||
* with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
|
||||
* with the SDL_INIT_SENSOR flag. This causes SDL to scan the system
|
||||
* for sensors, and load appropriate drivers.
|
||||
*/
|
||||
|
||||
|
@ -153,7 +153,7 @@ typedef enum SDL_SensorType
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count);
|
||||
extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor.
|
||||
|
@ -163,7 +163,7 @@ extern DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetSensorInstanceName(SDL_SensorID instance_id);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorInstanceName(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
|
@ -174,7 +174,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetSensorInstanceName(SDL_SensorID insta
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorInstanceType(SDL_SensorID instance_id);
|
||||
extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorInstanceType(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Get the platform dependent type of a sensor.
|
||||
|
@ -185,7 +185,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorInstanceType(SDL_SensorID in
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSensorInstanceNonPortableType(SDL_SensorID instance_id);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSensorInstanceNonPortableType(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Open a sensor for use.
|
||||
|
@ -195,7 +195,7 @@ extern DECLSPEC int SDLCALL SDL_GetSensorInstanceNonPortableType(SDL_SensorID in
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Return the SDL_Sensor associated with an instance ID.
|
||||
|
@ -205,7 +205,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID instance_id);
|
||||
extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID instance_id);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a sensor.
|
||||
|
@ -219,7 +219,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID ins
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a sensor.
|
||||
|
@ -229,7 +229,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor *sen
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetSensorName(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorName(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the type of a sensor.
|
||||
|
@ -240,7 +240,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetSensorName(SDL_Sensor *sensor);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorType(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorType(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the platform dependent type of a sensor.
|
||||
|
@ -250,7 +250,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorType(SDL_Sensor *sensor);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the instance ID of a sensor.
|
||||
|
@ -260,7 +260,7 @@ extern DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorInstanceID(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorInstanceID(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Get the current state of an opened sensor.
|
||||
|
@ -275,7 +275,7 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorInstanceID(SDL_Sensor *sensor)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values);
|
||||
|
||||
/**
|
||||
* Close a sensor previously opened with SDL_OpenSensor().
|
||||
|
@ -284,7 +284,7 @@ extern DECLSPEC int SDLCALL SDL_GetSensorData(SDL_Sensor *sensor, float *data, i
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseSensor(SDL_Sensor *sensor);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CloseSensor(SDL_Sensor *sensor);
|
||||
|
||||
/**
|
||||
* Update the current state of the open sensors.
|
||||
|
@ -297,7 +297,7 @@ extern DECLSPEC void SDLCALL SDL_CloseSensor(SDL_Sensor *sensor);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UpdateSensors(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UpdateSensors(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_stdinc.h
|
||||
* # CategoryStdinc
|
||||
*
|
||||
* This is a general header that includes C language support. It implements
|
||||
* a subset of the C runtime: these should all behave the same way as their
|
||||
* C runtime equivalents, but with an SDL_ prefix.
|
||||
* This is a general header that includes C language support. It implements a
|
||||
* subset of the C runtime: these should all behave the same way as their C
|
||||
* runtime equivalents, but with an SDL_ prefix.
|
||||
*/
|
||||
|
||||
#ifndef SDL_stdinc_h_
|
||||
|
@ -482,10 +482,10 @@ extern "C" {
|
|||
#define SDL_stack_free(data) SDL_free(data)
|
||||
#endif
|
||||
|
||||
extern DECLSPEC SDL_MALLOC void *SDLCALL SDL_malloc(size_t size);
|
||||
extern DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
extern DECLSPEC SDL_ALLOC_SIZE(2) void *SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
extern DECLSPEC void SDLCALL SDL_free(void *mem);
|
||||
extern SDL_DECLSPEC SDL_MALLOC void *SDLCALL SDL_malloc(size_t size);
|
||||
extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
|
||||
extern SDL_DECLSPEC SDL_ALLOC_SIZE(2) void *SDLCALL SDL_realloc(void *mem, size_t size);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_free(void *mem);
|
||||
|
||||
typedef void *(SDLCALL *SDL_malloc_func)(size_t size);
|
||||
typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
|
||||
|
@ -502,7 +502,7 @@ typedef void (SDLCALL *SDL_free_func)(void *mem);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func,
|
||||
SDL_calloc_func *calloc_func,
|
||||
SDL_realloc_func *realloc_func,
|
||||
SDL_free_func *free_func);
|
||||
|
@ -517,7 +517,7 @@ extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *mal
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
|
||||
SDL_calloc_func *calloc_func,
|
||||
SDL_realloc_func *realloc_func,
|
||||
SDL_free_func *free_func);
|
||||
|
@ -534,7 +534,7 @@ extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
SDL_calloc_func calloc_func,
|
||||
SDL_realloc_func realloc_func,
|
||||
SDL_free_func free_func);
|
||||
|
@ -558,7 +558,7 @@ extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
|||
*
|
||||
* \sa SDL_aligned_free
|
||||
*/
|
||||
extern DECLSPEC SDL_MALLOC void *SDLCALL SDL_aligned_alloc(size_t alignment, size_t size);
|
||||
extern SDL_DECLSPEC SDL_MALLOC void *SDLCALL SDL_aligned_alloc(size_t alignment, size_t size);
|
||||
|
||||
/**
|
||||
* Free memory allocated by SDL_aligned_alloc().
|
||||
|
@ -567,7 +567,7 @@ extern DECLSPEC SDL_MALLOC void *SDLCALL SDL_aligned_alloc(size_t alignment, siz
|
|||
*
|
||||
* \sa SDL_aligned_alloc
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_aligned_free(void *mem);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_aligned_free(void *mem);
|
||||
|
||||
/**
|
||||
* Get the number of outstanding (unfreed) allocations.
|
||||
|
@ -576,18 +576,18 @@ extern DECLSPEC void SDLCALL SDL_aligned_free(void *mem);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
||||
|
||||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
||||
|
||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||
|
||||
extern DECLSPEC void SDLCALL SDL_qsort_r(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (void *, const void *, const void *), void *userdata);
|
||||
extern DECLSPEC void * SDLCALL SDL_bsearch_r(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (void *, const void *, const void *), void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_qsort_r(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (void *, const void *, const void *), void *userdata);
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_bsearch_r(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (void *, const void *, const void *), void *userdata);
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_abs(int x);
|
||||
|
||||
/* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */
|
||||
#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
|
||||
|
@ -607,7 +607,7 @@ extern DECLSPEC int SDLCALL SDL_abs(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isalpha(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isalpha(int x);
|
||||
|
||||
/**
|
||||
* Query if a character is alphabetic (a letter) or a number.
|
||||
|
@ -622,7 +622,7 @@ extern DECLSPEC int SDLCALL SDL_isalpha(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isalnum(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isalnum(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is blank (a space or tab).
|
||||
|
@ -637,7 +637,7 @@ extern DECLSPEC int SDLCALL SDL_isalnum(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isblank(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isblank(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is a control character.
|
||||
|
@ -652,7 +652,7 @@ extern DECLSPEC int SDLCALL SDL_isblank(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_iscntrl(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_iscntrl(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is a numeric digit.
|
||||
|
@ -667,7 +667,7 @@ extern DECLSPEC int SDLCALL SDL_iscntrl(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isdigit(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isdigit(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is a hexadecimal digit.
|
||||
|
@ -682,7 +682,7 @@ extern DECLSPEC int SDLCALL SDL_isdigit(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isxdigit(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isxdigit(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is a punctuation mark.
|
||||
|
@ -700,7 +700,7 @@ extern DECLSPEC int SDLCALL SDL_isxdigit(int x);
|
|||
* \sa SDL_isgraph
|
||||
* \sa SDL_isalnum
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ispunct(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ispunct(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is whitespace.
|
||||
|
@ -722,7 +722,7 @@ extern DECLSPEC int SDLCALL SDL_ispunct(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isspace(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isspace(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is upper case.
|
||||
|
@ -737,7 +737,7 @@ extern DECLSPEC int SDLCALL SDL_isspace(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isupper(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isupper(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is lower case.
|
||||
|
@ -752,7 +752,7 @@ extern DECLSPEC int SDLCALL SDL_isupper(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_islower(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_islower(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is "printable".
|
||||
|
@ -771,7 +771,7 @@ extern DECLSPEC int SDLCALL SDL_islower(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isprint(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isprint(int x);
|
||||
|
||||
/**
|
||||
* Report if a character is any "printable" except space.
|
||||
|
@ -792,7 +792,7 @@ extern DECLSPEC int SDLCALL SDL_isprint(int x);
|
|||
*
|
||||
* \sa SDL_isprint
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_isgraph(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_isgraph(int x);
|
||||
|
||||
/**
|
||||
* Convert low-ASCII English letters to uppercase.
|
||||
|
@ -810,7 +810,7 @@ extern DECLSPEC int SDLCALL SDL_isgraph(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_toupper(int x);
|
||||
|
||||
/**
|
||||
* Convert low-ASCII English letters to lowercase.
|
||||
|
@ -828,12 +828,12 @@ extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_tolower(int x);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_tolower(int x);
|
||||
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
|
||||
extern SDL_DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
|
||||
|
||||
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
||||
|
||||
/* Take advantage of compiler optimizations for memcpy */
|
||||
#ifndef SDL_SLOW_MEMCPY
|
||||
|
@ -847,7 +847,7 @@ extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_
|
|||
{ SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \
|
||||
SDL_memcpy((dst), (src), sizeof(*(src)))
|
||||
|
||||
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
||||
|
||||
/* Take advantage of compiler optimizations for memmove */
|
||||
#ifndef SDL_SLOW_MEMMOVE
|
||||
|
@ -857,8 +857,8 @@ extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN
|
|||
#define SDL_memmove memmove
|
||||
#endif
|
||||
|
||||
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
||||
extern DECLSPEC void *SDLCALL SDL_memset4(void *dst, Uint32 val, size_t dwords);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_memset4(void *dst, Uint32 val, size_t dwords);
|
||||
|
||||
/* Take advantage of compiler optimizations for memset */
|
||||
#ifndef SDL_SLOW_MEMSET
|
||||
|
@ -872,15 +872,15 @@ extern DECLSPEC void *SDLCALL SDL_memset4(void *dst, Uint32 val, size_t dwords);
|
|||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
||||
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
|
||||
|
||||
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
|
||||
extern DECLSPEC size_t SDLCALL SDL_wcsnlen(const wchar_t *wstr, size_t maxlen);
|
||||
extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
||||
extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
|
||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
|
||||
extern DECLSPEC wchar_t *SDLCALL SDL_wcsnstr(const wchar_t *haystack, const wchar_t *needle, size_t maxlen);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_wcsnlen(const wchar_t *wstr, size_t maxlen);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
|
||||
extern SDL_DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
|
||||
extern SDL_DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
|
||||
extern SDL_DECLSPEC wchar_t *SDLCALL SDL_wcsnstr(const wchar_t *haystack, const wchar_t *needle, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Compare two null-terminated wide strings.
|
||||
|
@ -899,7 +899,7 @@ extern DECLSPEC wchar_t *SDLCALL SDL_wcsnstr(const wchar_t *haystack, const wcha
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
|
||||
|
||||
/**
|
||||
* Compare two wide strings up to a number of wchar_t values.
|
||||
|
@ -930,7 +930,7 @@ extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Compare two null-terminated wide strings, case-insensitively.
|
||||
|
@ -960,7 +960,7 @@ extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2);
|
||||
|
||||
/**
|
||||
* Compare two wide strings, case-insensitively, up to a number of wchar_t.
|
||||
|
@ -1002,18 +1002,18 @@ extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *s
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
|
||||
|
||||
extern DECLSPEC long SDLCALL SDL_wcstol(const wchar_t *str, wchar_t **endp, int base);
|
||||
extern SDL_DECLSPEC long SDLCALL SDL_wcstol(const wchar_t *str, wchar_t **endp, int base);
|
||||
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
|
||||
extern DECLSPEC size_t SDLCALL SDL_strnlen(const char *str, size_t maxlen);
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes);
|
||||
extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
||||
extern DECLSPEC SDL_MALLOC char *SDLCALL SDL_strdup(const char *str);
|
||||
extern DECLSPEC SDL_MALLOC char *SDLCALL SDL_strndup(const char *str, size_t maxlen);
|
||||
extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_strnlen(const char *str, size_t maxlen);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
|
||||
extern SDL_DECLSPEC SDL_MALLOC char *SDLCALL SDL_strdup(const char *str);
|
||||
extern SDL_DECLSPEC SDL_MALLOC char *SDLCALL SDL_strndup(const char *str, size_t maxlen);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strrev(char *str);
|
||||
|
||||
/**
|
||||
* Convert a string to uppercase.
|
||||
|
@ -1031,7 +1031,7 @@ extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
|
|||
*
|
||||
* \sa SDL_strlwr
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strupr(char *str);
|
||||
|
||||
/**
|
||||
* Convert a string to lowercase.
|
||||
|
@ -1052,31 +1052,31 @@ extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
|
|||
*
|
||||
* \sa SDL_strupr
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strlwr(char *str);
|
||||
|
||||
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
||||
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
||||
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
||||
extern DECLSPEC char *SDLCALL SDL_strnstr(const char *haystack, const char *needle, size_t maxlen);
|
||||
extern DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle);
|
||||
extern DECLSPEC char *SDLCALL SDL_strtok_r(char *s1, const char *s2, char **saveptr);
|
||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
||||
extern DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strnstr(const char *haystack, const char *needle, size_t maxlen);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_strtok_r(char *s1, const char *s2, char **saveptr);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes);
|
||||
|
||||
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
|
||||
extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
|
||||
extern DECLSPEC double SDLCALL SDL_atof(const char *str);
|
||||
extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
|
||||
extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
|
||||
extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_atoi(const char *str);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_atof(const char *str);
|
||||
extern SDL_DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
|
||||
extern SDL_DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
|
||||
extern SDL_DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
|
||||
|
||||
/**
|
||||
* Compare two null-terminated UTF-8 strings.
|
||||
|
@ -1096,7 +1096,7 @@ extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
||||
|
||||
/**
|
||||
* Compare two UTF-8 strings up to a number of bytes.
|
||||
|
@ -1126,7 +1126,7 @@ extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Compare two null-terminated UTF-8 strings, case-insensitively.
|
||||
|
@ -1154,7 +1154,7 @@ extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1194,16 +1194,16 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
||||
|
||||
extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
|
||||
extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2);
|
||||
extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
|
||||
extern DECLSPEC int SDLCALL SDL_swprintf(SDL_OUT_Z_CAP(maxlen) wchar_t *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const wchar_t *fmt, ... ) SDL_WPRINTF_VARARG_FUNC(3);
|
||||
extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
|
||||
extern DECLSPEC int SDLCALL SDL_vswprintf(SDL_OUT_Z_CAP(maxlen) wchar_t *text, size_t maxlen, const wchar_t *fmt, va_list ap);
|
||||
extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_swprintf(SDL_OUT_Z_CAP(maxlen) wchar_t *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const wchar_t *fmt, ... ) SDL_WPRINTF_VARARG_FUNC(3);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_vswprintf(SDL_OUT_Z_CAP(maxlen) wchar_t *text, size_t maxlen, const wchar_t *fmt, va_list ap);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2);
|
||||
|
||||
#ifndef SDL_PI_D
|
||||
#define SDL_PI_D 3.141592653589793238462643383279502884 /**< pi (double) */
|
||||
|
@ -1240,7 +1240,7 @@ extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING
|
|||
* \sa SDL_asin
|
||||
* \sa SDL_cos
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_acos(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_acos(double x);
|
||||
|
||||
/**
|
||||
* Compute the arc cosine of `x`.
|
||||
|
@ -1268,7 +1268,7 @@ extern DECLSPEC double SDLCALL SDL_acos(double x);
|
|||
* \sa SDL_asinf
|
||||
* \sa SDL_cosf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_acosf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_acosf(float x);
|
||||
|
||||
/**
|
||||
* Compute the arc sine of `x`.
|
||||
|
@ -1296,7 +1296,7 @@ extern DECLSPEC float SDLCALL SDL_acosf(float x);
|
|||
* \sa SDL_acos
|
||||
* \sa SDL_sin
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_asin(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_asin(double x);
|
||||
|
||||
/**
|
||||
* Compute the arc sine of `x`.
|
||||
|
@ -1324,7 +1324,7 @@ extern DECLSPEC double SDLCALL SDL_asin(double x);
|
|||
* \sa SDL_acosf
|
||||
* \sa SDL_sinf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_asinf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_asinf(float x);
|
||||
|
||||
/**
|
||||
* Compute the arc tangent of `x`.
|
||||
|
@ -1354,7 +1354,7 @@ extern DECLSPEC float SDLCALL SDL_asinf(float x);
|
|||
* \sa SDL_atan2
|
||||
* \sa SDL_tan
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_atan(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_atan(double x);
|
||||
|
||||
/**
|
||||
* Compute the arc tangent of `x`.
|
||||
|
@ -1384,7 +1384,7 @@ extern DECLSPEC double SDLCALL SDL_atan(double x);
|
|||
* \sa SDL_atan2f
|
||||
* \sa SDL_tanf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_atanf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_atanf(float x);
|
||||
|
||||
/**
|
||||
* Compute the arc tangent of `y / x`, using the signs of x and y to adjust
|
||||
|
@ -1418,7 +1418,7 @@ extern DECLSPEC float SDLCALL SDL_atanf(float x);
|
|||
* \sa SDL_atan
|
||||
* \sa SDL_tan
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_atan2(double y, double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_atan2(double y, double x);
|
||||
|
||||
/**
|
||||
* Compute the arc tangent of `y / x`, using the signs of x and y to adjust
|
||||
|
@ -1452,7 +1452,7 @@ extern DECLSPEC double SDLCALL SDL_atan2(double y, double x);
|
|||
* \sa SDL_atan
|
||||
* \sa SDL_tan
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_atan2f(float y, float x);
|
||||
|
||||
/**
|
||||
* Compute the ceiling of `x`.
|
||||
|
@ -1478,7 +1478,7 @@ extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x);
|
|||
* \sa SDL_round
|
||||
* \sa SDL_lround
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_ceil(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_ceil(double x);
|
||||
|
||||
/**
|
||||
* Compute the ceiling of `x`.
|
||||
|
@ -1504,7 +1504,7 @@ extern DECLSPEC double SDLCALL SDL_ceil(double x);
|
|||
* \sa SDL_roundf
|
||||
* \sa SDL_lroundf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_ceilf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_ceilf(float x);
|
||||
|
||||
/**
|
||||
* Copy the sign of one floating-point value to another.
|
||||
|
@ -1527,7 +1527,7 @@ extern DECLSPEC float SDLCALL SDL_ceilf(float x);
|
|||
* \sa SDL_copysignf
|
||||
* \sa SDL_fabs
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
||||
|
||||
/**
|
||||
* Copy the sign of one floating-point value to another.
|
||||
|
@ -1550,7 +1550,7 @@ extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
|
|||
* \sa SDL_copysignf
|
||||
* \sa SDL_fabsf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
|
||||
|
||||
/**
|
||||
* Compute the cosine of `x`.
|
||||
|
@ -1576,7 +1576,7 @@ extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
|
|||
* \sa SDL_acos
|
||||
* \sa SDL_sin
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_cos(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_cos(double x);
|
||||
|
||||
/**
|
||||
* Compute the cosine of `x`.
|
||||
|
@ -1602,7 +1602,7 @@ extern DECLSPEC double SDLCALL SDL_cos(double x);
|
|||
* \sa SDL_acosf
|
||||
* \sa SDL_sinf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_cosf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_cosf(float x);
|
||||
|
||||
/**
|
||||
* Compute the exponential of `x`.
|
||||
|
@ -1632,7 +1632,7 @@ extern DECLSPEC float SDLCALL SDL_cosf(float x);
|
|||
* \sa SDL_expf
|
||||
* \sa SDL_log
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_exp(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_exp(double x);
|
||||
|
||||
/**
|
||||
* Compute the exponential of `x`.
|
||||
|
@ -1662,7 +1662,7 @@ extern DECLSPEC double SDLCALL SDL_exp(double x);
|
|||
* \sa SDL_exp
|
||||
* \sa SDL_logf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_expf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_expf(float x);
|
||||
|
||||
/**
|
||||
* Compute the absolute value of `x`
|
||||
|
@ -1681,7 +1681,7 @@ extern DECLSPEC float SDLCALL SDL_expf(float x);
|
|||
*
|
||||
* \sa SDL_fabsf
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_fabs(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_fabs(double x);
|
||||
|
||||
/**
|
||||
* Compute the absolute value of `x`
|
||||
|
@ -1700,7 +1700,7 @@ extern DECLSPEC double SDLCALL SDL_fabs(double x);
|
|||
*
|
||||
* \sa SDL_fabs
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_fabsf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_fabsf(float x);
|
||||
|
||||
/**
|
||||
* Compute the floor of `x`.
|
||||
|
@ -1726,7 +1726,7 @@ extern DECLSPEC float SDLCALL SDL_fabsf(float x);
|
|||
* \sa SDL_round
|
||||
* \sa SDL_lround
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_floor(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_floor(double x);
|
||||
|
||||
/**
|
||||
* Compute the floor of `x`.
|
||||
|
@ -1752,7 +1752,7 @@ extern DECLSPEC double SDLCALL SDL_floor(double x);
|
|||
* \sa SDL_roundf
|
||||
* \sa SDL_lroundf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_floorf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_floorf(float x);
|
||||
|
||||
/**
|
||||
* Truncate `x` to an integer.
|
||||
|
@ -1779,7 +1779,7 @@ extern DECLSPEC float SDLCALL SDL_floorf(float x);
|
|||
* \sa SDL_round
|
||||
* \sa SDL_lround
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_trunc(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_trunc(double x);
|
||||
|
||||
/**
|
||||
* Truncate `x` to an integer.
|
||||
|
@ -1806,7 +1806,7 @@ extern DECLSPEC double SDLCALL SDL_trunc(double x);
|
|||
* \sa SDL_roundf
|
||||
* \sa SDL_lroundf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_truncf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_truncf(float x);
|
||||
|
||||
/**
|
||||
* Return the floating-point remainder of `x / y`
|
||||
|
@ -1834,7 +1834,7 @@ extern DECLSPEC float SDLCALL SDL_truncf(float x);
|
|||
* \sa SDL_round
|
||||
* \sa SDL_lround
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_fmod(double x, double y);
|
||||
|
||||
/**
|
||||
* Return the floating-point remainder of `x / y`
|
||||
|
@ -1862,7 +1862,7 @@ extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
|
|||
* \sa SDL_roundf
|
||||
* \sa SDL_lroundf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
|
||||
|
||||
/**
|
||||
* Compute the natural logarithm of `x`.
|
||||
|
@ -1890,7 +1890,7 @@ extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
|
|||
* \sa SDL_log10
|
||||
* \sa SDL_exp
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_log(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_log(double x);
|
||||
|
||||
/**
|
||||
* Compute the natural logarithm of `x`.
|
||||
|
@ -1917,7 +1917,7 @@ extern DECLSPEC double SDLCALL SDL_log(double x);
|
|||
* \sa SDL_log
|
||||
* \sa SDL_expf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_logf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_logf(float x);
|
||||
|
||||
/**
|
||||
* Compute the base-10 logarithm of `x`.
|
||||
|
@ -1945,7 +1945,7 @@ extern DECLSPEC float SDLCALL SDL_logf(float x);
|
|||
* \sa SDL_log
|
||||
* \sa SDL_pow
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_log10(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_log10(double x);
|
||||
|
||||
/**
|
||||
* Compute the base-10 logarithm of `x`.
|
||||
|
@ -1973,7 +1973,7 @@ extern DECLSPEC double SDLCALL SDL_log10(double x);
|
|||
* \sa SDL_logf
|
||||
* \sa SDL_powf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_log10f(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_log10f(float x);
|
||||
|
||||
/**
|
||||
* Split `x` into integer and fractional parts
|
||||
|
@ -1991,7 +1991,7 @@ extern DECLSPEC float SDLCALL SDL_log10f(float x);
|
|||
* \sa SDL_trunc
|
||||
* \sa SDL_fmod
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_modf(double x, double *y);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_modf(double x, double *y);
|
||||
|
||||
/**
|
||||
* Split `x` into integer and fractional parts
|
||||
|
@ -2009,7 +2009,7 @@ extern DECLSPEC double SDLCALL SDL_modf(double x, double *y);
|
|||
* \sa SDL_truncf
|
||||
* \sa SDL_fmodf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_modff(float x, float *y);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_modff(float x, float *y);
|
||||
|
||||
/**
|
||||
* Raise `x` to the power `y`
|
||||
|
@ -2039,7 +2039,7 @@ extern DECLSPEC float SDLCALL SDL_modff(float x, float *y);
|
|||
* \sa SDL_exp
|
||||
* \sa SDL_log
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
||||
|
||||
/**
|
||||
* Raise `x` to the power `y`
|
||||
|
@ -2069,7 +2069,7 @@ extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
|
|||
* \sa SDL_expf
|
||||
* \sa SDL_logf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_powf(float x, float y);
|
||||
|
||||
/**
|
||||
* Round `x` to the nearest integer.
|
||||
|
@ -2096,7 +2096,7 @@ extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
|
|||
* \sa SDL_ceil
|
||||
* \sa SDL_trunc
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_round(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_round(double x);
|
||||
|
||||
/**
|
||||
* Round `x` to the nearest integer.
|
||||
|
@ -2123,7 +2123,7 @@ extern DECLSPEC double SDLCALL SDL_round(double x);
|
|||
* \sa SDL_ceilf
|
||||
* \sa SDL_truncf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_roundf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_roundf(float x);
|
||||
|
||||
/**
|
||||
* Round `x` to the nearest integer representable as a long
|
||||
|
@ -2150,7 +2150,7 @@ extern DECLSPEC float SDLCALL SDL_roundf(float x);
|
|||
* \sa SDL_ceil
|
||||
* \sa SDL_trunc
|
||||
*/
|
||||
extern DECLSPEC long SDLCALL SDL_lround(double x);
|
||||
extern SDL_DECLSPEC long SDLCALL SDL_lround(double x);
|
||||
|
||||
/**
|
||||
* Round `x` to the nearest integer representable as a long
|
||||
|
@ -2177,7 +2177,7 @@ extern DECLSPEC long SDLCALL SDL_lround(double x);
|
|||
* \sa SDL_ceilf
|
||||
* \sa SDL_truncf
|
||||
*/
|
||||
extern DECLSPEC long SDLCALL SDL_lroundf(float x);
|
||||
extern SDL_DECLSPEC long SDLCALL SDL_lroundf(float x);
|
||||
|
||||
/**
|
||||
* Scale `x` by an integer power of two.
|
||||
|
@ -2200,7 +2200,7 @@ extern DECLSPEC long SDLCALL SDL_lroundf(float x);
|
|||
* \sa SDL_scalbnf
|
||||
* \sa SDL_pow
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
||||
|
||||
/**
|
||||
* Scale `x` by an integer power of two.
|
||||
|
@ -2223,7 +2223,7 @@ extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
|
|||
* \sa SDL_scalbn
|
||||
* \sa SDL_powf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
|
||||
|
||||
/**
|
||||
* Compute the sine of `x`.
|
||||
|
@ -2249,7 +2249,7 @@ extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
|
|||
* \sa SDL_asin
|
||||
* \sa SDL_cos
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_sin(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_sin(double x);
|
||||
|
||||
/**
|
||||
* Compute the sine of `x`.
|
||||
|
@ -2275,7 +2275,7 @@ extern DECLSPEC double SDLCALL SDL_sin(double x);
|
|||
* \sa SDL_asinf
|
||||
* \sa SDL_cosf
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_sinf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_sinf(float x);
|
||||
|
||||
/**
|
||||
* Compute the square root of `x`.
|
||||
|
@ -2299,7 +2299,7 @@ extern DECLSPEC float SDLCALL SDL_sinf(float x);
|
|||
*
|
||||
* \sa SDL_sqrtf
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_sqrt(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_sqrt(double x);
|
||||
|
||||
/**
|
||||
* Compute the square root of `x`.
|
||||
|
@ -2323,7 +2323,7 @@ extern DECLSPEC double SDLCALL SDL_sqrt(double x);
|
|||
*
|
||||
* \sa SDL_sqrt
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_sqrtf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_sqrtf(float x);
|
||||
|
||||
/**
|
||||
* Compute the tangent of `x`.
|
||||
|
@ -2351,7 +2351,7 @@ extern DECLSPEC float SDLCALL SDL_sqrtf(float x);
|
|||
* \sa SDL_atan
|
||||
* \sa SDL_atan2
|
||||
*/
|
||||
extern DECLSPEC double SDLCALL SDL_tan(double x);
|
||||
extern SDL_DECLSPEC double SDLCALL SDL_tan(double x);
|
||||
|
||||
/**
|
||||
* Compute the tangent of `x`.
|
||||
|
@ -2379,7 +2379,7 @@ extern DECLSPEC double SDLCALL SDL_tan(double x);
|
|||
* \sa SDL_atanf
|
||||
* \sa SDL_atan2f
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_tanf(float x);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_tanf(float x);
|
||||
|
||||
/* The SDL implementation of iconv() returns these error codes */
|
||||
#define SDL_ICONV_ERROR (size_t)-1
|
||||
|
@ -2389,10 +2389,10 @@ extern DECLSPEC float SDLCALL SDL_tanf(float x);
|
|||
|
||||
/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
|
||||
typedef struct SDL_iconv_data_t *SDL_iconv_t;
|
||||
extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
|
||||
extern SDL_DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
|
||||
const char *fromcode);
|
||||
extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
||||
extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
||||
extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
||||
size_t * inbytesleft, char **outbuf,
|
||||
size_t * outbytesleft);
|
||||
|
||||
|
@ -2402,7 +2402,7 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
||||
extern SDL_DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
||||
const char *fromcode,
|
||||
const char *inbuf,
|
||||
size_t inbytesleft);
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_storage.h
|
||||
* # CategoryStorage
|
||||
*
|
||||
* Include file for storage container SDL API functions
|
||||
* SDL storage container management.
|
||||
*/
|
||||
|
||||
#ifndef SDL_storage_h_
|
||||
|
@ -113,7 +113,7 @@ typedef struct SDL_Storage SDL_Storage;
|
|||
* \sa SDL_OpenUserStorage
|
||||
* \sa SDL_ReadStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override, SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override, SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Opens up a container for a user's unique read/write filesystem.
|
||||
|
@ -139,7 +139,7 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override,
|
|||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Opens up a container for local filesystem storage.
|
||||
|
@ -163,7 +163,7 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const
|
|||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path);
|
||||
extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path);
|
||||
|
||||
/**
|
||||
* Opens up a container using a client-provided storage interface.
|
||||
|
@ -187,7 +187,7 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path);
|
|||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata);
|
||||
extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata);
|
||||
|
||||
/**
|
||||
* Closes and frees a storage container.
|
||||
|
@ -205,7 +205,7 @@ extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface
|
|||
* \sa SDL_OpenTitleStorage
|
||||
* \sa SDL_OpenUserStorage
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Checks if the storage container is ready to use.
|
||||
|
@ -219,7 +219,7 @@ extern DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Query the size of a file within a storage container.
|
||||
|
@ -235,7 +235,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
|||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length);
|
||||
|
||||
/**
|
||||
* Synchronously read a file from a storage container into a client-provided
|
||||
|
@ -254,7 +254,7 @@ extern DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, const c
|
|||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length);
|
||||
|
||||
/**
|
||||
* Synchronously write a file from client memory into a storage container.
|
||||
|
@ -272,7 +272,7 @@ extern DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const char
|
|||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
|
||||
|
||||
/**
|
||||
* Create a directory in a writable storage container.
|
||||
|
@ -286,7 +286,7 @@ extern DECLSPEC int SDLCALL SDL_WriteStorageFile(SDL_Storage *storage, const cha
|
|||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
|
||||
|
||||
/**
|
||||
* Enumerate a directory in a storage container through a callback function.
|
||||
|
@ -306,7 +306,7 @@ extern DECLSPEC int SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, con
|
|||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove a file or an empty directory in a writable storage container.
|
||||
|
@ -320,7 +320,7 @@ extern DECLSPEC int SDLCALL SDL_EnumerateStorageDirectory(SDL_Storage *storage,
|
|||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
|
||||
|
||||
/**
|
||||
* Rename a file or directory in a writable storage container.
|
||||
|
@ -335,7 +335,7 @@ extern DECLSPEC int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const ch
|
|||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path in a storage container.
|
||||
|
@ -351,7 +351,7 @@ extern DECLSPEC int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const ch
|
|||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
|
||||
|
||||
/**
|
||||
* Queries the remaining space in a storage container.
|
||||
|
@ -364,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const c
|
|||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *storage);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Enumerate a directory tree, filtered by pattern, and return a list.
|
||||
|
@ -401,7 +401,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *storage
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC char **SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, Uint32 flags, int *count);
|
||||
extern SDL_DECLSPEC char **SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_surface.h
|
||||
* # CategorySurface
|
||||
*
|
||||
* Header file for ::SDL_Surface definition and management functions.
|
||||
* SDL_Surface definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_surface_h_
|
||||
|
@ -43,21 +43,19 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* \name Surface flags
|
||||
* The flags on an SDL_Surface.
|
||||
*
|
||||
* These are the currently supported flags for the ::SDL_Surface.
|
||||
* These are generally meant to be considered read-only.
|
||||
*
|
||||
* \internal
|
||||
* Used internally (read-only).
|
||||
* \since This datatype is available since SDL 3.0.0.
|
||||
*/
|
||||
/* @{ */
|
||||
#define SDL_SWSURFACE 0 /**< Just here for compatibility */
|
||||
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
|
||||
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
|
||||
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
|
||||
#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
|
||||
#define SDL_SURFACE_USES_PROPERTIES 0x00000010 /**< Surface uses properties */
|
||||
/* @} *//* Surface flags */
|
||||
typedef Uint32 SDL_SurfaceFlags;
|
||||
|
||||
#define SDL_PREALLOC 0x00000001u /**< Surface uses preallocated memory */
|
||||
#define SDL_RLEACCEL 0x00000002u /**< Surface is RLE encoded */
|
||||
#define SDL_DONTFREE 0x00000004u /**< Surface is referenced internally */
|
||||
#define SDL_SIMD_ALIGNED 0x00000008u /**< Surface uses aligned memory */
|
||||
#define SDL_SURFACE_USES_PROPERTIES 0x00000010u /**< Surface uses properties */
|
||||
|
||||
/**
|
||||
* Evaluates to true if the surface needs to be locked before access.
|
||||
|
@ -119,7 +117,7 @@ typedef enum SDL_FlipMode
|
|||
*/
|
||||
typedef struct SDL_Surface
|
||||
{
|
||||
Uint32 flags; /**< Read-only */
|
||||
SDL_SurfaceFlags flags; /**< Read-only */
|
||||
SDL_PixelFormat *format; /**< Read-only */
|
||||
int w, h; /**< Read-only */
|
||||
int pitch; /**< Read-only */
|
||||
|
@ -158,7 +156,7 @@ typedef struct SDL_Surface
|
|||
* \sa SDL_CreateSurfaceFrom
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format);
|
||||
|
||||
/**
|
||||
* Allocate a new RGB surface with a specific pixel format and existing pixel
|
||||
|
@ -186,7 +184,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SD
|
|||
* \sa SDL_CreateSurface
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, SDL_PixelFormatEnum format);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, SDL_PixelFormatEnum format);
|
||||
|
||||
/**
|
||||
* Free an RGB surface.
|
||||
|
@ -200,7 +198,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int wid
|
|||
* \sa SDL_CreateSurface
|
||||
* \sa SDL_CreateSurfaceFrom
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a surface.
|
||||
|
@ -236,7 +234,7 @@ extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
|
||||
|
||||
#define SDL_PROP_SURFACE_COLORSPACE_NUMBER "SDL.surface.colorspace"
|
||||
#define SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT "SDL.surface.SDR_white_point"
|
||||
|
@ -256,7 +254,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *s
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
|
||||
|
||||
/**
|
||||
* Get the colorspace used by a surface.
|
||||
|
@ -273,7 +271,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_C
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace *colorspace);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace *colorspace);
|
||||
|
||||
/**
|
||||
* Set the palette used by a surface.
|
||||
|
@ -287,7 +285,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface, SDL_C
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
|
||||
|
||||
/**
|
||||
* Set up a surface for directly accessing the pixels.
|
||||
|
@ -310,7 +308,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Pale
|
|||
* \sa SDL_MUSTLOCK
|
||||
* \sa SDL_UnlockSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Release a surface after directly accessing the pixels.
|
||||
|
@ -321,7 +319,7 @@ extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
|
|||
*
|
||||
* \sa SDL_LockSurface
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Load a BMP image from a seekable SDL data stream.
|
||||
|
@ -341,7 +339,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
|||
* \sa SDL_LoadBMP
|
||||
* \sa SDL_SaveBMP_IO
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Load a BMP image from a file.
|
||||
|
@ -359,7 +357,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool
|
|||
* \sa SDL_LoadBMP_IO
|
||||
* \sa SDL_SaveBMP
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
||||
|
||||
/**
|
||||
* Save a surface to a seekable SDL data stream in BMP format.
|
||||
|
@ -382,7 +380,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
|||
* \sa SDL_LoadBMP_IO
|
||||
* \sa SDL_SaveBMP
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Save a surface to a file.
|
||||
|
@ -403,7 +401,7 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *d
|
|||
* \sa SDL_LoadBMP
|
||||
* \sa SDL_SaveBMP_IO
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
|
||||
|
||||
/**
|
||||
* Set the RLE acceleration hint for a surface.
|
||||
|
@ -422,7 +420,7 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
|
|||
* \sa SDL_LockSurface
|
||||
* \sa SDL_UnlockSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag);
|
||||
|
||||
/**
|
||||
* Returns whether the surface is RLE enabled.
|
||||
|
@ -436,7 +434,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag);
|
|||
*
|
||||
* \sa SDL_SetSurfaceRLE
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Set the color key (transparent pixel) in a surface.
|
||||
|
@ -462,7 +460,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
|
|||
* \sa SDL_GetSurfaceColorKey
|
||||
* \sa SDL_SurfaceHasColorKey
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key);
|
||||
|
||||
/**
|
||||
* Returns whether the surface has a color key.
|
||||
|
@ -477,7 +475,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, int fla
|
|||
* \sa SDL_SetSurfaceColorKey
|
||||
* \sa SDL_GetSurfaceColorKey
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Get the color key (transparent pixel) for a surface.
|
||||
|
@ -497,7 +495,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
|
|||
* \sa SDL_SetSurfaceColorKey
|
||||
* \sa SDL_SurfaceHasColorKey
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
|
||||
|
||||
/**
|
||||
* Set an additional color value multiplied into blit operations.
|
||||
|
@ -520,7 +518,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32
|
|||
* \sa SDL_GetSurfaceColorMod
|
||||
* \sa SDL_SetSurfaceAlphaMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -538,7 +536,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r
|
|||
* \sa SDL_GetSurfaceAlphaMod
|
||||
* \sa SDL_SetSurfaceColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
|
||||
/**
|
||||
* Set an additional alpha value used in blit operations.
|
||||
|
@ -558,7 +556,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *
|
|||
* \sa SDL_GetSurfaceAlphaMod
|
||||
* \sa SDL_SetSurfaceColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
|
||||
|
||||
/**
|
||||
* Get the additional alpha value used in blit operations.
|
||||
|
@ -573,7 +571,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 a
|
|||
* \sa SDL_GetSurfaceColorMod
|
||||
* \sa SDL_SetSurfaceAlphaMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
|
||||
|
||||
/**
|
||||
* Set the blend mode used for blit operations.
|
||||
|
@ -591,7 +589,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *
|
|||
*
|
||||
* \sa SDL_GetSurfaceBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
|
||||
|
||||
/**
|
||||
* Get the blend mode used for blit operations.
|
||||
|
@ -605,7 +603,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_Bl
|
|||
*
|
||||
* \sa SDL_SetSurfaceBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
|
||||
|
||||
/**
|
||||
* Set the clipping rectangle for a surface.
|
||||
|
@ -626,7 +624,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_Bl
|
|||
*
|
||||
* \sa SDL_GetSurfaceClipRect
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the clipping rectangle for a surface.
|
||||
|
@ -645,7 +643,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, co
|
|||
*
|
||||
* \sa SDL_SetSurfaceClipRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Flip a surface vertically or horizontally.
|
||||
|
@ -657,7 +655,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rec
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
|
||||
|
||||
/**
|
||||
* Creates a new surface identical to the existing surface.
|
||||
|
@ -672,7 +670,7 @@ extern DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode f
|
|||
*
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Copy an existing surface to a new surface of the specified format.
|
||||
|
@ -695,7 +693,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
|
|||
* \sa SDL_CreatePixelFormat
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format);
|
||||
|
||||
/**
|
||||
* Copy an existing surface to a new surface of the specified format.
|
||||
|
@ -716,7 +714,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, co
|
|||
* \sa SDL_ConvertSurfaceFormatAndColorspace
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format);
|
||||
|
||||
/**
|
||||
* Copy an existing surface to a new surface of the specified format and
|
||||
|
@ -739,7 +737,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surfa
|
|||
* \sa SDL_ConvertSurfaceFormat
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Copy a block of pixels of one format to another format.
|
||||
|
@ -759,7 +757,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormatAndColorspace(SDL_S
|
|||
*
|
||||
* \sa SDL_ConvertPixelsAndColorspace
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch);
|
||||
|
||||
/**
|
||||
* Copy a block of pixels of one format and colorspace to another format and
|
||||
|
@ -788,7 +786,7 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFo
|
|||
*
|
||||
* \sa SDL_ConvertPixels
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch);
|
||||
|
||||
/**
|
||||
* Premultiply the alpha on a block of pixels.
|
||||
|
@ -810,7 +808,7 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch);
|
||||
|
||||
/**
|
||||
* Perform a fast fill of a rectangle with a specific color.
|
||||
|
@ -835,7 +833,7 @@ extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_Pixe
|
|||
*
|
||||
* \sa SDL_FillSurfaceRects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
|
||||
|
||||
/**
|
||||
* Perform a fast fill of a set of rectangles with a specific color.
|
||||
|
@ -860,7 +858,7 @@ extern DECLSPEC int SDLCALL SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect
|
|||
*
|
||||
* \sa SDL_FillSurfaceRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
|
||||
|
||||
/**
|
||||
* Performs a fast blit from the source surface to the destination surface.
|
||||
|
@ -930,7 +928,7 @@ extern DECLSPEC int SDLCALL SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rec
|
|||
*
|
||||
* \sa SDL_BlitSurfaceScaled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
/**
|
||||
* Perform low-level surface blitting only.
|
||||
|
@ -951,7 +949,7 @@ extern DECLSPEC int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *sr
|
|||
*
|
||||
* \sa SDL_BlitSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);
|
||||
|
||||
/**
|
||||
* Perform stretch blit between two surfaces of the same format.
|
||||
|
@ -973,7 +971,7 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL
|
|||
*
|
||||
* \sa SDL_BlitSurfaceScaled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
|
||||
/**
|
||||
* Perform a scaled blit to a destination surface, which may be of a different
|
||||
|
@ -994,7 +992,7 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *sr
|
|||
*
|
||||
* \sa SDL_BlitSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
|
||||
/**
|
||||
* Perform low-level surface scaled blitting only.
|
||||
|
@ -1016,7 +1014,7 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Re
|
|||
*
|
||||
* \sa SDL_BlitSurfaceScaled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
|
||||
/**
|
||||
* Retrieves a single pixel from a surface.
|
||||
|
@ -1043,7 +1041,7 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, con
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_system.h
|
||||
* # CategorySystem
|
||||
*
|
||||
* Include file for platform specific SDL API functions
|
||||
* Platform-specific SDL API functions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_system_h_
|
||||
|
@ -88,7 +88,7 @@ typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
|||
* \sa SDL_WindowsMessageHook
|
||||
* \sa SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
||||
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
|
||||
|
||||
|
@ -106,7 +106,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook ca
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
|
||||
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
||||
|
||||
|
@ -127,7 +127,7 @@ extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
||||
|
||||
|
@ -150,7 +150,7 @@ typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata);
|
||||
|
||||
/* Platform specific functions for Linux*/
|
||||
#ifdef SDL_PLATFORM_LINUX
|
||||
|
@ -166,7 +166,7 @@ extern DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
|
||||
|
||||
/**
|
||||
* Sets the priority (not nice level) and scheduling policy for a thread.
|
||||
|
@ -182,7 +182,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
|
||||
#endif /* SDL_PLATFORM_LINUX */
|
||||
|
||||
|
@ -228,7 +228,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
|||
*
|
||||
* \sa SDL_iOSSetEventPump
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
|
||||
|
||||
/**
|
||||
* Use this function to enable or disable the SDL event pump on Apple iOS.
|
||||
|
@ -241,7 +241,7 @@ extern DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window * window, int
|
|||
*
|
||||
* \sa SDL_iOSSetAnimationCallback
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled);
|
||||
|
||||
#endif /* SDL_PLATFORM_IOS */
|
||||
|
||||
|
@ -268,7 +268,7 @@ extern DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled);
|
|||
*
|
||||
* \sa SDL_AndroidGetActivity
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
||||
|
||||
/**
|
||||
* Retrieve the Java instance of the Android activity class.
|
||||
|
@ -290,7 +290,7 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
|
|||
*
|
||||
* \sa SDL_AndroidGetJNIEnv
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
||||
|
||||
/**
|
||||
* Query Android API level of the current device.
|
||||
|
@ -325,7 +325,7 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
||||
|
||||
/**
|
||||
* Query if the application is running on Android TV.
|
||||
|
@ -334,7 +334,7 @@ extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
||||
|
||||
/**
|
||||
* Query if the application is running on a Chromebook.
|
||||
|
@ -343,7 +343,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
||||
|
||||
/**
|
||||
* Query if the application is running on a Samsung DeX docking station.
|
||||
|
@ -352,14 +352,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
||||
|
||||
/**
|
||||
* Trigger the Android system back button behavior.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
||||
|
||||
/**
|
||||
* See the official Android developer guide for more information:
|
||||
|
@ -386,7 +386,7 @@ extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
|
|||
*
|
||||
* \sa SDL_AndroidGetExternalStorageState
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
||||
|
||||
/**
|
||||
* Get the current state of external storage.
|
||||
|
@ -405,7 +405,7 @@ extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
|
|||
*
|
||||
* \sa SDL_AndroidGetExternalStoragePath
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
|
||||
|
||||
/**
|
||||
* Get the path used for external storage for this application.
|
||||
|
@ -423,7 +423,7 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
|
|||
*
|
||||
* \sa SDL_AndroidGetExternalStorageState
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
||||
|
||||
|
||||
typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
||||
|
@ -456,7 +456,7 @@ typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, con
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
|
||||
|
||||
/**
|
||||
* Shows an Android toast notification.
|
||||
|
@ -482,7 +482,7 @@ extern DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
|
||||
/**
|
||||
* Send a user command to SDLActivity.
|
||||
|
@ -496,7 +496,7 @@ extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int durati
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
|
||||
#endif /* SDL_PLATFORM_ANDROID */
|
||||
|
||||
|
@ -571,7 +571,7 @@ typedef enum SDL_WinRT_DeviceFamily
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPath(SDL_WinRT_Path pathType);
|
||||
extern SDL_DECLSPEC const char * SDLCALL SDL_WinRTGetFSPath(SDL_WinRT_Path pathType);
|
||||
|
||||
/**
|
||||
* Detects the device family of WinRT platform at runtime.
|
||||
|
@ -580,7 +580,7 @@ extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPath(SDL_WinRT_Path pathType)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
||||
extern SDL_DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
||||
|
||||
#endif /* SDL_PLATFORM_WINRT */
|
||||
|
||||
|
@ -593,7 +593,7 @@ extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
||||
|
||||
/* Functions used by iOS app delegates to notify SDL about state changes. */
|
||||
|
||||
|
@ -612,7 +612,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
||||
|
||||
/**
|
||||
* Let iOS apps with external event handling report
|
||||
|
@ -629,7 +629,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
||||
|
||||
/**
|
||||
* Let iOS apps with external event handling report
|
||||
|
@ -646,7 +646,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
||||
|
||||
/**
|
||||
* Let iOS apps with external event handling report
|
||||
|
@ -663,7 +663,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
||||
|
||||
/**
|
||||
* Let iOS apps with external event handling report
|
||||
|
@ -680,7 +680,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
||||
|
||||
/**
|
||||
* Let iOS apps with external event handling report
|
||||
|
@ -697,7 +697,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
||||
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
|
||||
|
@ -716,7 +716,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -740,7 +740,7 @@ typedef struct XUser *XUserHandle;
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
|
||||
|
||||
/**
|
||||
* Gets a reference to the default user handle for GDK.
|
||||
|
@ -754,7 +754,7 @@ extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_test_assert.h
|
||||
*
|
||||
* Assertion functions of SDL test framework.
|
||||
*
|
||||
* This code is a part of the SDL test library, not the main SDL library.
|
||||
|
|
|
@ -90,7 +90,7 @@ typedef struct
|
|||
|
||||
/* Renderer info */
|
||||
const char *renderdriver;
|
||||
Uint32 render_flags;
|
||||
int render_vsync;
|
||||
SDL_bool skip_renderer;
|
||||
SDL_Renderer **renderers;
|
||||
SDL_Texture **targets;
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_test_crc32.h
|
||||
*
|
||||
* CRC32 functions of SDL test framework.
|
||||
*
|
||||
* This code is a part of the SDL test library, not the main SDL library.
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_test_fuzzer.h
|
||||
*
|
||||
* Fuzzer functions of SDL test framework.
|
||||
*
|
||||
* This code is a part of the SDL test library, not the main SDL library.
|
||||
|
@ -49,7 +47,6 @@ extern "C" {
|
|||
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Note: The fuzzer implementation uses a static instance of random context
|
||||
* internally which makes it thread-UNsafe.
|
||||
*/
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#define SDL_thread_h_
|
||||
|
||||
/**
|
||||
* \file SDL_thread.h
|
||||
* # CategoryThread
|
||||
*
|
||||
* Header for the SDL thread management routines.
|
||||
* SDL thread management routines.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
@ -130,7 +130,7 @@ typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
extern SDL_DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
||||
pfnSDL_CurrentEndThread pfnEndThread);
|
||||
|
@ -149,7 +149,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Thread *SDLCALL
|
||||
extern SDL_DECLSPEC SDL_Thread *SDLCALL
|
||||
SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
||||
const char *name, const size_t stacksize, void *data,
|
||||
pfnSDL_CurrentBeginThread pfnBeginThread,
|
||||
|
@ -190,7 +190,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
|
|||
* \sa SDL_CreateThreadWithStackSize
|
||||
* \sa SDL_WaitThread
|
||||
*/
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
||||
extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
||||
|
||||
/**
|
||||
* Create a new thread with a specific stack size.
|
||||
|
@ -232,7 +232,7 @@ extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, con
|
|||
* \sa SDL_CreateThread
|
||||
* \sa SDL_WaitThread
|
||||
*/
|
||||
extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
||||
extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -248,7 +248,7 @@ extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFun
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
||||
|
||||
/**
|
||||
* Get the thread identifier for the current thread.
|
||||
|
@ -266,7 +266,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
|||
*
|
||||
* \sa SDL_GetThreadID
|
||||
*/
|
||||
extern DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void);
|
||||
extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void);
|
||||
|
||||
/**
|
||||
* Get the thread identifier for the specified thread.
|
||||
|
@ -283,7 +283,7 @@ extern DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void);
|
|||
*
|
||||
* \sa SDL_GetCurrentThreadID
|
||||
*/
|
||||
extern DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
||||
extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
||||
|
||||
/**
|
||||
* Set the priority for the current thread.
|
||||
|
@ -298,7 +298,7 @@ extern DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
||||
|
||||
/**
|
||||
* Wait for a thread to finish.
|
||||
|
@ -333,7 +333,7 @@ extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
|
|||
* \sa SDL_CreateThread
|
||||
* \sa SDL_DetachThread
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
||||
|
||||
/**
|
||||
* Let a thread clean up on exit without intervention.
|
||||
|
@ -369,7 +369,7 @@ extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
|
|||
* \sa SDL_CreateThread
|
||||
* \sa SDL_WaitThread
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
||||
|
||||
/**
|
||||
* Create a piece of thread-local storage.
|
||||
|
@ -384,7 +384,7 @@ extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
|
|||
* \sa SDL_GetTLS
|
||||
* \sa SDL_SetTLS
|
||||
*/
|
||||
extern DECLSPEC SDL_TLSID SDLCALL SDL_CreateTLS(void);
|
||||
extern SDL_DECLSPEC SDL_TLSID SDLCALL SDL_CreateTLS(void);
|
||||
|
||||
/**
|
||||
* Get the current thread's value associated with a thread local storage ID.
|
||||
|
@ -397,7 +397,7 @@ extern DECLSPEC SDL_TLSID SDLCALL SDL_CreateTLS(void);
|
|||
*
|
||||
* \sa SDL_SetTLS
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID id);
|
||||
extern SDL_DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID id);
|
||||
|
||||
/**
|
||||
* Set the current thread's value associated with a thread local storage ID.
|
||||
|
@ -421,14 +421,14 @@ extern DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID id);
|
|||
*
|
||||
* \sa SDL_GetTLS
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
||||
|
||||
/**
|
||||
* Cleanup all TLS data for this thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CleanupTLS(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_CleanupTLS(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -23,9 +23,9 @@ freely, subject to the following restrictions:
|
|||
#define SDL_time_h_
|
||||
|
||||
/**
|
||||
* \file SDL_time.h
|
||||
* # CategoryTime
|
||||
*
|
||||
* Header for the SDL realtime clock and date/time routines.
|
||||
* SDL realtime clock and date/time routines.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_error.h>
|
||||
|
@ -95,10 +95,12 @@ typedef enum SDL_TimeFormat
|
|||
* format, may be NULL
|
||||
* \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time
|
||||
* format, may be NULL
|
||||
* \returns 0 on success or -1 on error; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat);
|
||||
|
||||
/**
|
||||
* Gets the current value of the system realtime clock in nanoseconds since
|
||||
|
@ -110,7 +112,7 @@ extern DECLSPEC int SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dat
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
|
||||
|
||||
/**
|
||||
* Converts an SDL_Time in nanoseconds since the epoch to a calendar time in
|
||||
|
@ -126,7 +128,7 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentTime(SDL_Time *ticks);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
|
||||
|
||||
/**
|
||||
* Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
|
||||
|
@ -141,7 +143,7 @@ extern DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
|
||||
|
||||
/**
|
||||
* Converts an SDL time into a Windows FILETIME (100-nanosecond intervals
|
||||
|
@ -157,7 +159,7 @@ extern DECLSPEC int SDLCALL SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_TimeToWindows(SDL_Time ticks, Uint32 *dwLowDateTime, Uint32 *dwHighDateTime);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_TimeToWindows(SDL_Time ticks, Uint32 *dwLowDateTime, Uint32 *dwHighDateTime);
|
||||
|
||||
/**
|
||||
* Converts a Windows FILETIME (100-nanosecond intervals since January 1,
|
||||
|
@ -172,7 +174,7 @@ extern DECLSPEC void SDLCALL SDL_TimeToWindows(SDL_Time ticks, Uint32 *dwLowDate
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, Uint32 dwHighDateTime);
|
||||
extern SDL_DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, Uint32 dwHighDateTime);
|
||||
|
||||
/**
|
||||
* Get the number of days in a month for a given year.
|
||||
|
@ -184,7 +186,7 @@ extern DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, Uint3
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month);
|
||||
|
||||
/**
|
||||
* Get the day of year for a calendar date.
|
||||
|
@ -197,7 +199,7 @@ extern DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day);
|
||||
|
||||
/**
|
||||
* Get the day of week for a calendar date.
|
||||
|
@ -210,7 +212,7 @@ extern DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDayOfWeek(int year, int month, int day);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetDayOfWeek(int year, int month, int day);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
#define SDL_timer_h_
|
||||
|
||||
/**
|
||||
* \file SDL_timer.h
|
||||
* # CategoryTimer
|
||||
*
|
||||
* Header for the SDL time management routines.
|
||||
* SDL time management routines.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
@ -58,7 +58,7 @@ extern "C" {
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetTicks(void);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetTicks(void);
|
||||
|
||||
/**
|
||||
* Get the number of nanoseconds since SDL library initialization.
|
||||
|
@ -68,7 +68,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetTicksNS(void);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetTicksNS(void);
|
||||
|
||||
/**
|
||||
* Get the current value of the high resolution counter.
|
||||
|
@ -85,7 +85,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicksNS(void);
|
|||
*
|
||||
* \sa SDL_GetPerformanceFrequency
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
|
||||
|
||||
/**
|
||||
* Get the count per second of the high resolution counter.
|
||||
|
@ -96,7 +96,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
|
|||
*
|
||||
* \sa SDL_GetPerformanceCounter
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
|
||||
extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
|
||||
|
||||
/**
|
||||
* Wait a specified number of milliseconds before returning.
|
||||
|
@ -109,7 +109,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
||||
|
||||
/**
|
||||
* Wait a specified number of nanoseconds before returning.
|
||||
|
@ -122,7 +122,7 @@ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DelayNS(Uint64 ns);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DelayNS(Uint64 ns);
|
||||
|
||||
/**
|
||||
* Function prototype for the timer callback function.
|
||||
|
@ -187,7 +187,7 @@ typedef Uint32 SDL_TimerID;
|
|||
*
|
||||
* \sa SDL_RemoveTimer
|
||||
*/
|
||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
||||
extern SDL_DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
||||
SDL_TimerCallback callback,
|
||||
void *param);
|
||||
|
||||
|
@ -202,7 +202,7 @@ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
|||
*
|
||||
* \sa SDL_AddTimer
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_touch.h
|
||||
* # CategoryTouch
|
||||
*
|
||||
* Include file for SDL touch event handling.
|
||||
* SDL touch management.
|
||||
*/
|
||||
|
||||
#ifndef SDL_touch_h_
|
||||
|
@ -91,7 +91,7 @@ typedef struct SDL_Finger
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count);
|
||||
extern SDL_DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get the touch device name as reported from the driver.
|
||||
|
@ -104,7 +104,7 @@ extern DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID);
|
||||
extern SDL_DECLSPEC const char* SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID);
|
||||
|
||||
/**
|
||||
* Get the type of the given touch device.
|
||||
|
@ -114,7 +114,7 @@ extern DECLSPEC const char* SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
|
||||
extern SDL_DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
|
||||
|
||||
/**
|
||||
* Get a list of active fingers for a given touch device.
|
||||
|
@ -128,7 +128,7 @@ extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID t
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Finger **SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count);
|
||||
extern SDL_DECLSPEC SDL_Finger **SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -20,9 +20,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_version.h
|
||||
* # CategoryVersion
|
||||
*
|
||||
* This header defines the current SDL version.
|
||||
* Functionality to query the current SDL version, both as headers the app was
|
||||
* compiled against, and a library the app is linked to.
|
||||
*/
|
||||
|
||||
#ifndef SDL_version_h_
|
||||
|
@ -38,58 +39,16 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/**
|
||||
* Information about the version of SDL in use.
|
||||
*
|
||||
* Represents the library's version as three levels: major revision
|
||||
* (increments with massive changes, additions, and enhancements), minor
|
||||
* revision (increments with backwards-compatible changes to the major
|
||||
* revision), and patchlevel (increments with fixes to the minor revision).
|
||||
*
|
||||
* \since This struct is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_VERSION
|
||||
* \sa SDL_GetVersion
|
||||
* The current version of SDL
|
||||
*/
|
||||
typedef struct SDL_Version
|
||||
{
|
||||
Uint8 major; /**< major version */
|
||||
Uint8 minor; /**< minor version */
|
||||
Uint8 patch; /**< update version */
|
||||
} SDL_Version;
|
||||
|
||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */
|
||||
#define SDL_MAJOR_VERSION 3
|
||||
#define SDL_MINOR_VERSION 1
|
||||
#define SDL_PATCHLEVEL 2
|
||||
|
||||
/**
|
||||
* Macro to determine SDL version program was compiled against.
|
||||
*
|
||||
* This macro fills in an SDL_Version structure with the version of the
|
||||
* library you compiled against. This is determined by what header the
|
||||
* compiler uses. Note that if you dynamically linked the library, you might
|
||||
* have a slightly newer or older version at runtime. That version can be
|
||||
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(), is not a
|
||||
* macro.
|
||||
*
|
||||
* \param x A pointer to an SDL_Version struct to initialize.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Version
|
||||
* \sa SDL_GetVersion
|
||||
*/
|
||||
#define SDL_VERSION(x) \
|
||||
{ \
|
||||
(x)->major = SDL_MAJOR_VERSION; \
|
||||
(x)->minor = SDL_MINOR_VERSION; \
|
||||
(x)->patch = SDL_PATCHLEVEL; \
|
||||
}
|
||||
#define SDL_MICRO_VERSION 2
|
||||
|
||||
/**
|
||||
* This macro turns the version numbers into a numeric value.
|
||||
*
|
||||
* (1,2,3) becomes 0x1000203.
|
||||
* (1,2,3) becomes 1002003.
|
||||
*
|
||||
* \param major the major version number.
|
||||
* \param minor the minorversion number.
|
||||
|
@ -98,15 +57,48 @@ typedef struct SDL_Version
|
|||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_VERSIONNUM(major, minor, patch) \
|
||||
((major) << 24 | (minor) << 8 | (patch) << 0)
|
||||
((major) * 1000000 + (minor) * 1000 + (patch))
|
||||
|
||||
/**
|
||||
* This macro extracts the major version from a version number
|
||||
*
|
||||
* 1002003 becomes 1.
|
||||
*
|
||||
* \param version the version number.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_VERSIONNUM_MAJOR(version) ((version) / 1000000)
|
||||
|
||||
/**
|
||||
* This macro extracts the minor version from a version number
|
||||
*
|
||||
* 1002003 becomes 2.
|
||||
*
|
||||
* \param version the version number.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_VERSIONNUM_MINOR(version) (((version) / 1000) % 1000)
|
||||
|
||||
/**
|
||||
* This macro extracts the micro version from a version number
|
||||
*
|
||||
* 1002003 becomes 3.
|
||||
*
|
||||
* \param version the version number.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_VERSIONNUM_MICRO(version) ((version) % 1000)
|
||||
|
||||
/**
|
||||
* This is the version number macro for the current SDL version.
|
||||
*
|
||||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_COMPILEDVERSION \
|
||||
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
|
||||
#define SDL_VERSION \
|
||||
SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION)
|
||||
|
||||
/**
|
||||
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
|
||||
|
@ -114,27 +106,25 @@ typedef struct SDL_Version
|
|||
* \since This macro is available since SDL 3.0.0.
|
||||
*/
|
||||
#define SDL_VERSION_ATLEAST(X, Y, Z) \
|
||||
(SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
||||
(SDL_VERSION >= SDL_VERSIONNUM(X, Y, Z))
|
||||
|
||||
/**
|
||||
* Get the version of SDL that is linked against your program.
|
||||
*
|
||||
* If you are linking to SDL dynamically, then it is possible that the current
|
||||
* version will be different than the version you compiled against. This
|
||||
* function returns the current version, while SDL_VERSION() is a macro that
|
||||
* tells you what version you compiled with.
|
||||
* function returns the current version, while SDL_VERSION is the version you
|
||||
* compiled with.
|
||||
*
|
||||
* This function may be called safely at any time, even before SDL_Init().
|
||||
*
|
||||
* \param ver the SDL_Version structure that contains the version information
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* \returns the version of the linked library.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetRevision
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_Version * ver);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetVersion(void);
|
||||
|
||||
/**
|
||||
* Get the code revision of SDL that is linked against your program.
|
||||
|
@ -160,7 +150,7 @@ extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_Version * ver);
|
|||
*
|
||||
* \sa SDL_GetVersion
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetRevision(void);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_video.h
|
||||
* # CategoryVideo
|
||||
*
|
||||
* Header file for SDL video functions.
|
||||
* SDL video functions.
|
||||
*/
|
||||
|
||||
#ifndef SDL_video_h_
|
||||
|
@ -330,7 +330,7 @@ typedef enum SDL_GLContextResetNotification
|
|||
*
|
||||
* \sa SDL_GetVideoDriver
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
|
||||
|
||||
/**
|
||||
* Get the name of a built in video driver.
|
||||
|
@ -345,7 +345,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
|
|||
*
|
||||
* \sa SDL_GetNumVideoDrivers
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
|
||||
|
||||
/**
|
||||
* Get the name of the currently initialized video driver.
|
||||
|
@ -358,7 +358,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
|
|||
* \sa SDL_GetNumVideoDrivers
|
||||
* \sa SDL_GetVideoDriver
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
|
||||
|
||||
/**
|
||||
* Get the current system theme.
|
||||
|
@ -367,7 +367,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void);
|
||||
extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected displays.
|
||||
|
@ -379,7 +379,7 @@ extern DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayID *SDLCALL SDL_GetDisplays(int *count);
|
||||
extern SDL_DECLSPEC SDL_DisplayID *SDLCALL SDL_GetDisplays(int *count);
|
||||
|
||||
/**
|
||||
* Return the primary display.
|
||||
|
@ -391,7 +391,7 @@ extern DECLSPEC SDL_DisplayID *SDLCALL SDL_GetDisplays(int *count);
|
|||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
||||
extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a display.
|
||||
|
@ -428,7 +428,7 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID displayID);
|
||||
|
||||
#define SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN "SDL.display.HDR_enabled"
|
||||
#define SDL_PROP_DISPLAY_SDR_WHITE_POINT_FLOAT "SDL.display.SDR_white_point"
|
||||
|
@ -446,7 +446,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID
|
|||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get the desktop area represented by a display.
|
||||
|
@ -463,7 +463,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID);
|
|||
* \sa SDL_GetDisplayUsableBounds
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the usable desktop area represented by a display, in screen
|
||||
|
@ -487,7 +487,7 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(SDL_DisplayID displayID, SDL_Re
|
|||
* \sa SDL_GetDisplayBounds
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID, SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the orientation of a display when it is unrotated.
|
||||
|
@ -500,7 +500,7 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(SDL_DisplayID displayID,
|
|||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetNaturalDisplayOrientation(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetNaturalDisplayOrientation(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get the orientation of a display.
|
||||
|
@ -513,7 +513,7 @@ extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetNaturalDisplayOrientation(
|
|||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetCurrentDisplayOrientation(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetCurrentDisplayOrientation(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get the content scale of a display.
|
||||
|
@ -531,7 +531,7 @@ extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetCurrentDisplayOrientation(
|
|||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get a list of fullscreen display modes available on a display.
|
||||
|
@ -555,7 +555,7 @@ extern DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displayID
|
|||
*
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC const SDL_DisplayMode **SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode **SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count);
|
||||
|
||||
/**
|
||||
* Get the closest match to the requested display mode.
|
||||
|
@ -583,7 +583,7 @@ extern DECLSPEC const SDL_DisplayMode **SDLCALL SDL_GetFullscreenDisplayModes(SD
|
|||
* \sa SDL_GetDisplays
|
||||
* \sa SDL_GetFullscreenDisplayModes
|
||||
*/
|
||||
extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes);
|
||||
|
||||
/**
|
||||
* Get information about the desktop's display mode.
|
||||
|
@ -602,7 +602,7 @@ extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetClosestFullscreenDisplayMo
|
|||
* \sa SDL_GetCurrentDisplayMode
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get information about the current display mode.
|
||||
|
@ -621,7 +621,7 @@ extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDesktopDisplayMode(SDL_Dis
|
|||
* \sa SDL_GetDesktopDisplayMode
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayID displayID);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayID displayID);
|
||||
|
||||
/**
|
||||
* Get the display containing a point.
|
||||
|
@ -635,7 +635,7 @@ extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetCurrentDisplayMode(SDL_Dis
|
|||
* \sa SDL_GetDisplayBounds
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForPoint(const SDL_Point *point);
|
||||
extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForPoint(const SDL_Point *point);
|
||||
|
||||
/**
|
||||
* Get the display primarily containing a rect.
|
||||
|
@ -650,7 +650,7 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForPoint(const SDL_Point *po
|
|||
* \sa SDL_GetDisplayBounds
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForRect(const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForRect(const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the display associated with a window.
|
||||
|
@ -665,7 +665,7 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForRect(const SDL_Rect *rect
|
|||
* \sa SDL_GetDisplayBounds
|
||||
* \sa SDL_GetDisplays
|
||||
*/
|
||||
extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the pixel density of a window.
|
||||
|
@ -682,7 +682,7 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetDisplayForWindow(SDL_Window *window
|
|||
*
|
||||
* \sa SDL_GetWindowDisplayScale
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetWindowPixelDensity(SDL_Window *window);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_GetWindowPixelDensity(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the content display scale relative to a window's pixel size.
|
||||
|
@ -704,7 +704,7 @@ extern DECLSPEC float SDLCALL SDL_GetWindowPixelDensity(SDL_Window *window);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window);
|
||||
extern SDL_DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the display mode to use when a window is visible and fullscreen.
|
||||
|
@ -737,7 +737,7 @@ extern DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window);
|
|||
* \sa SDL_SetWindowFullscreen
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, const SDL_DisplayMode *mode);
|
||||
|
||||
/**
|
||||
* Query the display mode to use when a window is visible at fullscreen.
|
||||
|
@ -751,7 +751,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, cons
|
|||
* \sa SDL_SetWindowFullscreenMode
|
||||
* \sa SDL_SetWindowFullscreen
|
||||
*/
|
||||
extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetWindowFullscreenMode(SDL_Window *window);
|
||||
extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetWindowFullscreenMode(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the raw ICC profile data for the screen the window is currently on.
|
||||
|
@ -765,7 +765,7 @@ extern DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetWindowFullscreenMode(SDL_W
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size);
|
||||
extern SDL_DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size);
|
||||
|
||||
/**
|
||||
* Get the pixel format associated with the window.
|
||||
|
@ -777,7 +777,7 @@ extern DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window);
|
||||
extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Create a window with the specified dimensions and flags.
|
||||
|
@ -836,7 +836,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window);
|
|||
* \sa SDL_CreateWindowWithProperties
|
||||
* \sa SDL_DestroyWindow
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int w, int h, SDL_WindowFlags flags);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int w, int h, SDL_WindowFlags flags);
|
||||
|
||||
/**
|
||||
* Create a child popup window of the specified parent window.
|
||||
|
@ -891,7 +891,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int w, i
|
|||
* \sa SDL_DestroyWindow
|
||||
* \sa SDL_GetWindowParent
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y, int w, int h, SDL_WindowFlags flags);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y, int w, int h, SDL_WindowFlags flags);
|
||||
|
||||
/**
|
||||
* Create a window with the specified properties.
|
||||
|
@ -958,18 +958,6 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, in
|
|||
*
|
||||
* These are additional supported properties on Wayland:
|
||||
*
|
||||
* - `SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY_BOOLEAN` - true if the
|
||||
* window should use forced scaling designed to produce 1:1 pixel mapping if
|
||||
* not flagged as being DPI-aware. This is intended to allow legacy
|
||||
* applications to be displayed without desktop scaling being applied, and
|
||||
* has issues with certain display configurations, as this forces the window
|
||||
* to behave in a way that Wayland desktops were not designed to
|
||||
* accommodate. Potential issues include, but are not limited to: rounding
|
||||
* errors can result when odd window sizes/scales are used, the window may
|
||||
* be unusably small, the window may jump in visible size at times, the
|
||||
* window may appear to be larger than the desktop space, and possible loss
|
||||
* of cursor precision can occur. New applications should be designed with
|
||||
* proper DPI awareness and handling instead of enabling this.
|
||||
* - `SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN` - true if
|
||||
* the application wants to use the Wayland surface for a custom role and
|
||||
* does not want it attached to an XDG toplevel window. See
|
||||
|
@ -1009,7 +997,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, in
|
|||
* \sa SDL_CreateWindow
|
||||
* \sa SDL_DestroyWindow
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props);
|
||||
|
||||
#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top"
|
||||
#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless"
|
||||
|
@ -1038,7 +1026,6 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowWithProperties(SDL_Propertie
|
|||
#define SDL_PROP_WINDOW_CREATE_Y_NUMBER "y"
|
||||
#define SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window"
|
||||
#define SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view"
|
||||
#define SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY_BOOLEAN "wayland.scale_to_display"
|
||||
#define SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom"
|
||||
#define SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window"
|
||||
#define SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface"
|
||||
|
@ -1060,7 +1047,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowWithProperties(SDL_Propertie
|
|||
*
|
||||
* \sa SDL_GetWindowFromID
|
||||
*/
|
||||
extern DECLSPEC SDL_WindowID SDLCALL SDL_GetWindowID(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_WindowID SDLCALL SDL_GetWindowID(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get a window from a stored ID.
|
||||
|
@ -1076,7 +1063,7 @@ extern DECLSPEC SDL_WindowID SDLCALL SDL_GetWindowID(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_GetWindowID
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(SDL_WindowID id);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(SDL_WindowID id);
|
||||
|
||||
/**
|
||||
* Get parent of a window.
|
||||
|
@ -1089,7 +1076,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(SDL_WindowID id);
|
|||
*
|
||||
* \sa SDL_CreatePopupWindow
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a window.
|
||||
|
@ -1191,7 +1178,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
|||
* \sa SDL_GetProperty
|
||||
* \sa SDL_GetNumberProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *window);
|
||||
|
||||
#define SDL_PROP_WINDOW_SHAPE_POINTER "SDL.window.shape"
|
||||
#define SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER "SDL.window.android.window"
|
||||
|
@ -1238,7 +1225,7 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *win
|
|||
* \sa SDL_SetWindowMouseGrab
|
||||
* \sa SDL_ShowWindow
|
||||
*/
|
||||
extern DECLSPEC SDL_WindowFlags SDLCALL SDL_GetWindowFlags(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_WindowFlags SDLCALL SDL_GetWindowFlags(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the title of a window.
|
||||
|
@ -1254,7 +1241,7 @@ extern DECLSPEC SDL_WindowFlags SDLCALL SDL_GetWindowFlags(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_GetWindowTitle
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title);
|
||||
|
||||
/**
|
||||
* Get the title of a window.
|
||||
|
@ -1267,7 +1254,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *t
|
|||
*
|
||||
* \sa SDL_SetWindowTitle
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window *window);
|
||||
extern SDL_DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the icon for a window.
|
||||
|
@ -1279,7 +1266,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window *window);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon);
|
||||
|
||||
/**
|
||||
* Request that the window's position be set.
|
||||
|
@ -1319,7 +1306,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *i
|
|||
* \sa SDL_GetWindowPosition
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y);
|
||||
|
||||
/**
|
||||
* Get the position of a window.
|
||||
|
@ -1340,7 +1327,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int
|
|||
*
|
||||
* \sa SDL_SetWindowPosition
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y);
|
||||
|
||||
/**
|
||||
* Request that the size of a window's client area be set.
|
||||
|
@ -1379,7 +1366,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, in
|
|||
* \sa SDL_SetWindowFullscreenMode
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
|
||||
|
||||
/**
|
||||
* Get the size of a window's client area.
|
||||
|
@ -1403,7 +1390,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
|
|||
* \sa SDL_GetWindowSizeInPixels
|
||||
* \sa SDL_SetWindowSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Get the size of a window's borders (decorations) around the client area.
|
||||
|
@ -1437,7 +1424,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h
|
|||
*
|
||||
* \sa SDL_GetWindowSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right);
|
||||
|
||||
/**
|
||||
* Get the size of a window's client area, in pixels.
|
||||
|
@ -1454,7 +1441,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *to
|
|||
* \sa SDL_CreateWindow
|
||||
* \sa SDL_GetWindowSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Set the minimum size of a window's client area.
|
||||
|
@ -1470,7 +1457,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w
|
|||
* \sa SDL_GetWindowMinimumSize
|
||||
* \sa SDL_SetWindowMaximumSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h);
|
||||
|
||||
/**
|
||||
* Get the minimum size of a window's client area.
|
||||
|
@ -1488,7 +1475,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min
|
|||
* \sa SDL_GetWindowMaximumSize
|
||||
* \sa SDL_SetWindowMinimumSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Set the maximum size of a window's client area.
|
||||
|
@ -1504,7 +1491,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w,
|
|||
* \sa SDL_GetWindowMaximumSize
|
||||
* \sa SDL_SetWindowMinimumSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h);
|
||||
|
||||
/**
|
||||
* Get the maximum size of a window's client area.
|
||||
|
@ -1522,7 +1509,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max
|
|||
* \sa SDL_GetWindowMinimumSize
|
||||
* \sa SDL_SetWindowMaximumSize
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Set the border state of a window.
|
||||
|
@ -1542,7 +1529,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w,
|
|||
*
|
||||
* \sa SDL_GetWindowFlags
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered);
|
||||
|
||||
/**
|
||||
* Set the user-resizable state of a window.
|
||||
|
@ -1562,7 +1549,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool b
|
|||
*
|
||||
* \sa SDL_GetWindowFlags
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable);
|
||||
|
||||
/**
|
||||
* Set the window to always be above the others.
|
||||
|
@ -1580,7 +1567,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool
|
|||
*
|
||||
* \sa SDL_GetWindowFlags
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top);
|
||||
|
||||
/**
|
||||
* Show a window.
|
||||
|
@ -1594,7 +1581,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_boo
|
|||
* \sa SDL_HideWindow
|
||||
* \sa SDL_RaiseWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Hide a window.
|
||||
|
@ -1607,7 +1594,7 @@ extern DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_ShowWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Raise a window above other windows and set the input focus.
|
||||
|
@ -1618,7 +1605,7 @@ extern DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Request that the window be made as large as possible.
|
||||
|
@ -1650,7 +1637,7 @@ extern DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
|
|||
* \sa SDL_RestoreWindow
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Request that the window be minimized to an iconic representation.
|
||||
|
@ -1674,7 +1661,7 @@ extern DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
|
|||
* \sa SDL_RestoreWindow
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Request that the size and position of a minimized or maximized window be
|
||||
|
@ -1699,7 +1686,7 @@ extern DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
|
|||
* \sa SDL_MinimizeWindow
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Request that the window's fullscreen state be changed.
|
||||
|
@ -1728,7 +1715,7 @@ extern DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
|
|||
* \sa SDL_SetWindowFullscreenMode
|
||||
* \sa SDL_SyncWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen);
|
||||
|
||||
/**
|
||||
* Block until any pending window state is finalized.
|
||||
|
@ -1756,8 +1743,9 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool
|
|||
* \sa SDL_MinimizeWindow
|
||||
* \sa SDL_MaximizeWindow
|
||||
* \sa SDL_RestoreWindow
|
||||
* \sa SDL_HINT_VIDEO_SYNC_WINDOW_OPERATIONS
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SyncWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SyncWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Return whether the window has a surface associated with it.
|
||||
|
@ -1770,7 +1758,7 @@ extern DECLSPEC int SDLCALL SDL_SyncWindow(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_GetWindowSurface
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WindowHasSurface(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowHasSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the SDL surface associated with the window.
|
||||
|
@ -1797,7 +1785,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_WindowHasSurface(SDL_Window *window);
|
|||
* \sa SDL_UpdateWindowSurface
|
||||
* \sa SDL_UpdateWindowSurfaceRects
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_GetWindowSurface(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_GetWindowSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Copy the window surface to the screen.
|
||||
|
@ -1816,7 +1804,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_GetWindowSurface(SDL_Window *window);
|
|||
* \sa SDL_GetWindowSurface
|
||||
* \sa SDL_UpdateWindowSurfaceRects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Copy areas of the window surface to the screen.
|
||||
|
@ -1843,7 +1831,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window);
|
|||
* \sa SDL_GetWindowSurface
|
||||
* \sa SDL_UpdateWindowSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects);
|
||||
|
||||
/**
|
||||
* Destroy the surface associated with the window.
|
||||
|
@ -1857,7 +1845,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, con
|
|||
* \sa SDL_GetWindowSurface
|
||||
* \sa SDL_WindowHasSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set a window's keyboard grab mode.
|
||||
|
@ -1888,7 +1876,7 @@ extern DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
|
|||
* \sa SDL_GetWindowKeyboardGrab
|
||||
* \sa SDL_SetWindowMouseGrab
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
|
||||
/**
|
||||
* Set a window's mouse grab mode.
|
||||
|
@ -1905,7 +1893,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bo
|
|||
* \sa SDL_GetWindowMouseGrab
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
|
||||
/**
|
||||
* Get a window's keyboard grab mode.
|
||||
|
@ -1917,7 +1905,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool
|
|||
*
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get a window's mouse grab mode.
|
||||
|
@ -1929,7 +1917,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the window that currently has an input grab enabled.
|
||||
|
@ -1941,7 +1929,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window);
|
|||
* \sa SDL_SetWindowMouseGrab
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_GetGrabbedWindow(void);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetGrabbedWindow(void);
|
||||
|
||||
/**
|
||||
* Confines the cursor to the specified area of a window.
|
||||
|
@ -1960,7 +1948,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetGrabbedWindow(void);
|
|||
* \sa SDL_GetWindowMouseRect
|
||||
* \sa SDL_SetWindowMouseGrab
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the mouse confinement rectangle of a window.
|
||||
|
@ -1973,7 +1961,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const SDL
|
|||
*
|
||||
* \sa SDL_SetWindowMouseRect
|
||||
*/
|
||||
extern DECLSPEC const SDL_Rect *SDLCALL SDL_GetWindowMouseRect(SDL_Window *window);
|
||||
extern SDL_DECLSPEC const SDL_Rect *SDLCALL SDL_GetWindowMouseRect(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the opacity for a window.
|
||||
|
@ -1992,7 +1980,7 @@ extern DECLSPEC const SDL_Rect *SDLCALL SDL_GetWindowMouseRect(SDL_Window *windo
|
|||
*
|
||||
* \sa SDL_GetWindowOpacity
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity);
|
||||
|
||||
/**
|
||||
* Get the opacity of a window.
|
||||
|
@ -2013,7 +2001,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opaci
|
|||
*
|
||||
* \sa SDL_SetWindowOpacity
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity);
|
||||
|
||||
/**
|
||||
* Set the window as a modal to a parent window.
|
||||
|
@ -2032,7 +2020,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window *window, float *out_
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window);
|
||||
|
||||
/**
|
||||
* Explicitly set input focus to the window.
|
||||
|
@ -2049,7 +2037,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_
|
|||
*
|
||||
* \sa SDL_RaiseWindow
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set whether the window may have input focus.
|
||||
|
@ -2062,7 +2050,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window *window);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2086,7 +2074,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFocusable(SDL_Window *window, SDL_bool
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_ShowWindowSystemMenu(SDL_Window *window, int x, int y);
|
||||
|
||||
/**
|
||||
* Possible return values from the SDL_HitTest callback.
|
||||
|
@ -2163,7 +2151,7 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data);
|
||||
|
||||
/**
|
||||
* Set the shape of a transparent window.
|
||||
|
@ -2187,7 +2175,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape);
|
||||
|
||||
/**
|
||||
* Request a window to demand attention from the user.
|
||||
|
@ -2199,7 +2187,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window, SDL_Surface *
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation);
|
||||
|
||||
/**
|
||||
* Destroy a window.
|
||||
|
@ -2218,7 +2206,7 @@ extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperati
|
|||
* \sa SDL_CreateWindow
|
||||
* \sa SDL_CreateWindowWithProperties
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2236,7 +2224,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window);
|
|||
* \sa SDL_DisableScreenSaver
|
||||
* \sa SDL_EnableScreenSaver
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void);
|
||||
|
||||
/**
|
||||
* Allow the screen to be blanked by a screen saver.
|
||||
|
@ -2249,7 +2237,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_ScreenSaverEnabled(void);
|
|||
* \sa SDL_DisableScreenSaver
|
||||
* \sa SDL_ScreenSaverEnabled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_EnableScreenSaver(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_EnableScreenSaver(void);
|
||||
|
||||
/**
|
||||
* Prevent the screen from being blanked by a screen saver.
|
||||
|
@ -2268,7 +2256,7 @@ extern DECLSPEC int SDLCALL SDL_EnableScreenSaver(void);
|
|||
* \sa SDL_EnableScreenSaver
|
||||
* \sa SDL_ScreenSaverEnabled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DisableScreenSaver(void);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_DisableScreenSaver(void);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -2296,7 +2284,7 @@ extern DECLSPEC int SDLCALL SDL_DisableScreenSaver(void);
|
|||
* \sa SDL_GL_GetProcAddress
|
||||
* \sa SDL_GL_UnloadLibrary
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
||||
|
||||
/**
|
||||
* Get an OpenGL function by name.
|
||||
|
@ -2349,7 +2337,7 @@ extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
|
|||
* \sa SDL_GL_LoadLibrary
|
||||
* \sa SDL_GL_UnloadLibrary
|
||||
*/
|
||||
extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_GL_GetProcAddress(const char *proc);
|
||||
extern SDL_DECLSPEC SDL_FunctionPointer SDLCALL SDL_GL_GetProcAddress(const char *proc);
|
||||
|
||||
/**
|
||||
* Get an EGL library function by name.
|
||||
|
@ -2366,7 +2354,7 @@ extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_GL_GetProcAddress(const char *pr
|
|||
*
|
||||
* \sa SDL_GL_GetCurrentEGLDisplay
|
||||
*/
|
||||
extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_EGL_GetProcAddress(const char *proc);
|
||||
extern SDL_DECLSPEC SDL_FunctionPointer SDLCALL SDL_EGL_GetProcAddress(const char *proc);
|
||||
|
||||
/**
|
||||
* Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
|
||||
|
@ -2375,7 +2363,7 @@ extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_EGL_GetProcAddress(const char *p
|
|||
*
|
||||
* \sa SDL_GL_LoadLibrary
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
|
||||
|
||||
/**
|
||||
* Check if an OpenGL extension is supported for the current context.
|
||||
|
@ -2396,7 +2384,7 @@ extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char *extension);
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char *extension);
|
||||
|
||||
/**
|
||||
* Reset all previously set OpenGL context attributes to their default values.
|
||||
|
@ -2406,7 +2394,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char *extension
|
|||
* \sa SDL_GL_GetAttribute
|
||||
* \sa SDL_GL_SetAttribute
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
|
||||
|
||||
/**
|
||||
* Set an OpenGL window attribute before window creation.
|
||||
|
@ -2426,7 +2414,7 @@ extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
|
|||
* \sa SDL_GL_GetAttribute
|
||||
* \sa SDL_GL_ResetAttributes
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
|
||||
|
||||
/**
|
||||
* Get the actual value for an attribute from the current context.
|
||||
|
@ -2441,7 +2429,7 @@ extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
|
|||
* \sa SDL_GL_ResetAttributes
|
||||
* \sa SDL_GL_SetAttribute
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
|
||||
|
||||
/**
|
||||
* Create an OpenGL context for an OpenGL window, and make it current.
|
||||
|
@ -2463,7 +2451,7 @@ extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
|
|||
* \sa SDL_GL_DeleteContext
|
||||
* \sa SDL_GL_MakeCurrent
|
||||
*/
|
||||
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set up an OpenGL context for rendering into an OpenGL window.
|
||||
|
@ -2479,7 +2467,7 @@ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_GL_CreateContext
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context);
|
||||
|
||||
/**
|
||||
* Get the currently active OpenGL window.
|
||||
|
@ -2489,7 +2477,7 @@ extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_GL_GetCurrentWindow(void);
|
||||
extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GL_GetCurrentWindow(void);
|
||||
|
||||
/**
|
||||
* Get the currently active OpenGL context.
|
||||
|
@ -2501,7 +2489,7 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GL_GetCurrentWindow(void);
|
|||
*
|
||||
* \sa SDL_GL_MakeCurrent
|
||||
*/
|
||||
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
|
||||
extern SDL_DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
|
||||
|
||||
/**
|
||||
* Get the currently active EGL display.
|
||||
|
@ -2511,7 +2499,7 @@ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_EGLDisplay SDLCALL SDL_EGL_GetCurrentEGLDisplay(void);
|
||||
extern SDL_DECLSPEC SDL_EGLDisplay SDLCALL SDL_EGL_GetCurrentEGLDisplay(void);
|
||||
|
||||
/**
|
||||
* Get the currently active EGL config.
|
||||
|
@ -2521,7 +2509,7 @@ extern DECLSPEC SDL_EGLDisplay SDLCALL SDL_EGL_GetCurrentEGLDisplay(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_EGLConfig SDLCALL SDL_EGL_GetCurrentEGLConfig(void);
|
||||
extern SDL_DECLSPEC SDL_EGLConfig SDLCALL SDL_EGL_GetCurrentEGLConfig(void);
|
||||
|
||||
/**
|
||||
* Get the EGL surface associated with the window.
|
||||
|
@ -2532,7 +2520,7 @@ extern DECLSPEC SDL_EGLConfig SDLCALL SDL_EGL_GetCurrentEGLConfig(void);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_EGLSurface SDLCALL SDL_EGL_GetWindowEGLSurface(SDL_Window *window);
|
||||
extern SDL_DECLSPEC SDL_EGLSurface SDLCALL SDL_EGL_GetWindowEGLSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Sets the callbacks for defining custom EGLAttrib arrays for EGL
|
||||
|
@ -2556,7 +2544,7 @@ extern DECLSPEC SDL_EGLSurface SDLCALL SDL_EGL_GetWindowEGLSurface(SDL_Window *w
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_EGL_SetEGLAttributeCallbacks(SDL_EGLAttribArrayCallback platformAttribCallback,
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_EGL_SetEGLAttributeCallbacks(SDL_EGLAttribArrayCallback platformAttribCallback,
|
||||
SDL_EGLIntArrayCallback surfaceAttribCallback,
|
||||
SDL_EGLIntArrayCallback contextAttribCallback);
|
||||
|
||||
|
@ -2587,7 +2575,7 @@ extern DECLSPEC void SDLCALL SDL_EGL_SetEGLAttributeCallbacks(SDL_EGLAttribArray
|
|||
*
|
||||
* \sa SDL_GL_GetSwapInterval
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
|
||||
|
||||
/**
|
||||
* Get the swap interval for the current OpenGL context.
|
||||
|
@ -2606,7 +2594,7 @@ extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
|
|||
*
|
||||
* \sa SDL_GL_SetSwapInterval
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(int *interval);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(int *interval);
|
||||
|
||||
/**
|
||||
* Update a window with OpenGL rendering.
|
||||
|
@ -2624,7 +2612,7 @@ extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(int *interval);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_SwapWindow(SDL_Window *window);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_SwapWindow(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Delete an OpenGL context.
|
||||
|
@ -2637,7 +2625,7 @@ extern DECLSPEC int SDLCALL SDL_GL_SwapWindow(SDL_Window *window);
|
|||
*
|
||||
* \sa SDL_GL_CreateContext
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
|
||||
|
||||
/* @} *//* OpenGL support functions */
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_vulkan.h
|
||||
* # CategoryVulkan
|
||||
*
|
||||
* Header file for functions to creating Vulkan surfaces on SDL windows.
|
||||
* Functions for creating Vulkan surfaces on SDL windows.
|
||||
*/
|
||||
|
||||
#ifndef SDL_vulkan_h_
|
||||
|
@ -102,7 +102,7 @@ struct VkAllocationCallbacks;
|
|||
* \sa SDL_Vulkan_GetVkGetInstanceProcAddr
|
||||
* \sa SDL_Vulkan_UnloadLibrary
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
|
||||
|
||||
/**
|
||||
* Get the address of the `vkGetInstanceProcAddr` function.
|
||||
|
@ -122,7 +122,7 @@ extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
|
|||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
|
||||
extern SDL_DECLSPEC SDL_FunctionPointer SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
|
||||
|
||||
/**
|
||||
* Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary().
|
||||
|
@ -131,7 +131,7 @@ extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(
|
|||
*
|
||||
* \sa SDL_Vulkan_LoadLibrary
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
||||
|
||||
/**
|
||||
* Get the Vulkan instance extensions needed for vkCreateInstance.
|
||||
|
@ -154,7 +154,7 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
|||
*
|
||||
* \sa SDL_Vulkan_CreateSurface
|
||||
*/
|
||||
extern DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint32 *count);
|
||||
extern SDL_DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint32 *count);
|
||||
|
||||
/**
|
||||
* Create a Vulkan rendering surface for a window.
|
||||
|
@ -177,12 +177,40 @@ extern DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint
|
|||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Vulkan_GetInstanceExtensions
|
||||
* \sa SDL_Vulkan_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
|
||||
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
|
||||
VkInstance instance,
|
||||
const struct VkAllocationCallbacks *allocator,
|
||||
VkSurfaceKHR* surface);
|
||||
|
||||
/**
|
||||
* Destroy the Vulkan rendering surface of a window.
|
||||
*
|
||||
* This should be called before SDL_DestroyWindow, if SDL_Vulkan_CreateSurface
|
||||
* was called after SDL_CreateWindow.
|
||||
*
|
||||
* The `instance` must have been created with extensions returned by
|
||||
* SDL_Vulkan_GetInstanceExtensions() enabled and `surface` must have been
|
||||
* created successfully by an SDL_Vulkan_CreateSurface() call.
|
||||
*
|
||||
* If `allocator` is NULL, Vulkan will use the system default allocator. This
|
||||
* argument is passed directly to Vulkan and isn't used by SDL itself.
|
||||
*
|
||||
* \param instance The Vulkan instance handle
|
||||
* \param surface VkSurfaceKHR handle to destroy
|
||||
* \param allocator A VkAllocationCallbacks struct, which lets the app set the
|
||||
* allocator that destroys the surface. Can be NULL.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Vulkan_GetInstanceExtensions
|
||||
* \sa SDL_Vulkan_CreateSurface
|
||||
*/
|
||||
extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_DestroySurface(VkInstance instance,
|
||||
VkSurfaceKHR surface,
|
||||
const struct VkAllocationCallbacks *allocator);
|
||||
|
||||
/* @} *//* Vulkan support functions */
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
|
|
@ -440,6 +440,11 @@
|
|||
/* Enable Metal support */
|
||||
#cmakedefine SDL_VIDEO_METAL @SDL_VIDEO_METAL@
|
||||
|
||||
/* Enable GPU support */
|
||||
#cmakedefine01 SDL_GPU_D3D11
|
||||
#cmakedefine01 SDL_GPU_VULKAN
|
||||
#cmakedefine01 SDL_GPU_METAL
|
||||
|
||||
/* Enable system power support */
|
||||
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
|
||||
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
|
||||
|
|
|
@ -184,6 +184,8 @@
|
|||
#define SDL_VIDEO_VULKAN 1
|
||||
#endif
|
||||
|
||||
#define SDL_GPU_VULKAN SDL_VIDEO_VULKAN
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_ANDROID 1
|
||||
|
||||
|
|
|
@ -254,6 +254,8 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#define SDL_GPU_VULKAN SDL_VIDEO_VULKAN
|
||||
|
||||
#ifndef SDL_VIDEO_METAL
|
||||
#if SDL_PLATFORM_SUPPORTS_METAL
|
||||
#define SDL_VIDEO_METAL 1
|
||||
|
@ -262,6 +264,8 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#define SDL_GPU_METAL SDL_VIDEO_METAL
|
||||
|
||||
/* Enable system power support */
|
||||
#define SDL_POWER_MACOSX 1
|
||||
|
||||
|
|
|
@ -301,6 +301,9 @@ typedef unsigned int uintptr_t;
|
|||
/* Enable Vulkan support */
|
||||
#define SDL_VIDEO_VULKAN 1
|
||||
|
||||
#define SDL_GPU_D3D11 SDL_VIDEO_RENDER_D3D11
|
||||
#define SDL_GPU_VULKAN SDL_VIDEO_VULKAN
|
||||
|
||||
#ifndef SDL_VIDEO_RENDER_VULKAN
|
||||
#define SDL_VIDEO_RENDER_VULKAN 1
|
||||
#endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue