Squashed 'external/sdl/SDL/' changes from 0d7df16812c..fb5307c1b3f
fb5307c1b3f Vulkan Renderer - fix synchronization validation issues with testrendertarget and testcopyex. When a texture is destroyed, VULKAN_IssueBatch is called to make sure the texture isn't referenced in any outstanding command work. This path did not wait on the semaphore from vkAcquireNextImageKHR, which would create a hazard.
0d007bbb014 psp: Fixed building with pspdev when not using CMake.
ad92c9e3009 README-main-functions.md: Added notes about the new `appstate` parameter.
7a9f99cff34 Corrected migration documentation for SDL_GetDisplayDPI()
d00ccc1546c audio: Fix audio stream incorrectly not unlocking during unbind.
38e3c6a4aa3 main: Add an optional `appstate` param to main callback entry points.
a9dbdb19475 Removed SDL_RenderSetIntegerScale() renaming note
cde2dcd0d49 Note that SDL_EVENT_SYSWM has been removed
05b3605a41d Sync SDL3 wiki -> header
5abcfad3524 video: Document that renderer lifetimes are tied to their associated windows
02c63667c7b Only clear the raw input queue status if we don't call GetRawInputBuffer()
d6fc629b5b1 Fixed Windows rawinput crash
a7df28201be Revert "testautomation: fix renderer leak in video tests"
8f14fa1113b video: Destroy the associated renderer when a window is destroyed
f0cd3ed3303 x11: don't send raw mouse motion when the application doesn't have focus
c47f9b9b547 x11: fixed mouse and keyboard input when XInput2 isn't available
fed5f3a81b2 We no longer automatically set up a logical presentation mode
823ab13b9cf SDL_CreateTexture() takes a SDL_PixelFormatEnum format parameter
35785d13544 SDL_CreateWindowTexture() shouldn't use 10-bit or float textures
696ecca499f Fixed SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB() and SDL_GetRGBA() when used with 10-bit pixel formats
3eb8f35f3bd windows: handle the Pause key sequence for raw keyboard input
4562b41a4d1 VisualC-GDK: Add missing dialog sources, fix Xbox builds
693c75e36eb SDL_x11events.c: fix build if Xinput2 is not available after 3dfc3b4c8
0556362c381 SDL_windowsevents.c: comment out unused local mouse var after 70b5cd44
70b5cd44ec3 windows: explicitly check whether raw_mouse_enabled is true before handling Windows mouse messages
3dfc3b4c8da x11: added hotplug support for XInput2 devices
f1f24b173c4 Added support for multiple distinct keyboards
78c7834f90a Added SDL_HINT_WINDOWS_RAW_KEYBOARD to control whether raw keyboard is enabled on Windows
9095cb64c41 linux/SDL_system_theme.c: fix an include path
a65982e15dc testevdev: include SDL_internal.h first, and fixup SDL_main.h
ffc3f71aa24 wayland: Use the floating width/height for initial window creation
b9a88bbecba Removed SDL_TextInputShown()
6443c75edaa Removed SDL_TEXTINPUTEVENT_TEXT_SIZE
fa236f169ba Only do work to process text events if text input is active
658f3cdcf1a x11: use XInput2 for lower level access to keyboard events
012fc1e32b4 windows: enable raw keyboard input when raw mouse input is enabled
35d335e61f6 Fixed warning C4267: 'function': conversion from 'size_t' to 'DWORD', possible loss of data
43b8e9f6814 Fixed spacing
5e8486bb29a Don't fail joystick initialization if udev isn't available
5a1c48be5c2 remove non-existent vulkan.hpp and vulkan_mir.h from Xcode project
58f2e102a93 visualc: filters also contained 2 wrong include headers
c7d32ff64bd visualc: rename/remove 2 include paths
977285ef6a4 Send joystick added events on portable handheld platforms
b391e6477e2 The joystick instance ID is already set in the open call
07c49d1a678 Fixed text input being active after SDL_StopTextInput() (thanks @AntTheAlchemist!)
53ade194306 udev: Fix O(n^2) device walking issue (closes #9092)
2b4c75690c2 Add Yawman Arrow flightstick controller
f14fb979c10 Remove legacy SDL2 input grab API
cf3cf0e1066 dmg: fix SDL_version.h issue in sdl3-config-version.cmake
fc053fb4996 Fix OpenFolder dialog behavior on Windows
13933222eef Fixed string comparison (thanks @meyraud705!)
8f33f5cc331 Sync SDL3 wiki -> header
beb52ed54a9 pen: remove stray '#include <stdio.h>'
96fbd10de0c Added a script to trigger the release workflow
36e73bdda44 Updated to version 3.1.0 for the preview release
a20eec14155 Tweaking documentation for the SDL 3.0 preview release
9e460ce6a6a wayland: Pass the keyboard ID through to repeat events
0df0462d0a9 Removed all tabs in testautomation_pen.c
615c7efd98e Fix #9279: Memory leak in pen name handling
675c9f01ff3 Renamed releaser.py to build-release.py
c83d0d87c29 Revert "Added virtual keyboard support for Xbox (thanks @ts-13512)"
f030533580f SDL_blit: remove SDL_BLIT_CPU_FEATURES override
1aa9ef72134 cpuinfo: reset cpu features on SDL_Quit
64465653b44 audio: always build fallback scalar converters
89b135e570e cmake: add automation and platform test without simd
1d0e5286aa2 Limit CPU features through a hint
b5d4206b303 Added virtual keyboard support for Xbox (thanks @ts-13512)
675216e81b2 Sync SDL3 wiki -> header
1855ce68af2 Fix bug #9331 - SDL3 Android crash getVibrator() == null
208cd434b55 Show the names of mice and keyboards when they connect
7852a6c307f Added device name for evdev mice and keyboards
87714ce5b9e wayland: Set the keyboard and mouse names to match XWayland
72fc6f86e5d Text input is no longer automatically enabled when initializing video.
6604d423fde Added a test program for multiple mice
361b7190df2 Track unique button states between different mice
35756593d67 Use the correct device ID (global or default or specific) based on context
9eb87ca3255 Note that many things are considered mice and keyboards that you might not expect
c0f45655528 Added SDL_GetKeyboardName() and SDL_GetMouseName()
20a860c8765 Use the specific pointer device ID for X11 button and motion events
476245564cf Use the real device IDs for the X11 master keyboard and pointer
d1eb4adb161 Be explicit about the event mouse and keyboard ID
1c544553533 wayland: Send keyboard and mouse added/removed events
2fe1a6a2796 Initial support for hotplugging mice and keyboards
c33e4c998db Clear the subsystem ref count when shutting down subsystems in the main quit
171ff041d04 Removed invalid ascii from headers
e19b6c0b958 Add releaser script + workflow
c81d11fae4a mingw: add pkg-support files (INSTALL.txt and Makefile)
4defea47e17 dmg: fix sdl3-config.cmake
2ed01434253 visualc: fix sdl3-config.cmake
75a71bde4b4 cmake: build tests against installed SDL prefix
7f888f98f7d gles2: only build tests when building SDL3 or when the headers are available
297f8e41af3 wayland: Factor out the general SHM buffer allocation/free functions from the cursor code
3d96c2426f3 PSP: improve performance counter res to us granularity (thanks @rofl0r!)
c493b40cc31 testffmpeg_vulkan: fix -Wincompatible-pointer-types warning
67e425bcf81 Add support for MadCatz Saitek Side Panel Control Deck
05b57f6c2cb Simplified SDL_SYS_RemovePath()
2521ba47fe2 jack: set error message when failing to open jack client
dd4636e3fde SDL_sysmutex.c: fix void return compile error
917d683811d Moved SDL_JoyBallEvent together with the other joystick events
888cc29df66 add missing `reserved` field to struct SDL_JoyBallEvent,
70b0d33106e Poll for the initial controller state when using DirectInput
4a7e3beeb94 filesystem: Use high-res file times on more platforms
18feaa52dd9 Fixed comment at the top of testtime.c
e0ef4dac854 Fixed int to float conversion warnings
3316587113d Fixed warning C4389: '==': signed/unsigned mismatch
da027ec3eed Fixed signed/unsigned comparison warning
390fff4ae0f N3DS: Fix locale name and early return.
8f529d9d16e N3DS: Implement SDL_GetSystemTimeLocalePreferences
ed5d2bdda5c Fixed adding duplicate fsops files to CMakeLists.txt
478b965e6cc Fixed warning C4702: unreachable code
b1215272adc Fixed warning C4244: '=': conversion from '__int64' to 'int', possible loss of data
2265d22f759 Updated Xcode project for time APIs
c582a89f78b Fixed build warning
b90fed094f0 Standardise header includes
2e45568338d PSVita: fix SDL_GetSystemTimeLocalePreferences
ba0417db407 Sync SDL3 wiki -> header
a6fbf0488c6 Add time and realtime clock functions
b6c9a727403 Add SDL_storage files to Xcode project
b2682da035f Sync SDL3 wiki -> header
24ec1c09b90 Renamed SDL_PROP_IOSTREAM_STDIO_HANDLE_POINTER to SDL_PROP_IOSTREAM_STDIO_FILE_POINTER
d3a785e521d Improve event processing latency when gamepad/sensor is open
1eb7b79986a video: Prepend global video property with "SDL"
784311c20ee Fixed duplicate SDL_Version change
009318c5a9d Fix warnings when building with -DSDL_LIBC=OFF on Linux
f59dbf6a120 cmake: add -Wimplicit-fallthrough warning
086a7a46873 Fixed signed/unsigned comparison warning
491f18eea39 Fixed uninitialized signal_id
90e2551c4ff Sort the SDL API symbols
0d0aaa2d752 Sync SDL3 wiki -> header
92d01ef12a9 You can pass NULL to SDL_GetPathInfo() and SDL_GetStoragePathInfo() to test for the existence of a file.
ebb6582534d wayland: Handle the toplevel export property as a string
9072b994f7a src/filesystem/unix/SDL_sysfilesystem.c add <stdio.h> inclusion
6af979975f2 Add missing break
fc26d5d3285 Sync SDL3 wiki -> header
a1a01567563 Renamed SDL_SizeIO() SDL_GetIOSize()
df0f5deddfd Added SDL_IOFromDynamicMem()
12245e4c756 PSP/Joystick: fix formatting
7169db1e62a PSP: don't block on joystick event query
747300b3562 SDL file times are 64-bit integers representing nanoseconds since the Unix epoch
9153287fa03 Added storage filesystem operations to the exported function list
e7b9f75e624 Sync SDL3 wiki -> header
d65ae710a13 Renamed SDL_LogGetOutputFunction() and SDL_LogSetOutputFunction() to match SDL 3.0 naming convention
d8a54cd4f81 Updated "see also" references to be more consistent
d972244d3ad Added a mapping for the Defender Joystick Cobra R4 (thanks @kotenok2000!)
4697153d1e2 Use the CRC as part of the unique key for mappings
9d83c0a65d9 filesystem: Rename some internal symbols to remove "FSops" terminology.
4ecea42fb03 testautomation_math.c: use isinf(V) instead of fpclassify(V) == FP_INFINITE
cb39740cfdc wayland: Remove additional instance of setting the viewport source rect
a206e1e3c04 Sync SDL3 wiki -> header
2f78e5f321b All storage interface functions are optional
f460f42e707 Added filesystem operations to SDL_Storage
7a088527c19 Removed the reserved parameter from SDL_EnumerateDirectoryCallback
ec3ba387d1f Added SDL_OpenFileStorage() for local file storage
ee0a23c7ab8 The storage ready callback is optional
db0c1d7aeb5 Added portable file and directory operations (thanks @icculus!)
fe5c34d4bdc Renamed storage functions to match SDL 3.0 naming convention
1bab87399fd wayland: Always use the entire buffer for the viewport source
e5812a9fd2c testpen: don't include math.h
2f13f66c71d testautomation: fix renderer leak in video tests
9ccde0def40 Sync SDL3 wiki -> header
744227e6abe Add SDL_storage
4fc749443fd Added dialog files to the Xcode build
25c64a954d6 Removed UIKit_SetWindowMouseGrab(), mouse grab isn't supported on iOS
41e187be4f9 Adjust Steam button names to match SDL
572e088b8f5 SDL_IOFromMem/SDL_IOFromConstMem: free userdata on close
ea60c2079bd dialog: Pass the Wayland or X11 parent window handle to the file dialog portal
d523cd069fd dialog: Detect if the file chooser portal is available
19764ffcc81 wayland: Add the xdg-foreign-unstable-v2 protocol
db31367999e testffmpeg: use SDL_free instead of free
f8c2ec54621 testffmpeg: use Uint64 instead of __u64
2b45452dd53 Adding comments to init-flags SDL_INIT_AUDIO and SDL_INIT_SENSOR that they imply SDL_INIT_EVENTS
fa7ec59ecd0 Sync SDL3 wiki -> header
ec6de7017ce Merge pull request #9254 from icculus/sdl3-rwops-hidden-interface
b7cda16613d iostream: Final fixes before merging.
c175eb488cb iostream: Note that the new name has nothing to do with C++'s iostream class.
5a21d87e692 rwops: Changed filenames that reference "rwops" to "iostream".
6776b6108a5 iostream: "free*" params should be "closeio".
5440fd7d12f README-migration.md: Fixed some RWops mistakes.
3a344cf877c rwops: Fixed some SDL2 symbols that got missed.
5f64cc511e4 rwops: Fixed build on Android.
fc7afa9cbf4 rwops: Renamed SDL_RWops to SDL_IOStream, and other related symbols.
fe33b2a81bb rwops: Give implementations access to status value.
447c29e65c4 include: Added missing RWops documentation.
cc58da4c63c rwops: Add SDL_GetRWStatus, make the statuses into an enum.
e35c304022c rwops: Add properties for some of the internal implementation details.
7d4d8ccde09 rwops: Rename everything from SDL_RWxxx to SDL_XxxRW.
655ceb3b315 rwops: Renamed SDL_CreateRW and SDL_DestroyRW to SDL_OpenRW and SDL_CloseRW.
525919b3151 rwops: Reworked RWops for SDL3.
495e432fb97 Sync SDL3 wiki -> header
70c2e15615d Add file dialogs
30e93b40c2a If a mapping specifies a crc, don't match for controllers that don't have that CRC
6c11449cd44 Added a note for the SDL_CommonEvent type
209a87bf248 Added missing default case (thanks @sezero!)
442073f379e Added missing reserved field in SDL_CameraDeviceEvent (thanks @Saalvage!)
9bef331dc8a Note that SDL_UserEvent and SDL_Event type are intentionally Uint32
717f2978493 Add 'wl_list_for_each_safe' to the clang-format macro list
3875ef45524 Removed duplicated line (thanks @sechshelme!)
4686a737a94 wayland: Minor cursor code cleanup
1973edb9b7a WIN_UpdateKeymap: cleanup code a bit
0a86f8eb6eb Move some code blocks inside `SDL_VIDEO_RENDER_SW`, where it belongs (#9259)
c2e9693de55 wayland: Add cursor-shape-v1 protocol support
9bdb992925e wayland: Allocate the cursor shared memory buffer entirely in memory, if possible.
41b7036f372 testffmpeg: added support for EGL OES frame formats
d79f8652510 Removed incorrect mapping for a HORI controller
d78a24a5ced testffmpeg: added verbose logging of ffmpeg messages
7c5f79e7ea8 testffmpeg: removed redundant enumeration of hardware device types
bee8a955714 Fix SDL_LEAN_AND_MEAN build
d4794cc714d Fix crash in SDL_UpdateFullscreenMode calling SetWindowFullscreen with a null display
ab5351f5d65 Fixed leaving the cursor clip set when changing window focus
b322d27f629 Missed SDL_NumJoystickBalls() rename in SDL_migration.cocci
efbbafb3f15 Re-added balls to the SDL joystick API
53e86be22f3 Minor cleanup with the new PS3 driver for windows
65340296910 Add DualShock 3 HIDAPI support on Windows (#9144)
feadbffb67d Destroy properties after applying them to avoid memory leakage
b5eb704fa8d cmake: we only need a C++ compiler for Android, Haiku and UWP
fde420a6453 Revert "Added SDL_FLIP_DIAGONAL"
e3cf2e47949 Turn HIDAPI joystick support off by default on mobile platforms
ed463b41e15 Unified the software renderer creation path
b9ab3269823 Added SDL_FLIP_DIAGONAL
7341d5f3616 cmake: allow hidapi to use libusb on Windows
3bc27d38568 hidapi_libusb: use SDL_wcscmp and SDL_wcslcpy from SDL
0e6fcf947a7 cmake: find libusb through LibUSB cmake module
2a775cad6fc Named typedef-ed structs Gave name to structs that were defined like anonymous struct with name given by typedef. Example 'typedef struct {...} Foo;' -> 'typedef struct Foo {...} Foo;'
37d066b99b5 Clarify what pitch means (thanks @zlago!)
f9d018c8081 Add flag to registerReceiver on Android
4de30a26a2c x11: workaround issues with primary selection and clipboard temporal ignorance
76defc5c822 joystick: Remove redundant CHECK_JOYSTICK_MAGIC in SDL_GetJoystickName
41baf23e447 cmake: fix empty framework prefix on MacOS
b6c5ad00754 Update hardcoded value of pi to use SDL constant SDL_PI_F for improved consistency and readability.
fcb132b8e83 Allow building testffmpeg without Vulkan support
16e0806ced5 Note that the cursor clip has been cleared even if we didn't do it
19b3ddac2f3 Fix TOCTOU race condition
cde793b0f5c Added support for the 6-button SEGA Mega Drive Control Pad for Nintendo Online
d86ff6c6c07 remove stale / wrong information from SDL_RWread() documentation
9e89f093d97 remove stale / wrong information from SDL_RWread() documentation
790cd395f54 Make sure the type in the SDL_Event aligns properly across the union
e9ab2d46ded Revert "Change `SDL_Keycode` type to an enum"
33eaddc5653 Cleaned up various type conversion issues
f53bdc95315 The pixel format in SDL_DisplayMode uses SDL_PixelFormatEnum
57a160c9ab9 Fixed mapping for the Sanwa Supply JY-P76USV controller
5643fd683f2 Added migration notes for enum type changes
3cc4705dd20 cmake: build OBJC sources with warning & error flags, ignoring deprecated declarations
59ab5c08246 Sync SDL3 wiki -> header
c70710cde8a SDL_GetPixelFormatEnumForMasks() returns SDL_PixelFormatEnum
01248a99c8e Add `default: break;` to switches on SDL_Event::type
722f4104bf0 Use enums as types in SDL_*Event structures
641b911d383 Update some internal files to use `SDL_WindowFlags`
ce44eff3d21 Use `SDL_WindowFlags` in public headers
4f58d183732 Typedef `SDL_WindowFlags`
424616e032c Use SDL_PixelFormatEnum as type
38c54b8e0e9 More null checks for SDL window operations
6664a089d82 Add missing null check for displaydata during window creation
610e798406f Fix clicking on the titlebar causing mouse input to freeze until esc is pressed
65a718f8c66 Disable warning C4113 in SDL_windows_gaming_input.c
53896c9e449 cocoa: Make keyboard grab function return an int
f8cb3c742d0 Change `SDL_Keycode` type to an enum
f8844d387c2 Use specific types in SDL_touch.h
26b9178e5c9 Fixed whitespace
c07b39fa066 Fixed build
2d0cd901711 Sync SDL3 wiki -> header
860155680d2 SDL_RegisterEvents() now returns 0 if it couldn't allocate any user events.
4d20b828504 SDL_RWFromFile, stdio: allow named pipes along with regular files.
ee871323850 Make sure fast path RGB <-> YUV conversions are using the same color primaries
4545c77c9ef Updated Vita renderer with colorspace clarification
95fbbc6f074 Fixed accidental use of tabs
e268cdbec67 Use specific types in public headers (#9205)
db245603873 Additional colorspace clarification
b3858ec5f7f BT2020_CL is very different from BT2020_NCL, and not currently supported
4c0601b93fa video: Return a failure code if the video driver fails to grab the mouse or keyboard
ae0caeef8d6 Fixed build
9db68f97f9d Reverted SDL_Vulkan_GetInstanceExtensions() API change
edbcef11ffd Keep track of whether the Android on-screen keyboard was opened by the application
c36f773eb47 Fixed "${folder^}Activity: bad substitution" with bash 3.2 on macOS
0b4a195f4ba Sync SDL3 wiki -> header
cea717e5d31 Removed some uneeded 'unsigned': renderer.num_texture_format and SDL_Vulkan_GetInstanceExtensions() prototype
1e0bac288bc Use the hlsli extension for shader includes
4898505f23f cmake: add winres to the list of potential name rc compilers
d4f4aa745a9 Use C++ style comments in new code
98bec6749f2 hidapi, windows: sync with mainstream: change MAX_STRING_WCHARS to 126.
26e3ca7387e hidapi: minor sync with mainstream (for sake of symmetry, only.)
fb87f8f15c1 testffmpeg: fixed mismatch between frame size and frame texture size
180dd0bb39e testffmpeg: don't free the instance extensions, we hold onto them in the context
2d4105ba8b2 testffmpeg: only enable AV_PIX_FMT_VULKAN if we have a Vulkan renderer
759ade8c90e vulkan: enable samplerYcbcrConversion when creating the device
ffef13e1e17 Sync SDL3 wiki -> header
97f97109d1b testffmpeg: fixed Vulkan validation errors
dbec2150d0e testffmpeg: added support for Vulkan rendering
48471f7dbd9 Added SDL_AddVulkanRenderSemaphores() for external synchronization with SDL rendering
504d8c2fc00 Fixed potential memory leak if vkCreateInstance() fails
1e790b20c9b video: Don't overwrite all the pending flags in the OnWindowHidden handler
4189edaeb7c Uppercase the first letter of the class name to match Java conventions
a4d7ff67510 testffmpeg: Use EGL_EXT_image_dma_buf_import_modifiers extension
ae4484f4e5d video: Save pending window events when a window is hidden by the window manager
9be35d46036 Convert mappings using labeled buttons to positional buttons
ccd309c4332 Added a mapping for the Sanwa Supply JY-P76USV controller
8d8076263e7 Removed the mapping for the G-Shark GS-GP702
1b86a1c6843 SDL_GetGamepadAppleSFSymbolsNameForAxis() returns NULL if the symbol isn't found
5f372426072 Don't clear the clipboard on quit
6e03914375e Fixed signed/unsigned comparison warning
2c850529665 Removed unused headers from SDL_rect.h
e54001b0280 Updating the mouse capture should use the mouse focus window
c1da39a2457 SDL_GetGamepadAppleSFSymbolsNameForButton() returns NULL if the symbol isn't found
74f46142891 Save the native texture parent and return that in SDL_GetRenderTarget()
86d36a2dc2a Add missing include
eb5a2e7e7f8 Fixed building with SDL_LEAN_AND_MEAN
107e06a92a7 Use a valid finger ID when generating touch events from mouse events
c6ec9998692 Set udev class for accelerometer
e524e545f2b Add vulkan to SDL_HINT_RENDER_DRIVER
88dcf74588c testyuv: we no longer need to override the HDR headroom for the BT.2020 test
27389716aca Sync SDL3 wiki -> header
7f9ff6277c7 Don't assume HDR headroom for HDR10 surfaces
c74f273848b d3d12: Move root sigs to D3D12_Shader_Common.hlsli, fix mismatch
e2a82092638 GDK: Use WIN_IsRectEmpty (IsRectEmpty is desktop-only)
290f64b86c5 GDK: Windows shape is desktop-only
794f0f1b423 GDK: Fix SDL_pixels.c/_c.h linking error caused by C / C++ mismatch
23ace600fcf GDK: Remove old shader sources, unify shader compilation .bats
bcbede31ce5 GDK: SDL_video_capture.c is now SDL_camera.c, thus remove from proj
e1e5d33420f GDK: Partially revert 2670eb44afec9311ee8fbec447703c427db1e1c8
8c015cd3b68 Sync SDL3 wiki -> header
8d023f98698 Updated documentation for new property parameters
2bc2840de50 vulkan: VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 is a 2-plane format
2bedd7f02ec Fixed pitch alignment when updating SDL_PIXELFORMAT_P010 textures
f2cd361e255 testyuv: added validation of P010 YUV format
47be24d2254 testyuv: added --monochrome and --luminance options for interactive mode
991ad27de8a testyuv: added GetColorspaceForYUVConversionMode()
812e04fb11d Vulkan Renderer - fix validation error with VkSemaphore reused before signaling. Have one semaphore per-submit rather than using the same one.
1e8b006d431 stdlib: qsort and bsearch changes.
af58ed978e9 Fixed the documentation for SDL_GetGamepadMappings()
7ff9be73982 Sync SDL3 wiki -> header
0454e1fdb42 Vulkan: added support for wrapping existing textures
2adbcce864c Vulkan: wait for all queues to be idle before destroying the device
01150271160 Vulkan Renderer - fix validation errors: * Make sure to always write pointSize in VS (fixes validation error in testsprite) * Fix validation error from acquiring swapchain semaphore more than once * Fix validation error from using incorrect framebuffer size in testautomation
0c6a1b636e4 Vulkan: added handling for SDL_MATRIX_COEFFICIENTS_UNSPECIFIED
4017e1370d2 Vulkan: cleaned up error handling
59bbfc1fddb Vulkan: only advertise YUV formats if the VK_KHR_sampler_ycbcr_conversion extension is available
bf853823a24 Removed unused YCbCr_matrix from Vulkan shaders
039144350c4 Be more precise about what we're testing in testyuv
b30ba1c5d45 Updated RGBtoYUV() to use the full YCbCr conversion formula
4513c32bb39 The ycbcrModel should be based on the transfer matrix, not the color primaries
a241cca9e63 Fixed warning C4090: 'function': different 'const' qualifiers
7117d545a3a Fixed crash if the controller product name is NULL
353e76b40b1 Use the correct colorspace for yuv conversion tests
fc94c3634e4 Fixed signed/unsigned comparison warning
ba340254231 Use direct3d11 as the default renderer on Windows
ad036d43e97 Vulkan Renderer - implement YcBcCr using VK_KHR_sampler_ycbcr_conversion. (#9169)
fb3bf1dcbdb Fixed device queue initialization when render and present queue families are different
945162c6d90 wayland: Small optimization for output removal function
68588b232c8 Sync SDL3 wiki -> header
e142bb1b0ce The extension strings are const and don't need to be duplicated
0997bdd292d Fixed SDL_calloc() calls (should be count, size)
614630df69c Allow using an external Vulkan device with the vulkan renderer
e03746b25f4 cmake: add -Wl,-rpath,${libdir} to Libs section of pc file for Apple platforms
c8372e20d6c SDLTest_CommonEvent: only set done when it is finished
220340e9443 Remove SDL_PIXELFORMAT_P010
c259a20f967 wayland: Remove all references to destroyed outputs from windows
84aaf63bd31 Fix typo in SDL_filesystem.h
0a961915dc2 cmake: testffmpeg requires link to EGL library for EGL feature
24e021c67ec testffmpeg: refactored texture creation properties into a single function
ff18d7cfa06 testffmpeg: added pixel format mapping for NV12 and NV21
81608ad077f Vulkan: fixed creating SDL_PIXELFORMAT_P010 textures
f99143f4374 Don't quit testffmpeg when alt-tabbing away
80d2ef7384b Fixed uploading Vulkan texture with w*bpp != pitch
3a796c97227 Allow specifying the render driver in the environment for testffmpeg
dc9a3c83e25 Use the mastering display metadata to do proper tone mapping for HDR content
98b1a59a959 Document the HDR tone mapping algorithm
1f536a1e779 cmake: fix SDL_RENDER_VULKAN reporting
935c197059e Fix testautomation failures (including clip rect) - closes #9145. During merging for prep'ing the final PR for the Vulkan Renderer, I misordered a memcpy that regressed several of the testautomation test. From now on, I will make sure to run testautomation on any future PRs before submitting.
e61dfe405f3 android: Fixed dead URL in comment.
35026cdcba9 Vulkan Renderer - robustly handle running out of descriptor sets or constant buffer memory. Closes #9131. My previous implementation of descriptor set handling was naive - it attempted to do VULKAN_IssueBatch when running out of descriptor sets or constant buffer space. For one thing, this had a bug and wasn't working (causing the crash), but moreover it would have resulted in having to flush the GPU. Instead, make the descriptor pools and constant buffer mapped buffers be resizeable so that if we need more it will grow to the size that is needed.
f9768816515 Vulkan: Don't invalidate internal state in InvalidateCachedState
c172fb59724 Vulkan: Support 'desired' vs 'required' memory flags (Fix #9310)
1558d52a0a9 Vulkan: Only return memory types which are a superset of what we need
fbe7301aba5 Sync SDL3 wiki -> header
e223e1d498e Added SDL_camera.h to the public Framework headers
be51b7aceaf Use the maximum potential headroom if EDR content isn't currently being displayed.
e0dadba6f5e Sync SDL3 wiki -> header
e6d9251ecb7 docs: improve CMake documentation for Apple
7a9c6c7ce96 Include SDL_PIXELFORMAT_P010 as a supported format for the metal renderer
d211da75ac6 Fixed crash if app delegate method is called when SDL isn't initialized
9dbbf0a2f7a Implemented clip rect functionality for the Vulkan renderer
141497b14f1 Added an automated test to verify clip rect functionality
d0af01e7d4f If the viewport changes the cliprect should be updated
1cae52bbacc Added JNI native methods to proguard-rules.pro (thanks @AntTheAlchemist!)
b8a52c12377 Vulkan: Make sure validation layer name is in-scope
276566235c4 Removed SDL_ClearHints() from the public API
a1ea706215e Added names for the newly supported pixel formats
f6c42406cd1 SDL_COLORSPACE_HDR10 is the default colorspace for SDL_PIXELFORMAT_P010 surfaces
4c5584174b7 Fixed error: declaration shadows a local variable [-Werror,-Wshadow]
2b0e7c40ef7 Verify that we can create pipeline state objects for the D3D12 renderer
5593ddb6a75 cmake: X11 is for Video, not Audio
38d24778ed5 ci: update deprecated node.js 16 actions
cbe330befd5 ci: bump cross-platform-actions/action version to v0.23.0
97372b56e80 Vulkan Renderer - handle dynamic resetting of vsync, requires swapchain recreation.
b1431e6702b Vulkan Renderer - implement support for vsync disabled. Closes #9116.
b9a00aa88e6 Fixed building the Vulkan renderer on Windows with Visual Studio
dfd8073a8fb Sync SDL3 wiki -> header
cab20117e61 Vulkan Renderer (#9114)
2f1f55aeb16 Updated default SDR white point and HDR headroom to better match game content
1fb5b9672e8 Keep SDR white point and HDR headroom defaults in one place
aeae202207b Make sure we actually have an HDR10 texture in the HDR10 shader
f4dd0dbbdeb Added colorspace conversion from SDL_COLOR_PRIMARIES_SMPTE431 and SDL_COLOR_PRIMARIES_SMPTE432 to SDL_COLOR_PRIMARIES_BT2020
d3930893aa9 KMSDRM is now a dependent option
7b1127d1fed cmake: Apple did not test SDL_CAMERA before adding camera support
e176626bac4 cmake: only enable SDL drivers when its subsystem is enabled
99cef7e13be cmake: check SDL subsystem dependencies (and include Camera)
9a44d44ceeb cmake: build Windows mediafoundation SDL_camera support
279a650fae9 mediafoundation: fix SDL_camera_mediafoundation MinGW compile warnings
78ac14124c4 Fixed warning C4245: 'function': conversion from 'int' to 'DWORD', signed/unsigned mismatch
2132ba8985c Sync SDL3 wiki -> header
0f973f3eb4c Removed SDL_RENDERCMD_SETCOLORSCALE, which ended up being a noop on all renderers
54c2ba6afd7 Added the Chrome HDR tonemap operator
4ba6aeee9d6 A second take on HDR support with an SDR white point and HDR headroom
3b7533f4a29 SDL_camera_v4l2: allow building against older kernel headers
58e6eacf970 docs: SDL_INIT_EVERYTHING does not exist anymore
7eca84d57ed cmake: don't use target_compile_features when the CMake thinks the compiler does not support it
cbf0b1ce81b testcamera: create window and renderer through test library
ecfbb6719f4 SDL_test: support SDL_INIT_CAMERA for SDL_CommonInit and SDL_CommonQuit
26ffbe43c24 camera: turn OFF `DEBUG_CAMERA` debug logging.
31fe061ab57 Sync SDL3 wiki -> header
f59c66a97f9 testcamera: Allow app to flip between a front and back camera.
6296677bc93 camera: Fixed Android hotplug.
6c080717f28 camera: Reset permissions to undecided when closing camera.
db8caa029ba camera: Added new function with gendynapi.py.
70b89ab70d0 camera: Added SDL_GetCameraDevicePosition.
b1ed49772cb camera: Replace testcamera.c with testcameraminimal.c
bdcddf48107 camera: Disconnected cameras become zombies that feed blank frames.
2613e3da24a camera: Rewrote Android support.
848dcf8a5fd main: Fixed compiler warning on Android.
47313bba321 camera: SDL_GetCameraDevices should not report "no devices" like an error.
f3485a47b3b android: Add src/main/ files to Android.mk
8db2a3b27a9 camera: Add an optional property that reports if a camera is back or front.
0b8617f71df test: Fixed CMake to build testcameraminimal correctly on WinRT.
99d1337de21 camera: Reenabled macOS/iOS support, with rewritten CoreMedia implementation.
f8fa08d2b1a camera: Fix compiler warnings on some platforms.
22dbc0f32f9 camera: Patched to compile after rebasing to latest in main.
7191a97fe3b camera: Windows support, through the Media Foundation API!
3dca8a03da5 camera: Removed some debug logging.
67708f91100 camera: Emscripten support!
182f7072847 include: Fixed doxygen comments on new camera APIs.
2cdff93578c v4l2: Corrected SDL_UDEV_AddCallback return check after #8694.
0b5875825e4 camera: framerate support.
9ae39d52de8 camera: Add sources to Xcode and Visual Studio projects.
87e7046fcaa camera: Public API functions should say "Format" not "Spec" to match audio.
f87d5362291 camera: Added more accurate timestamps.
d3e6ef3cc6e camera: Massive code reworking.
3d2d5d18f3b pixels: Packed-pixel YUV formats can legit report bits-per-pixel.
8e1758260cc surface: Fixed a typo in a comment.
cb10c80aafb camera: Reworked to operate with a driver interface, like other subsystems.
2ad44bd1621 camera: Made a pass over all the sources, cleaning up for SDL3 style, etc.
7ae955ce683 camera: Renamed everything from "video capture" to "camera", wired to CMake.
f49ce4a15d0 camera: Renamed "video_capture" files to "camera" and moved to own subdir.
4d000ae3bd5 audio: Change references to `streams[i]` to previously-calculated `stream`.
751917cb6fe Fix null pointer dereference in SDL_BindAudioStreams()
8b6eae2d4fa cmake: Split and store the libdecor version as individual parts
8073f4aa1d2 Pass the real error from D3D12_CreatePipelineState() back to the application
376ef4e418d Fixed the WGI driver picking up Xbox controllers handled by RAWINPUT
cb3a1a82d53 SDL_memcpy.c, SDL_memmove.c, SDL_memset.c: don't use gcc builtins if !HAVE_LIBC
bb4ec5250f5 Added support for non-gamepad controllers to the GameInput driver
f63f99bd2de Setup to handle the guide button once we get an updated GameInput SDK
ae8a9107813 Added infrastructure for reporting GameInput touchpads
ae4aa250828 Get the real GameInput device name if possible
419aebebda9 Added infrastructure for reporting GameInput sensors
85ac0381b7a IGameInputDevice::GetDeviceInfo() can never return a null pointer
fbe4153214f The HIDAPI driver takes precedence over the GameInput driver
4a59b17de2a Added infrastructure for querying battery status for GameInput
fd9a4eff9f9 Updated GameInput device info to match other joystick drivers
8f0f14c3122 Added automatic gamepad mapping for the GameInput driver
eb9a7d97f98 The GameInput driver handles Xbox controllers
698b7deaa26 Removed GAMEINPUT_JoystickEffectDataType_HapticFeedback
f35ede72810 Generalized the idea of joystick driver priority
7f33464bedd opengles2: Call glClearColor() with r,g,b,a, not r,g,g,a
fee140bdfeb Added the option for GameInput support to the Win32 SDL build
534f753e202 GameInput backend for SDL (Gamepad-only for now)
7ed1f3554d5 Define HAVE_LIBC for the platforms with a C library
ed615e92b79 Updated automated test now that getting an invalid property isn't an error
dc7baa415eb Show the window after creating the renderer
ff01d0b5685 Fixed building without HAVE_LIBC on Windows
8ce786d2b6c Property query functions don't set an error if they return the default value
202886f8739 Make use of the HDR light range when playing HDR video
317099b01fb Sync SDL3 wiki -> header
cb386494905 Added SDL_PROP_DISPLAY_HDR_WHITE_LEVEL_FLOAT
631b05b211e Drop stray trailing whitespace for android-project
6472e362648 x11: Minor cleanup in new mouse cursor selection code.
b986bc8be92 emscripten, wayland, x11: Share the table of CSS cursor names
7dbd6669c36 wayland: Move calls to WAYLAND_wl_cursor_theme_get_cursor out of the switch
40a6c1c0a70 wayland: Use CSS/freedesktop cursor name "default" as a fallback
791646535a5 wayland: Reference CSS cursor name vocabulary
cb9565354c5 x11: Use XcursorLibraryLoadCursor to load system cursors when available.
d451fcd7a7d Fixed HDR video content being too bright on Apple platforms
c09daf83888 Removed unused variables
6efe5f30ed5 don't let SDL_render.c:render_drivers[] have an empty initializer list.
aae2d228529 Check the SDL_VIDEO_RENDER_??? macros with #if instead of #ifdef
8ddddd36cd2 audio: Deal with race conditions against default device changes.
4eae38580f0 cocoa: Remove resize hack when changing the window backing scale Zeroing the window width and height was necessary in SDL2 to short-circuit the resize event deduplication code when the window backing scale changed, but not the logical size. This is no longer necessary in SDL3, as it will explicitly check for scale changes on resize events and dispatch pixel size/scale changed events as appropriate, even if the window's logical size hasn't changed.
f9ba0e1dbdf wayland: Don't store wl_output pointers in mode driver data
5e1d9d19a44 audio: Don't use SDL_BindAudioStream inside SDL_OpenAudioDeviceStream().
5e6ae85b631 Update the draggable state when the hit test callback changes
4d4c24acdd7 Sync SDL3 wiki -> header
bc984f78bf4 android: Remove blocking permission request code. Async only in SDL3!
af61cfd5e04 android: Added SDL_AndroidRequestPermissionAsync.
310f21bf84a video: Ensure that all references to a destroyed fullscreen window are removed
f2695856d6c Use SDL string functions
725c79f3ac0 Fixed building with SDL_LEAN_AND_MEAN
734d6fa1f31 Fixed documentation of SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN
ead3cbafd7a Fixed documentation for SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4 (thanks @AntTheAlchemist!)
814a94c3498 Fixed error: unused variable 'axes' [-Werror,-Wunused-variable]
b39246936b3 Added SDL_cocoashape* to Xcode project
f4d97bdb14a Update mouse transparency when the window shape changes
42cdbf6b214 Explicitly retain and release NSObjects in C structures
87c07a79c0b Changed property name from '-' to '_'
59f1e66adc4 Sync SDL3 wiki -> header
dca2721b919 Removed SDL_HINT_VIDEO_EXTERNAL_CONTEXT
2f7c24e4be9 Removed SDL_HINT_RENDER_SCALE_QUALITY
20051f805f3 Removed SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4
7cb1ca60ecf Removed SDL_HINT_RENDER_OPENGL_SHADERS
9920e062d5d Removed SDL_HINT_THREAD_STACK_SIZE
9e505252c0c Renamed SDL_HINT_PS2_DYNAMIC_VSYNC SDL_HINT_RENDER_PS2_DYNAMIC_VSYNC
a5389368218 Renamed SDL_HINT_LINUX_JOYSTICK_DEADZONES to SDL_HINT_JOYSTICK_LINUX_DEADZONES
980c379a0be Renamed SDL_HINT_LINUX_JOYSTICK_CLASSIC to SDL_HINT_JOYSTICK_LINUX_CLASSIC
1f7936d545e Renamed SDL_HINT_LINUX_HAT_DEADZONES to SDL_HINT_JOYSTICK_LINUX_HAT_DEADZONES
39cfb437ed4 Renamed SDL_HINT_LINUX_DIGITAL_HATS to SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS
b557c15bcf3 Renamed SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE to SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE
4f628b5b62c Renamed SDL_HINT_GDK_TEXTINPUT_DEFAULT to SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
fd5d761128c Renamed SDL_HINT_DIRECTINPUT_ENABLED to SDL_HINT_JOYSTICK_DIRECTINPUT
a5da7d0dd5b Renamed SDL_HINT_ALLOW_TOPMOST to SDL_HINT_WINDOW_ALLOW_TOPMOST
ef8791cba84 Cleaned up and organized hint documentation
9ce7fe2848a Removed SDL_HINT_ACCELEROMETER_AS_JOYSTICK
5af71138421 Rename property define names to have a type suffix
cacac6cc341 Updated structure and field names for consistency
6f87973b9c7 Added a reserved field to the SDL_Event structure
97d6e58a190 mark SDL_CleanupWindowTextureData as SDLCALL.
ee5289ef09f mark SDL_ClipboardTextCallback as SDLCALL
168322f3588 SDL_properties.c: mark CleanupFreeableProperty and CleanupSurface as SDLCALL
bba2a5d360b Added SDL_SetFreeableProperty() for internal use
432ce3f1679 Sync SDL3 wiki -> header
416803b03b7 Clarify the lifetime of the shape surface in SDL_SetWindowShape()
69f2bd151ec Fix broken use of MsgWaitForMultipleObjects.
0f81598e9f5 Wayland: Avoid SEGV if a modifier notification comes before the keymap
f95b7ee4da8 Renamed SDL_HasWindowSurface to SDL_WindowHasSurface
1ec0e22bcd7 Sync SDL3 wiki -> header
11620971358 Added SDL_RenderViewportSet() to tell whether the viewport was previously set to a specific rectangle.
3ebbf0f409d Guarded ElementAlreadyHandled with #ifdef ENABLE_PHYSICAL_INPUT_PROFILE (thanks @Donione!)
9ff8df932a5 Sync SDL3 wiki -> header
f6b92c9b88b Re-added a simplified version of SDL_SetWindowShape()
1143bdc3513 Greatly simplified the shape example
b7c61569f89 Redefine XINPUT_CAPABILITIES_EX as an SDL typedef
bfcca2a36e0 Use saturate() instead of clamp() for slightly faster shader operation
1684032c17b Sync SDL3 wiki -> header
4ce7ae31d44 Document that SDL_UpdateJoysticks() needs to be called to handle rumble processing
d777becd9da Fixed spacing
91639d855f2 Don't use the direct3d12 renderer with transparent windows
26e947f8eaa Added VIDPID for OpenFFBoard wheel (thanks @groybe!)
c951bbe3def Look at all available usages when determining whether to ignore a device
dd726cb0976 Moved rgb24_yuv420_std() to the correct header
1673d52351e Fixed building with an older macOS SDK
4ec5aef028f Disable warning C4214: nonstandard extension used: bit field types other than int
faeb2b1f225 Fixed warning C4204: nonstandard extension used: non-constant aggregate initializer when built with Visual Studio 2019
1269590dfc2 Clarified that SDL scancodes are unaffected by keyboard layout
1c4c29b7adc Fixed a swap chain leak and a double-free in testffmpeg.c
3158342441a Use SDL_Color for SDL_RenderGeometryRaw() and add SDL_RenderGeometryRawFloat()
9e194c1a1d6 Added BT.601/SMPTE240 to the color primaries conversion matrices
fb823fbe95e Make sure we're actually using the HDR10 colorspace before using that shader
7b74e2eeb8f Emscripten_SetWindowFullscreen: Fix crash due to uninitialized EmscriptenFullscreenStrategy members
ed86cec07f9 Sync SDL3 wiki -> header
985da79d73e Use a more concise representation of YUV -> RGB conversion
8afba41aef4 Added support for HDR10 video on Apple platforms
2039c46d2ca Added support for creating an SDL texture from a CVPixelBufferRef
c79462dc50f Fixed Xcode build warnings
ba074acad43 Implemented scRGB colorspace and HDR support on macOS
451dc414278 Sync SDL3 wiki -> header
30e176d6ba5 Added HDR display properties and related event
d4caef5b892 Generalize SDR white level handling into a color scale
82d89ff4fb1 Fix memory leak in SDL_UpdateSteamVirtualGamepadInfo()
b05ea8e04e1 Updated direct3d12 renderer with HDR10 and SDR whitelevel support
c3e4481d56a Use a reasonable default for unspecified YUV colorspace
240158f3e80 Scale SDR content to SDR whitelevel when HDR is enabled
e97b2061b4b Converted shader headers to UNIX line endings
e98e5abd2a2 Added batch file to create D3D12 shaders
809f02e89e7 SDL_ReadSurfacePixel() now supports large pixel formats
9755e490c03 Workaround for crash at shutdown in testffmpeg
e74171b1ae9 Added support for HDR10 video playback on direct3d11
f85535b4b60 Use functions from SDL instead of libc
a6374123c77 Sync SDL3 wiki -> header
548b382fd98 Fixed slow startup time when using the direct3d12 renderer
dab77fe29b1 Added support for SDL_COLORSPACE_BT709_FULL to the hardware renderers
ec322bee1c0 Fixed testyuv help message
327b976bc46 SDL_COLORSPACE_JPEG is the default YUV colorspace
5b8e5f8b9f0 Fixed accidental changing of All to Allu in previous commit (thanks @zturtleman!)
67bbf20addc Null check SDL_DBusContext pointer
2ad4646a248 Don't release currentOffscreenRenderTargetView, we don't have a reference to it
9005512c180 Fixed build
7271a2040b6 Don't force on the D3D11 debug flag
b4d0af9cf3b Removed unused variables
200f87ea0b5 Only set the colorspace if it's not the default
c0b27ccef99 Fixed warning C4701: potentially uninitialized local variable 'drawnTextRect' used
8eba5b75ca9 Fixed warning C4701: potentially uninitialized local variable 'rndctx' used
445cb42acd0 Fixed warning C4244: 'function': conversion from 'int' to 'Uint16', possible loss of data
45f936c7881 Fixed warning C4245: 'initializing': conversion from '__int64' to 'unsigned __int64', signed/unsigned mismatch
74e85e3a517 Fixed warning C4706: assignment within conditional expression
c3e3ad61400 Fixed build warnings
c02aaebccc0 Fixed warning C4245: 'initializing': conversion from 'int' to 'Uint32', signed/unsigned mismatch
ff5fdf9f53e Fixed warning C4244: 'initializing': conversion from 'int' to 'const Uint8', possible loss of data
9989f92eeee Fixed warning C4245: 'initializing': conversion from 'int' to 'SDL_AudioDeviceID', signed/unsigned mismatch
cb811ba4638 Fixed warning C4366: The result of the unary '&' operator may be unaligned
62221b3003c Fixed warning C4245: 'return': conversion from 'int' to 'SDL_TimerID', signed/unsigned mismatch
4514aabb414 Fixed warning C4245: 'return': conversion from 'int' to 'Uint64', signed/unsigned mismatch
f107393ed56 Fixed warning C4245: 'return': conversion from 'int' to 'unsigned int', signed/unsigned mismatch
c3e821fa803 Optimized SDL_DuplicatePixels()
89b9d6cbdc7 SDL_RenderReadPixels() now returns a surface
ab571633d12 Sync SDL3 wiki -> header
50a805cdd1b Use YUV colorspaces instead of a global YUV conversion mode
9e76f23561c SDL_windowsopengl.c: WGL: Fixed null-pointer dereference crash
e0158f68e45 Fix SDL_mfijoystick build issues
2819988f8bc Sync SDL3 wiki -> header
a2c45f61bb6 Updated scRGB render colorspace documentation
e67e0c5d558 vulkan_metal.h: Make compatible with ObjC ARC (thanks @jmroot!)
f9c57e16b0b Don't test 10-bit pixel format conversion
b8fe96fa81c Fixed build warning
ba86d9f235e When changing surface format, use the default colorspace for the new format
25fd5da1a75 Removed maxCLL and maxFALL properties, moved them to SDL_image for HDR image loading
943ab983cb8 Sync SDL3 wiki -> header
5d48f9a63a0 Added SDL_CopyProperties()
c007c7ed55a Sync SDL3 wiki -> header
aa8f609ff3a Clamp HDR colors to the SDR range for SDR renderers
9591b2cfb44 Finalized the SDL render API colorspaces
7c089f4e570 testautomation_math: Fix misleading log output
b66dba2a9d0 test: Don't accept results that are much less than expected
f1f9e271288 testautomation_math: do relative comparison + more precise correct trigonometric values
babca704e0b testautomation: Don't expect exp to yield exact floating point results
f6f9468d840 Fixed warning C4701: potentially uninitialized local variable 'srcpixel' used
d383299779b Fixed build on older Windows SDK
d04fea8b877 Even more miscellaneous gamepad buttons!
cb70e972e3e Added miscellaneous gamepad buttons for additional macro buttons on some controllers
d6a48e4958e Don't use the system iconv on Apple mobile platforms
ea0853d23dc Added an HDR gradient test to testcolorspace
dc607c666bf Fixed creating HDR textures with SDL_CreateTexture()
dcfb069c756 Sync SDL3 wiki -> header
7561116873d Added support for floating point texture formats
90597aeaef8 HDR10 colorspace isn't currently supported
19dde63e7c4 Added a simple linear scale for tonemapped HDR to SDR surface conversion
fc35b7e121e Convert to sRGB if trying to create a texture from an HDR surface
c1f3c810033 Make the color primary conversion code reusable
496ed01bdb5 Detect blending in HDR10 colorspace
dd28ab04894 Added SDL_SetRenderDrawColorspace() and SDL_GetRenderDrawColorspace()
9c8b47b726f Cache the draw color state in the software and PSP renderers
dacfaa91b42 Make sure to round color values when converting to Uint8
c00b6a8e205 SDL_kmsdrmvideo.c: clean-up includes, add clarifying note after 5ab879f
a4969e393e3 Sync SDL3 wiki -> header
6f443e2acaf Added support for the scRGB colorspace on D3D11 and D3D12
12c31898c1d Update colors in SDL_RenderGeometryRaw() if we're doing interpolation in linear space
77549dc91ea Fixed some places using SDL_SetRenderDrawColor() instead of SDL_SetRenderDrawColorFloat()
4b3c530dd17 Fixed out of bounds access
3c45544a146 Added a slow blit function to handle large pixel formats and colorspace conversion
49cc4c14e9a Use the default colorspace if we have to convert texture pixels
c1f97c8e07d Fixed testgeometry after color format change (thanks @sezero!)
482a27bc00c wayland: Throttle to 20hz if the frame callback never fires
4a759b340ff Fixes in SDL_ColorSpace (SDL_pixels.h)
9462eec57be pipewire: Don't assert if the default capture device is a sink or vice versa
d15fb9e063a Sync SDL3 wiki -> header
f257eb44816 Added the concept of colorspace to the SDL renderer
554f0625d34 Renderer colors now have floating point precision
da8fc70a83c Fixing viewport
851c1a5e9c9 Fix scissor usage
dc35ee9d540 Fix color
61a3a163dbc Fixed typo (thanks @Akaricchi!)
7fbd85ad5cf Sync SDL3 wiki -> header
61b5c38e6e4 Added the initial concept of colorspace to SDL
a3bfd5329c5 Fix broken mingw i686 buildscript
59d7dd36155 Fix broken mingw x86_64 buildscript
fbf10afb316 wayland: Consolidate window creation logic
2e96307b275 wayland: Always create a viewport for the surface, if possible
94240c197de docs: Hint envvars needs to use the hint string, not the macro name
00a8ca403e2 Sync SDL3 wiki -> header
fbebbab90d8 wayland: Only set the explicit logical window size when using display scaling
879ba46adef wayland: Make sure the logical window size can't go to zero.
b97cda226fb wayland: Refactor internal variable names for better readability
344ec60f8f5 tests: Fix window centering test with Wayland display scaling mode
5b8ca05f1a7 wayland: Add a forced screen space scaling mode
9f7eb6c4c11 Fixed testautomation log callback calling convention
12bdb2b4d04 Added the environment variable SDL_LOGGING to control default log output
dcd26a80e5a windows: Minor tweaks that makes Windows XP vidmodes work again.
6ca596cfc1e windows: Manage MapVirtualKey vs Windows XP.
1c5bc537385 windows: Manage WideCharToMultiByte vs Windows XP.
2144c2ac713 windows: Added WIN_IsWindowsXP, for extreme runtime compatibility checks.
56fa22c63bf windows: OS version checks now cache results.
4fba6633687 Simplified the default log category logic
a7a98d8bbb8 Document that the default log priority is error, not critical
fd14a20a4be Sync SDL3 wiki -> header
17768c51fcb Revert "Sync SDL3 wiki -> header"
2a4db8c4156 SDL_rwops.c (SDL_IsRegularFile): fix WinRT build failure due to S_ISREG
5ae2ffc1277 document that text input is on by default
5e96e410d63 Sync SDL3 wiki -> header
f66fe7e2210 Replaced SDL_GetJoystickCaps() with joystick properties
019dc53764d SDL_RWFromFile, stdio: reject if the file is not a regular file.
aba3038353e Sync SDL3 wiki -> header
3b55c7d1f4c Shortened SDL property names
1885e6b2e0b Sync SDL3 wiki -> header
8a4284b7df2 Clarified the use of SDL_RENDERER_SOFTWARE when creating a renderer
2d94b4f4908 Make sure we set datasize on error in SDL_LoadFile_RW()
dff76bf2956 Enable text input on video initialization without popping up an on-screen keyboard
b9ea2dde443 Added VisionOS as a supported target to the Xcode project
7a7875c904b wasapi: A few tweaks to buffer management.
e71e16950a5 wayland: Use the preferred order of displays exposed by KDE
e0c2cca629e Fixed fullscreen windows having rounded corners and 1px transparent borders on Windows 11.
a1a4948fdae Fixed the size and position of minimized windows on Windows
5ba839e83b6 fix XRandR refresh rate calculation
44a2c4d5126 Only retain SDL_* + platform macro's in rename_macros.py
c5794cd9116 ci: bump actions version tag
33f86d81fce Add all macros from SDL2's SDL_config.h to rename_macros.py
aeac8774f79 Missed one
d0dd60c8baa Updated new pixel format names to be more consistent with the others
0f78aa7c30c Add some high bit-depth pixel formats
5ab879f89aa SDL_kmsdrmvideo.c: move SDL_kmsdrmvulkan.h include to before all others
ecbbef8b8df blendmode: Corrected docs for `SDL_BLENDOPERATION_[REV_]SUBTRACT`.
8814095aa82 main: Indented SDL_main headers for readability, removed SDL2 compat macros.
22ea59425d0 wayland: Fix whitespace
c202893fbb0 wayland: Make sure the primary display is always first under GNOME
b8081e8e357 video: lowercase some video backend names.
02f59f3ae69 Note that SDL_GetHaptics() is useful in combination with SDL_OpenHaptic()
594eef99eca Added a migration note about SDL_TouchID and SDL_FingerID
2670eb44afe Improved timing accuracy of SDL_WaitEventTimeout() on Windows
5ddd97062e7 Added test code to validate SDL_WaitEventTimeout()
d6ebbc2fa4a mayflash adapter PS4 support
b8c4ea3cd12 Don't add the FIXME for converted macros
006edcab604 Switch to using SDL_powf() instead of pow()
95a67278d1e Updated documentation after 2654c52d0e03578ea002dc62603a3f48e1353829
205c417f740 testgles2.c, testgles2_sdf.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
6b3b7c7d4b6 SDL_hidapi_ps3.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
81314c4998c SDL_render_gl.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
1c79edbe022 SDL_test_memory.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
07a0c0e402c SDL_hidapi.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
34f03207c4a SDL_cpuinfo.c: adjust for new SDL_PLATFORM_WINDOWS meaning.
fd6ec3b9aa5 SDL_intrin.h: adjust for new SDL_PLATFORM_WINDOWS meaning.
2654c52d0e0 macro SDL_PLATFORM_WINDOWS now means Win32 api and Windows-based OS's.
1ac96029092 Make sure we include the matching copy of vk_video headers
fc74bf8455f Update to the latest version of the Khronos headers
12b01ef674e rename_macros.py: fix typo for __WIN32__
a06ee5b98df Don't try to use SDL platform macros in configure-time checks
f61870cfb45 Go back to using compiler built-in macros in ARM assembly code
ed421f4fd8d Revert Khronos headers to upstream version
8fe257b5417 Added support for other HDR color primaries
c5792cc0de9 SDL_thread.h: replace uses of __GDK__ and __WINRT__ (missed in #8875.)
31d133db40b Define SDL_PLATFORM_* macros instead of underscored ones (#8875)
ceccf24519b Sync SDL3 wiki -> header
7cd914593f3 Added HDR surface properties and tone mapping from HDR to SDR
a71f99c71f7 Fixed ambiguity between std::byte and byte in rpcndr.h
6fb188eb35f Sync SDL3 wiki -> header
cd231a65f62 Added SDL_GetJoystickCaps() and SDL_GetGamepadCaps() to get the capabilities of controllers
c88c12148d8 SDL_ShowMessageBox: Remove `#ifdef`s and respect SDL_VIDEO_DRIVER hint.
5f65fd360d0 wayland: Free the input struct in all initialization failure paths
84e47b4af59 wayland: Always create the backing input store, even if there is no seat
99ce8af4397 Fixed warning C4244: '=': conversion from 'Sint64' to 'int', possible loss of data
a28a42cfc68 Fixed declaration of SDL_HapticRumbleSupported
052b958bf2f Made SDL_HapticEffect const in the API
fa5bfe577ca Fixed warnings building for UWP
3e541eab229 Fixed error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized]
8f20ef5b438 Re-enable C runtime with Mingw, and disable the problematic math test
1f177be1e45 Disable the Mingw C runtime by default
5e70ee29cc6 Build SDL with the static C runtime on Visual Studio
e2f35a16c28 Added <string.h> for declaration of memset() and memcpy()
7a069cc4b0b Allow optimizing memcpy and memset where possible
8d25c2d2609 video: Fix window manager initiated fullscreen window moves
8c7f5b73e8d Fixed build
4d6e2d8b736 Sync SDL3 wiki -> header
308906ba254 Added SDL_FlipSurface() to flip a surface vertically or horizontally
2cd583ee13e Prevent asan warning on qsort(): 'src/stdlib/SDL_qsort.c:27:5: runtime error: null pointer passed as argument 1, which is declared to never be null`
5db543a66a5 Just use the khronos headers for the checks that need them
4b82bed2599 Fixed building with the steamrt/scout SDK
116c60c5b03 Run EGL/GLES cmake tests with the Khronos headers available
b552f26e6a3 Fix building with the steamrt/scout SDK
7b02d328fa6 Fixed overflow in SDL_SoftStretch() (see #8878)
64972b41848 Fixed build
6a00ae7e58a Fixed rendering diagonal lines within a viewport
8d9c7d8ebe2 SDL_UpdateFullscreenMode: Only restore mouse position when exiting fullscreen if the fullscreen mode actually changed
a73132177d3 Make sure the render target isn't bound as a resource
09ba55b462b Fixed crash scaling very large surfaces
aa3fc6e904d Fixed D-pad on Xbox One controllers using the HIDAPI driver
3639743d890 Fixed bug #7614: Segmentation Fault in SDL_BlitSurface (#7808)
bd5d4d61edc Fixed potential overflow in software triangle rendering
b566bfce071 Fixed warning C4152: nonstandard extension, function/data pointer conversion in expression
9fc1135e3bb Fixed warning C4127: conditional expression is constant
1dbe54c4e65 Fixed warning C4244: 'function': conversion from 'SDL_ThreadID' to 'DWORD', possible loss of data
f86b3ac6052 Fixed types used in documentation (thanks @Dragon-Baroque!)
129b459b2cf Fix compilation problems about yuv_rgb_lsx.c
81ac656b7c9 SDL_CalculateRGBSize, SDL_CalculateYUVSize: set the error indicator
e9a0edc8476 testautomation_surface: Really make width * bpp overflow
eb059538f87 testautomation_surface: Really make pitch + alignment overflow
4fdc291f5d6 Add spaces around SDL_PRI??? to avoid potential compiler warnings.
949b4fc3492 x11: XI_Motion should mark the global mouse position as changed.
87f559e0214 Updated Xcode projects after dbdc65fc95
49adb23ad90 Build yuv_rgb_lsx.c with -mlsx
dbdc65fc955 video: move standard c, sse and lsx implementations of yuv2rgb to its own source
a31dc6dfcb8 Switched SDL_TouchID and SDL_FingerID to be Uint64 with 0 being an invalid value
b19d43a74d8 Add SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING to migration readme
b3849739364 Remove no longer needed hint
42d6cf9ce75 Update thread naming on windows
cda2bffeeea Re-add SDL_HAPTIC_SQUARE for SDL 3.0
df4b855af5d Updated SDL_TLSID to use the same type as other IDs in SDL
fc0c7749764 Renamed SDL_ThreadID() to SDL_GetCurrentThreadID()
d6a41f8f311 Updated SDL_TimerID to use the same type as other IDs in SDL
bc3a71d400c Sync SDL3 wiki -> header
464f4d19fe8 Removed obsolete XInput mapping hint
f8dfee01bb4 Made SDL_ReadSurfacePixel a public function
f7ba340999c remove several instances of unnecessary emptry str "" after SDL_PRI???
c540c77756e Removed SDL_INIT_EVERYTHING
26996e2c024 We've decided to keep separate functions for creating a thread with and without stack size specified.
a2665f54c86 Updated the atomic API for SDL 3.0 naming conventions
4e60fc9b2b1 Sync SDL3 wiki -> header
fb898d6df0b Clarify that desktop mode is the non-exclusive borderless fullscreen mode
b5bcf45a65f Sync SDL3 wiki -> header
4fee6cb274f Added documentation for custom event cleanup in SDL_FlushEvent()
fd34bc56f97 cocoa: Fix SDL_CocoaWindowData keyboard_focus being left pointing to a destroyed SDL window if input focus not previously reset for that window
0a99ad7a686 cocoa: Fix Cocoa_RaiseWindow not making child window key if SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is true
20e8411b127 Sync SDL3 wiki -> header
f4a0bc02d54 Re-added prototypes for stub API functions
f224af5ac50 Updated Haptic API for SDL 3.0 conventions
8ca9134115d Removed unnecessary NULL assignment
75dd7e1658f Note that we only allow disabling major subsystems
130b361904e Removed SDL_MISC_DISABLED
20fa5e6ad0e Removed SDL_LOCALE_DISABLED
6efadfdb776 Removed SDL_FILESYSTEM_DISABLED
3d951134a3c Removed SDL_FILE_DISABLED
ac367be171b Updated CMakeLists.txt now that timers and threads can't be disabled
e2080f74fdf Fixed building with the joystick subsystem disabled
a0967c017ff Fixed building with the video subsystem disabled
31f34e95042 Removed SDL_ATOMIC_DISABLED
6e1b11368d7 Removed SDL_CPUINFO_DISABLED
52d65870844 Removed SDL_EVENTS_DISABLED
ba027227559 Removed SDL_LOADSO_DISABLED
git-subtree-dir: external/sdl/SDL
git-subtree-split: fb5307c1b3f46e70217ce43c0dbab4d3795bd91b
This commit is contained in:
@ -35,8 +35,10 @@
|
||||
#include <SDL3/SDL_audio.h>
|
||||
#include <SDL3/SDL_bits.h>
|
||||
#include <SDL3/SDL_blendmode.h>
|
||||
#include <SDL3/SDL_camera.h>
|
||||
#include <SDL3/SDL_clipboard.h>
|
||||
#include <SDL3/SDL_cpuinfo.h>
|
||||
#include <SDL3/SDL_dialog.h>
|
||||
#include <SDL3/SDL_endian.h>
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_events.h>
|
||||
@ -66,17 +68,18 @@
|
||||
#include <SDL3/SDL_quit.h>
|
||||
#include <SDL3/SDL_rect.h>
|
||||
#include <SDL3/SDL_render.h>
|
||||
#include <SDL3/SDL_rwops.h>
|
||||
#include <SDL3/SDL_iostream.h>
|
||||
#include <SDL3/SDL_scancode.h>
|
||||
#include <SDL3/SDL_sensor.h>
|
||||
#include <SDL3/SDL_storage.h>
|
||||
#include <SDL3/SDL_surface.h>
|
||||
#include <SDL3/SDL_system.h>
|
||||
#include <SDL3/SDL_thread.h>
|
||||
#include <SDL3/SDL_time.h>
|
||||
#include <SDL3/SDL_timer.h>
|
||||
#include <SDL3/SDL_touch.h>
|
||||
#include <SDL3/SDL_version.h>
|
||||
#include <SDL3/SDL_video.h>
|
||||
#include "SDL3/SDL_video_capture.h"
|
||||
#include <SDL3/SDL_oldnames.h>
|
||||
|
||||
#endif /* SDL_h_ */
|
||||
|
@ -66,9 +66,9 @@ assert can have unique static variables associated with it.
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
|
||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||
#elif ( defined(SDL_PLATFORM_APPLE) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
||||
#elif defined(__APPLE__) && defined(__arm__)
|
||||
#elif defined(SDL_PLATFORM_APPLE) && defined(__arm__)
|
||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" )
|
||||
#elif defined(__386__) && defined(__WATCOMC__)
|
||||
#define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
|
||||
@ -167,7 +167,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data
|
||||
#ifndef SDL_AssertBreakpoint
|
||||
#if defined(ANDROID) && defined(assert)
|
||||
/* Define this as empty in case assert() is defined as SDL_assert */
|
||||
#define SDL_AssertBreakpoint()
|
||||
#define SDL_AssertBreakpoint()
|
||||
#else
|
||||
#define SDL_AssertBreakpoint() SDL_TriggerBreakpoint()
|
||||
#endif
|
||||
|
@ -31,8 +31,8 @@
|
||||
* with full mutexes.
|
||||
*
|
||||
* The list of "safe" functions to use are:
|
||||
* SDL_AtomicLock()
|
||||
* SDL_AtomicUnlock()
|
||||
* SDL_LockSpinlock()
|
||||
* SDL_UnlockSpinlock()
|
||||
* SDL_AtomicIncRef()
|
||||
* SDL_AtomicDecRef()
|
||||
*
|
||||
@ -105,10 +105,10 @@ typedef int SDL_SpinLock;
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicLock
|
||||
* \sa SDL_AtomicUnlock
|
||||
* \sa SDL_LockSpinlock
|
||||
* \sa SDL_UnlockSpinlock
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_TryLockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Lock a spin lock by setting it to a non-zero value.
|
||||
@ -120,10 +120,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicTryLock
|
||||
* \sa SDL_AtomicUnlock
|
||||
* \sa SDL_TryLockSpinlock
|
||||
* \sa SDL_UnlockSpinlock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
extern DECLSPEC void SDLCALL SDL_LockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
/**
|
||||
* Unlock a spin lock by setting it to 0.
|
||||
@ -137,10 +137,10 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicLock
|
||||
* \sa SDL_AtomicTryLock
|
||||
* \sa SDL_LockSpinlock
|
||||
* \sa SDL_TryLockSpinlock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockSpinlock(SDL_SpinLock *lock);
|
||||
|
||||
/* @} *//* SDL AtomicLock */
|
||||
|
||||
@ -153,7 +153,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||
void _ReadWriteBarrier(void);
|
||||
#pragma intrinsic(_ReadWriteBarrier)
|
||||
#define SDL_CompilerBarrier() _ReadWriteBarrier()
|
||||
#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||
#elif (defined(__GNUC__) && !defined(SDL_PLATFORM_EMSCRIPTEN)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
|
||||
#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
|
||||
#elif defined(__WATCOMC__)
|
||||
@ -161,7 +161,7 @@ extern __inline void SDL_CompilerBarrier(void);
|
||||
#pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
|
||||
#else
|
||||
#define SDL_CompilerBarrier() \
|
||||
{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
|
||||
{ SDL_SpinLock _tmp = 0; SDL_LockSpinlock(&_tmp); SDL_UnlockSpinlock(&_tmp); }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -199,7 +199,7 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
|
||||
#elif defined(__GNUC__) && defined(__arm__)
|
||||
#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
|
||||
#if 0 /* defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_ANDROID) */
|
||||
/* Information from:
|
||||
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
|
||||
|
||||
@ -226,7 +226,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
||||
#else
|
||||
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
|
||||
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
|
||||
#endif /* __LINUX__ || __ANDROID__ */
|
||||
#endif /* SDL_PLATFORM_LINUX || SDL_PLATFORM_ANDROID */
|
||||
#endif /* __GNUC__ && __arm__ */
|
||||
#else
|
||||
#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
|
||||
@ -267,7 +267,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
||||
*
|
||||
* It is a struct so people don't accidentally use numeric operations on it.
|
||||
*/
|
||||
typedef struct { int value; } SDL_AtomicInt;
|
||||
typedef struct SDL_AtomicInt { int value; } SDL_AtomicInt;
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a new value if it is currently an old value.
|
||||
@ -282,11 +282,9 @@ typedef struct { int value; } SDL_AtomicInt;
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicCASPtr
|
||||
* \sa SDL_AtomicGet
|
||||
* \sa SDL_AtomicSet
|
||||
* \sa SDL_AtomicCompareAndSwapPointer
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_AtomicInt *a, int oldval, int newval);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwap(SDL_AtomicInt *a, int oldval, int newval);
|
||||
|
||||
/**
|
||||
* Set an atomic variable to a value.
|
||||
@ -370,11 +368,11 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_AtomicInt *a, int v);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicCAS
|
||||
* \sa SDL_AtomicCompareAndSwap
|
||||
* \sa SDL_AtomicGetPtr
|
||||
* \sa SDL_AtomicSetPtr
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, void *oldval, void *newval);
|
||||
|
||||
/**
|
||||
* Set a pointer to a value atomically.
|
||||
@ -388,7 +386,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicCASPtr
|
||||
* \sa SDL_AtomicCompareAndSwapPointer
|
||||
* \sa SDL_AtomicGetPtr
|
||||
*/
|
||||
extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
@ -404,7 +402,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AtomicCASPtr
|
||||
* \sa SDL_AtomicCompareAndSwapPointer
|
||||
* \sa SDL_AtomicSetPtr
|
||||
*/
|
||||
extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_mutex.h>
|
||||
#include <SDL3/SDL_properties.h>
|
||||
#include <SDL3/SDL_rwops.h>
|
||||
#include <SDL3/SDL_iostream.h>
|
||||
#include <SDL3/SDL_thread.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
@ -561,7 +561,6 @@ extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BindAudioStreams
|
||||
* \sa SDL_UnbindAudioStreams
|
||||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
@ -583,7 +582,6 @@ extern DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_Au
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BindAudioStreams
|
||||
* \sa SDL_UnbindAudioStreams
|
||||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
@ -607,9 +605,6 @@ extern DECLSPEC int SDLCALL SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_Aud
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BindAudioStreams
|
||||
* \sa SDL_BindAudioStream
|
||||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, int num_streams);
|
||||
|
||||
@ -626,9 +621,6 @@ extern DECLSPEC void SDLCALL SDL_UnbindAudioStreams(SDL_AudioStream **streams, i
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BindAudioStream
|
||||
* \sa SDL_BindAudioStreams
|
||||
* \sa SDL_UnbindAudioStreams
|
||||
* \sa SDL_GetAudioStreamDevice
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
@ -649,8 +641,6 @@ extern DECLSPEC void SDLCALL SDL_UnbindAudioStream(SDL_AudioStream *stream);
|
||||
*
|
||||
* \sa SDL_BindAudioStream
|
||||
* \sa SDL_BindAudioStreams
|
||||
* \sa SDL_UnbindAudioStream
|
||||
* \sa SDL_UnbindAudioStreams
|
||||
*/
|
||||
extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_AudioStream *stream);
|
||||
|
||||
@ -727,9 +717,6 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream,
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetAudioStreamFormat
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_SetAudioStreamFrequencyRatio
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream,
|
||||
@ -801,12 +788,10 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *st
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_FlushAudioStream
|
||||
* \sa SDL_ClearAudioStream
|
||||
* \sa SDL_DestroyAudioStream
|
||||
* \sa SDL_FlushAudioStream
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamQueued
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len);
|
||||
|
||||
@ -833,13 +818,9 @@ extern DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, cons
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_SetAudioStreamFormat
|
||||
* \sa SDL_FlushAudioStream
|
||||
* \sa SDL_ClearAudioStream
|
||||
* \sa SDL_DestroyAudioStream
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void *buf, int len);
|
||||
|
||||
@ -863,12 +844,8 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamData(SDL_AudioStream *stream, void
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_FlushAudioStream
|
||||
* \sa SDL_ClearAudioStream
|
||||
* \sa SDL_DestroyAudioStream
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream);
|
||||
|
||||
@ -900,7 +877,6 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamAvailable(SDL_AudioStream *stream)
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_ClearAudioStream
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
|
||||
@ -922,12 +898,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioStreamQueued(SDL_AudioStream *stream);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_ClearAudioStream
|
||||
* \sa SDL_DestroyAudioStream
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
@ -942,12 +913,10 @@ extern DECLSPEC int SDLCALL SDL_FlushAudioStream(SDL_AudioStream *stream);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_FlushAudioStream
|
||||
* \sa SDL_DestroyAudioStream
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamQueued
|
||||
* \sa SDL_PutAudioStreamData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
@ -976,8 +945,6 @@ extern DECLSPEC int SDLCALL SDL_ClearAudioStream(SDL_AudioStream *stream);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_UnlockAudioStream
|
||||
* \sa SDL_SetAudioStreamPutCallback
|
||||
* \sa SDL_SetAudioStreamGetCallback
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
@ -997,8 +964,6 @@ extern DECLSPEC int SDLCALL SDL_LockAudioStream(SDL_AudioStream *stream);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LockAudioStream
|
||||
* \sa SDL_SetAudioStreamPutCallback
|
||||
* \sa SDL_SetAudioStreamGetCallback
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_UnlockAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
@ -1134,11 +1099,6 @@ extern DECLSPEC int SDLCALL SDL_SetAudioStreamPutCallback(SDL_AudioStream *strea
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
* \sa SDL_PutAudioStreamData
|
||||
* \sa SDL_GetAudioStreamData
|
||||
* \sa SDL_GetAudioStreamAvailable
|
||||
* \sa SDL_FlushAudioStream
|
||||
* \sa SDL_ClearAudioStream
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
|
||||
|
||||
@ -1306,7 +1266,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid,
|
||||
* Example:
|
||||
*
|
||||
* ```c
|
||||
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, &spec, &buf, &len);
|
||||
* SDL_LoadWAV_IO(SDL_IOFromFile("sample.wav", "rb"), 1, &spec, &buf, &len);
|
||||
* ```
|
||||
*
|
||||
* Note that the SDL_LoadWAV function does this same thing for you, but in a
|
||||
@ -1317,7 +1277,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid,
|
||||
* ```
|
||||
*
|
||||
* \param src The data source for the WAVE data
|
||||
* \param freesrc If SDL_TRUE, calls SDL_RWclose() on `src` before returning,
|
||||
* \param closeio If SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error
|
||||
* \param spec A pointer to an SDL_AudioSpec that will be set to the WAVE
|
||||
* data's format details on successful return
|
||||
@ -1344,7 +1304,7 @@ extern DECLSPEC int SDLCALL SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid,
|
||||
* \sa SDL_free
|
||||
* \sa SDL_LoadWAV
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, SDL_bool freesrc,
|
||||
extern DECLSPEC int SDLCALL SDL_LoadWAV_IO(SDL_IOStream * src, SDL_bool closeio,
|
||||
SDL_AudioSpec * spec, Uint8 ** audio_buf,
|
||||
Uint32 * audio_len);
|
||||
|
||||
@ -1354,7 +1314,7 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, SDL_bool freesrc,
|
||||
* This is a convenience function that is effectively the same as:
|
||||
*
|
||||
* ```c
|
||||
* SDL_LoadWAV_RW(SDL_RWFromFile(path, "rb"), 1, spec, audio_buf, audio_len);
|
||||
* SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), 1, spec, audio_buf, audio_len);
|
||||
* ```
|
||||
*
|
||||
* Note that in SDL2, this was a preprocessor macro and not a real function.
|
||||
@ -1383,7 +1343,7 @@ extern DECLSPEC int SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, SDL_bool freesrc,
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_free
|
||||
* \sa SDL_LoadWAV_RW
|
||||
* \sa SDL_LoadWAV_IO
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LoadWAV(const char *path, SDL_AudioSpec * spec,
|
||||
Uint8 ** audio_buf, Uint32 * audio_len);
|
||||
@ -1458,8 +1418,6 @@ extern DECLSPEC int SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateAudioStream
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec,
|
||||
const Uint8 *src_data,
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
/* Some compilers use a special export keyword */
|
||||
#ifndef DECLSPEC
|
||||
# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
|
||||
# if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_CYGWIN) || defined(SDL_PLATFORM_GDK)
|
||||
# ifdef DLL_EXPORT
|
||||
# define DECLSPEC __declspec(dllexport)
|
||||
# else
|
||||
@ -70,7 +70,7 @@
|
||||
|
||||
/* By default SDL uses the C calling convention */
|
||||
#ifndef SDLCALL
|
||||
#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
|
||||
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK)) && !defined(__GNUC__)
|
||||
#define SDLCALL __cdecl
|
||||
#else
|
||||
#define SDLCALL
|
||||
|
@ -65,8 +65,8 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */
|
||||
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */
|
||||
} SDL_BlendOperation;
|
||||
|
478
include/SDL3/SDL_camera.h
Normal file
478
include/SDL3/SDL_camera.h
Normal file
@ -0,0 +1,478 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_camera.h
|
||||
*
|
||||
* Video Capture for the SDL library.
|
||||
*/
|
||||
|
||||
#ifndef SDL_camera_h_
|
||||
#define SDL_camera_h_
|
||||
|
||||
#include <SDL3/SDL_video.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is a unique ID for a camera device for the time it is connected to the system,
|
||||
* and is never reused for the lifetime of the application. If the device is
|
||||
* disconnected and reconnected, it will get a new ID.
|
||||
*
|
||||
* The ID value starts at 1 and increments from there. The value 0 is an invalid ID.
|
||||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
*/
|
||||
typedef Uint32 SDL_CameraDeviceID;
|
||||
|
||||
|
||||
/**
|
||||
* The structure used to identify an opened SDL camera
|
||||
*/
|
||||
struct SDL_Camera;
|
||||
typedef struct SDL_Camera SDL_Camera;
|
||||
|
||||
/**
|
||||
* SDL_CameraSpec structure
|
||||
*
|
||||
* \sa SDL_GetCameraDeviceSupportedFormats
|
||||
* \sa SDL_GetCameraFormat
|
||||
*
|
||||
*/
|
||||
typedef struct SDL_CameraSpec
|
||||
{
|
||||
SDL_PixelFormatEnum format; /**< Frame format */
|
||||
int width; /**< Frame width */
|
||||
int height; /**< Frame height */
|
||||
int interval_numerator; /**< Frame rate numerator ((dom / num) == fps, (num / dom) == duration) */
|
||||
int interval_denominator; /**< Frame rate demoninator ((dom / num) == fps, (num / dom) == duration) */
|
||||
} SDL_CameraSpec;
|
||||
|
||||
/**
|
||||
* The position of camera in relation to system device.
|
||||
*
|
||||
* \sa SDL_GetCameraDevicePosition
|
||||
*/
|
||||
typedef enum SDL_CameraPosition
|
||||
{
|
||||
SDL_CAMERA_POSITION_UNKNOWN,
|
||||
SDL_CAMERA_POSITION_FRONT_FACING,
|
||||
SDL_CAMERA_POSITION_BACK_FACING
|
||||
} SDL_CameraPosition;
|
||||
|
||||
|
||||
/**
|
||||
* Use this function to get the number of built-in camera drivers.
|
||||
*
|
||||
* This function returns a hardcoded number. This never returns a negative
|
||||
* value; if there are no drivers compiled into this build of SDL, this
|
||||
* function returns zero. The presence of a driver in this list does not mean
|
||||
* it will function, it just means SDL is capable of interacting with that
|
||||
* interface. For example, a build of SDL might have v4l2 support, but if
|
||||
* there's no kernel support available, SDL's v4l2 driver would fail if used.
|
||||
*
|
||||
* By default, SDL tries all drivers, in its preferred order, until one is
|
||||
* found to be usable.
|
||||
*
|
||||
* \returns the number of built-in camera drivers.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetCameraDriver
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void);
|
||||
|
||||
/**
|
||||
* Use this function to get the name of a built in camera driver.
|
||||
*
|
||||
* The list of camera drivers is given in the order that they are normally
|
||||
* initialized by default; the drivers that seem more reasonable to choose
|
||||
* first (as far as the SDL developers believe) are earlier in the list.
|
||||
*
|
||||
* The names of drivers are all simple, low-ASCII identifiers, like "v4l2",
|
||||
* "coremedia" or "android". These never have Unicode characters, and are not
|
||||
* meant to be proper names.
|
||||
*
|
||||
* \param index the index of the camera driver; the value ranges from 0 to
|
||||
* SDL_GetNumCameraDrivers() - 1
|
||||
* \returns the name of the camera driver at the requested index, or NULL if
|
||||
* an invalid index was specified.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumCameraDrivers
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index);
|
||||
|
||||
/**
|
||||
* Get the name of the current camera driver.
|
||||
*
|
||||
* The returned string points to internal static memory and thus never becomes
|
||||
* invalid, even if you quit the camera subsystem and initialize a new driver
|
||||
* (although such a case would return a different static string from another
|
||||
* call to this function, of course). As such, you should not modify or free
|
||||
* the returned string.
|
||||
*
|
||||
* \returns the name of the current camera driver or NULL if no driver has
|
||||
* been initialized.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected camera devices.
|
||||
*
|
||||
* \param count a pointer filled in with the number of camera devices. Can be
|
||||
* NULL.
|
||||
* \returns a 0 terminated array of camera instance IDs which should be freed
|
||||
* with SDL_free(), or NULL on error; call SDL_GetError() for more
|
||||
* details.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count);
|
||||
|
||||
/**
|
||||
* Get the list of native formats/sizes a camera supports.
|
||||
*
|
||||
* This returns a list of all formats and frame sizes that a specific camera
|
||||
* can offer. This is useful if your app can accept a variety of image formats
|
||||
* and sizes and so want to find the optimal spec that doesn't require
|
||||
* conversion.
|
||||
*
|
||||
* This function isn't strictly required; if you call SDL_OpenCameraDevice
|
||||
* with a NULL spec, SDL will choose a native format for you, and if you
|
||||
* instead specify a desired format, it will transparently convert to the
|
||||
* requested format on your behalf.
|
||||
*
|
||||
* If `count` is not NULL, it will be filled with the number of elements in
|
||||
* the returned array. Additionally, the last element of the array has all
|
||||
* fields set to zero (this element is not included in `count`).
|
||||
*
|
||||
* The returned list is owned by the caller, and should be released with
|
||||
* SDL_free() when no longer needed.
|
||||
*
|
||||
* Note that it's legal for a camera to supply a list with only the zeroed
|
||||
* final element and `*count` set to zero; this is what will happen on
|
||||
* Emscripten builds, since that platform won't tell _anything_ about
|
||||
* available cameras until you've opened one, and won't even tell if there
|
||||
* _is_ a camera until the user has given you permission to check through a
|
||||
* scary warning popup.
|
||||
*
|
||||
* \param devid the camera device instance ID to query.
|
||||
* \param count a pointer filled in with the number of elements in the list.
|
||||
* Can be NULL.
|
||||
* \returns a 0 terminated array of SDL_CameraSpecs, which should be freed
|
||||
* with SDL_free(), or NULL on error; call SDL_GetError() for more
|
||||
* details.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
* \sa SDL_OpenCameraDevice
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID devid, int *count);
|
||||
|
||||
/**
|
||||
* Get human-readable device name for a camera.
|
||||
*
|
||||
* The returned string is owned by the caller; please release it with
|
||||
* SDL_free() when done with it.
|
||||
*
|
||||
* \param instance_id the camera device instance ID
|
||||
* \returns Human-readable device name, or NULL on error; call SDL_GetError()
|
||||
* for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id);
|
||||
|
||||
/**
|
||||
* Get the position of the camera in relation to the system.
|
||||
*
|
||||
* Most platforms will report UNKNOWN, but mobile devices, like phones, can
|
||||
* often make a distiction between cameras on the front of the device (that
|
||||
* points towards the user, for taking "selfies") and cameras on the back (for
|
||||
* filming in the direction the user is facing).
|
||||
*
|
||||
* \param instance_id the camera device instance ID
|
||||
* \returns The position of the camera on the system hardware.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraDevicePosition(SDL_CameraDeviceID instance_id);
|
||||
|
||||
/**
|
||||
* Open a video capture device (a "camera").
|
||||
*
|
||||
* You can open the device with any reasonable spec, and if the hardware can't
|
||||
* directly support it, it will convert data seamlessly to the requested
|
||||
* format. This might incur overhead, including scaling of image data.
|
||||
*
|
||||
* If you would rather accept whatever format the device offers, you can pass
|
||||
* a NULL spec here and it will choose one for you (and you can use
|
||||
* SDL_Surface's conversion/scaling functions directly if necessary).
|
||||
*
|
||||
* You can call SDL_GetCameraFormat() to get the actual data format if passing
|
||||
* a NULL spec here. You can see the exact specs a device can support without
|
||||
* conversion with SDL_GetCameraSupportedSpecs().
|
||||
*
|
||||
* SDL will not attempt to emulate framerate; it will try to set the hardware
|
||||
* to the rate closest to the requested speed, but it won't attempt to limit
|
||||
* or duplicate frames artificially; call SDL_GetCameraFormat() to see the
|
||||
* actual framerate of the opened the device, and check your timestamps if
|
||||
* this is crucial to your app!
|
||||
*
|
||||
* Note that the camera is not usable until the user approves its use! On some
|
||||
* platforms, the operating system will prompt the user to permit access to
|
||||
* the camera, and they can choose Yes or No at that point. Until they do, the
|
||||
* camera will not be usable. The app should either wait for an
|
||||
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event,
|
||||
* or poll SDL_IsCameraApproved() occasionally until it returns non-zero. On
|
||||
* platforms that don't require explicit user approval (and perhaps in places
|
||||
* where the user previously permitted access), the approval event might come
|
||||
* immediately, but it might come seconds, minutes, or hours later!
|
||||
*
|
||||
* \param instance_id the camera device instance ID
|
||||
* \param spec The desired format for data the device will provide. Can be
|
||||
* NULL.
|
||||
* \returns device, or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetCameraDevices
|
||||
* \sa SDL_GetCameraFormat
|
||||
*/
|
||||
extern DECLSPEC SDL_Camera *SDLCALL SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_CameraSpec *spec);
|
||||
|
||||
/**
|
||||
* Query if camera access has been approved by the user.
|
||||
*
|
||||
* Cameras will not function between when the device is opened by the app and
|
||||
* when the user permits access to the hardware. On some platforms, this
|
||||
* presents as a popup dialog where the user has to explicitly approve access;
|
||||
* on others the approval might be implicit and not alert the user at all.
|
||||
*
|
||||
* This function can be used to check the status of that approval. It will
|
||||
* return 0 if still waiting for user response, 1 if the camera is approved
|
||||
* for use, and -1 if the user denied access.
|
||||
*
|
||||
* Instead of polling with this function, you can wait for a
|
||||
* SDL_EVENT_CAMERA_DEVICE_APPROVED (or SDL_EVENT_CAMERA_DEVICE_DENIED) event
|
||||
* in the standard SDL event loop, which is guaranteed to be sent once when
|
||||
* permission to use the camera is decided.
|
||||
*
|
||||
* If a camera is declined, there's nothing to be done but call
|
||||
* SDL_CloseCamera() to dispose of it.
|
||||
*
|
||||
* \param camera the opened camera device to query
|
||||
* \returns -1 if user denied access to the camera, 1 if user approved access,
|
||||
* 0 if no decision has been made yet.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenCameraDevice
|
||||
* \sa SDL_CloseCamera
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera);
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened camera.
|
||||
*
|
||||
* \param camera an SDL_Camera to query
|
||||
* \returns the instance ID of the specified camera on success or 0 on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenCameraDevice
|
||||
*/
|
||||
extern DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camera *camera);
|
||||
|
||||
/**
|
||||
* Get the properties associated with an opened camera.
|
||||
*
|
||||
* \param camera the SDL_Camera obtained from SDL_OpenCameraDevice()
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera);
|
||||
|
||||
/**
|
||||
* Get the spec that a camera is using when generating images.
|
||||
*
|
||||
* Note that this might not be the native format of the hardware, as SDL might
|
||||
* be converting to this format behind the scenes.
|
||||
*
|
||||
* If the system is waiting for the user to approve access to the camera, as
|
||||
* some platforms require, this will return -1, but this isn't necessarily a
|
||||
* fatal error; you should either wait for an SDL_EVENT_CAMERA_DEVICE_APPROVED
|
||||
* (or SDL_EVENT_CAMERA_DEVICE_DENIED) event, or poll SDL_IsCameraApproved()
|
||||
* occasionally until it returns non-zero.
|
||||
*
|
||||
* \param camera opened camera device
|
||||
* \param spec The SDL_CameraSpec to be initialized by this function.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenCameraDevice
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec);
|
||||
|
||||
/**
|
||||
* Acquire a frame.
|
||||
*
|
||||
* The frame is a memory pointer to the image data, whose size and format are
|
||||
* given by the spec requested when opening the device.
|
||||
*
|
||||
* This is a non blocking API. If there is a frame available, a non-NULL
|
||||
* surface is returned, and timestampNS will be filled with a non-zero value.
|
||||
*
|
||||
* Note that an error case can also return NULL, but a NULL by itself is
|
||||
* normal and just signifies that a new frame is not yet available. Note that
|
||||
* even if a camera device fails outright (a USB camera is unplugged while in
|
||||
* use, etc), SDL will send an event separately to notify the app, but
|
||||
* continue to provide blank frames at ongoing intervals until
|
||||
* SDL_CloseCamera() is called, so real failure here is almost always an out
|
||||
* of memory condition.
|
||||
*
|
||||
* After use, the frame should be released with SDL_ReleaseCameraFrame(). If
|
||||
* you don't do this, the system may stop providing more video!
|
||||
*
|
||||
* Do not call SDL_FreeSurface() on the returned surface! It must be given
|
||||
* back to the camera subsystem with SDL_ReleaseCameraFrame!
|
||||
*
|
||||
* If the system is waiting for the user to approve access to the camera, as
|
||||
* some platforms require, this will return NULL (no frames available); you
|
||||
* should either wait for an SDL_EVENT_CAMERA_DEVICE_APPROVED (or
|
||||
* SDL_EVENT_CAMERA_DEVICE_DENIED) event, or poll SDL_IsCameraApproved()
|
||||
* occasionally until it returns non-zero.
|
||||
*
|
||||
* \param camera opened camera device
|
||||
* \param timestampNS a pointer filled in with the frame's timestamp, or 0 on
|
||||
* error. Can be NULL.
|
||||
* \returns A new frame of video on success, NULL if none is currently
|
||||
* available.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReleaseCameraFrame
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface * SDLCALL SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS);
|
||||
|
||||
/**
|
||||
* Release a frame of video acquired from a camera.
|
||||
*
|
||||
* Let the back-end re-use the internal buffer for camera.
|
||||
*
|
||||
* This function _must_ be called only on surface objects returned by
|
||||
* SDL_AcquireCameraFrame(). This function should be called as quickly as
|
||||
* possible after acquisition, as SDL keeps a small FIFO queue of surfaces for
|
||||
* video frames; if surfaces aren't released in a timely manner, SDL may drop
|
||||
* upcoming video frames from the camera.
|
||||
*
|
||||
* If the app needs to keep the surface for a significant time, they should
|
||||
* make a copy of it and release the original.
|
||||
*
|
||||
* The app should not use the surface again after calling this function;
|
||||
* assume the surface is freed and the pointer is invalid.
|
||||
*
|
||||
* \param camera opened camera device
|
||||
* \param frame The video frame surface to release.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AcquireCameraFrame
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame);
|
||||
|
||||
/**
|
||||
* Use this function to shut down camera processing and close the camera
|
||||
* device.
|
||||
*
|
||||
* \param camera opened camera device
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread, but no
|
||||
* thread may reference `device` once this function is called.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenCameraWithSpec
|
||||
* \sa SDL_OpenCamera
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseCamera(SDL_Camera *camera);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif /* SDL_camera_h_ */
|
@ -187,8 +187,7 @@ typedef void (SDLCALL *SDL_ClipboardCleanupCallback)(void *userdata);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ClipboardDataCallback
|
||||
* \sa SDL_SetClipboardData
|
||||
* \sa SDL_ClearClipboardData
|
||||
* \sa SDL_GetClipboardData
|
||||
* \sa SDL_HasClipboardData
|
||||
*/
|
||||
|
@ -75,16 +75,6 @@ extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
|
||||
* \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
|
||||
@ -96,16 +86,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
|
||||
* \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
|
||||
@ -118,11 +98,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
@ -139,11 +114,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
@ -160,11 +130,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE41
|
||||
@ -181,11 +146,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
@ -202,11 +162,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
@ -223,15 +178,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||
|
||||
@ -244,15 +192,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX512F
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||
|
||||
@ -265,15 +206,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasAltiVec
|
||||
* \sa SDL_HasAVX
|
||||
* \sa SDL_HasAVX2
|
||||
* \sa SDL_HasMMX
|
||||
* \sa SDL_HasSSE
|
||||
* \sa SDL_HasSSE2
|
||||
* \sa SDL_HasSSE3
|
||||
* \sa SDL_HasSSE41
|
||||
* \sa SDL_HasSSE42
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
|
||||
|
||||
|
213
include/SDL3/SDL_dialog.h
Normal file
213
include/SDL3/SDL_dialog.h
Normal file
@ -0,0 +1,213 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef SDL_dialog_h_
|
||||
#define SDL_dialog_h_
|
||||
|
||||
#include <SDL3/SDL_video.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* An entry for filters for file dialogs.
|
||||
*
|
||||
* `name` is a user-readable label for the filter (for example, "Office document").
|
||||
*
|
||||
* `pattern` is a semicolon-separated list of file extensions (for example,
|
||||
* "doc;docx").
|
||||
*
|
||||
* \sa SDL_DialogFileCallback
|
||||
* \sa SDL_ShowOpenFileDialog
|
||||
* \sa SDL_ShowSaveFileDialog
|
||||
* \sa SDL_ShowOpenFolderDialog
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
const char *name;
|
||||
const char *pattern;
|
||||
} SDL_DialogFileFilter;
|
||||
|
||||
/**
|
||||
* Callback used by file dialog functions.
|
||||
*
|
||||
* The specific usage is described in each function.
|
||||
*
|
||||
* If filelist is...
|
||||
* - `NULL`, an error occured. Details can be obtained with SDL_GetError().
|
||||
* - A pointer to `NULL`, the user either didn't choose any file or canceled
|
||||
* the dialog.
|
||||
* - A pointer to non-`NULL`, the user chose one or more files. The argument is
|
||||
* a null-terminated list of pointers to C strings, each containing a path.
|
||||
*
|
||||
* The filelist argument does not need to be freed; it will automatically be
|
||||
* freed when the callback returns.
|
||||
*
|
||||
* The filter argument is the index of the filter that was selected, or one
|
||||
* more than the size of the list (therefore the index of the terminating NULL
|
||||
* entry) if no filter was selected, or -1 if the platform or method doesn't
|
||||
* support fetching the selected filter or if an error occured.
|
||||
*
|
||||
* \sa SDL_DialogFileFilter
|
||||
* \sa SDL_ShowOpenFileDialog
|
||||
* \sa SDL_ShowSaveFileDialog
|
||||
* \sa SDL_ShowOpenFolderDialog
|
||||
*/
|
||||
typedef void(SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * const *filelist, int filter);
|
||||
|
||||
/**
|
||||
* Displays a dialog that lets the user select a file on their filesystem.
|
||||
*
|
||||
* This function should only be invoked from the main thread.
|
||||
*
|
||||
* This is an asynchronous function; it will return immediately, and the
|
||||
* result will be passed to the callback.
|
||||
*
|
||||
* The callback will be invoked with a null-terminated list of files the user
|
||||
* chose. The list will be empty if the user canceled the dialog, and it will
|
||||
* be NULL if an error occured.
|
||||
*
|
||||
* Note that the callback may be called from a different thread than the one
|
||||
* the function was invoked on.
|
||||
*
|
||||
* Depending on the platform, the user may be allowed to input paths that
|
||||
* don't yet exist.
|
||||
*
|
||||
* \param callback The function to be invoked when the user selects a file and
|
||||
* accepts, or the user cancels the dialog, or an error
|
||||
* occurs. The first argument is a null-terminated list of C
|
||||
* strings, representing the paths chosen by the user. The
|
||||
* list will be empty if the user canceled the dialog, and it
|
||||
* will be NULL if an error occured. If an error occured, it
|
||||
* can be fetched with SDL_GetError(). The second argument is
|
||||
* the userdata pointer passed to the function.
|
||||
* \param userdata An optional pointer to pass extra data to the callback when
|
||||
* it will be invoked.
|
||||
* \param window The window that the dialog should be modal for. May be NULL.
|
||||
* Not all platforms support this option.
|
||||
* \param filters A null-terminated list of SDL_DialogFileFilter's. May be
|
||||
* NULL. Not all platforms support this option, and platforms
|
||||
* that do support it may allow the user to ignore the filters.
|
||||
* \param default_location The default folder or file to start the dialog at.
|
||||
* May be NULL. Not all platforms support this option.
|
||||
* \param allow_many If non-zero, the user will be allowed to select multiple
|
||||
* entries. Not all platforms support this option.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* Displays a dialog that lets the user choose a new or existing file on their
|
||||
* filesystem.
|
||||
*
|
||||
* This function should only be invoked from the main thread.
|
||||
*
|
||||
* This is an asynchronous function; it will return immediately, and the
|
||||
* result will be passed to the callback.
|
||||
*
|
||||
* The callback will be invoked with a null-terminated list of files the user
|
||||
* chose. The list will be empty if the user canceled the dialog, and it will
|
||||
* be NULL if an error occured.
|
||||
*
|
||||
* Note that the callback may be called from a different thread than the one
|
||||
* the function was invoked on.
|
||||
*
|
||||
* The chosen file may or may not already exist.
|
||||
*
|
||||
* \param callback The function to be invoked when the user selects a file and
|
||||
* accepts, or the user cancels the dialog, or an error
|
||||
* occurs. The first argument is a null-terminated list of C
|
||||
* strings, representing the paths chosen by the user. The
|
||||
* list will be empty if the user canceled the dialog, and it
|
||||
* will be NULL if an error occured. If an error occured, it
|
||||
* can be fetched with SDL_GetError(). The second argument is
|
||||
* the userdata pointer passed to the function.
|
||||
* \param userdata An optional pointer to pass extra data to the callback when
|
||||
* it will be invoked.
|
||||
* \param window The window that the dialog should be modal for. May be NULL.
|
||||
* Not all platforms support this option.
|
||||
* \param filters A null-terminated list of SDL_DialogFileFilter's. May be
|
||||
* NULL. Not all platforms support this option, and platforms
|
||||
* that do support it may allow the user to ignore the filters.
|
||||
* \param default_location The default folder or file to start the dialog at.
|
||||
* May be NULL. Not all platforms support this option.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ShowOpenFileDialog
|
||||
*/
|
||||
extern 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.
|
||||
*
|
||||
* This function should only be invoked from the main thread.
|
||||
*
|
||||
* This is an asynchronous function; it will return immediately, and the
|
||||
* result will be passed to the callback.
|
||||
*
|
||||
* The callback will be invoked with a null-terminated list of files the user
|
||||
* chose. The list will be empty if the user canceled the dialog, and it will
|
||||
* be NULL if an error occured.
|
||||
*
|
||||
* Note that the callback may be called from a different thread than the one
|
||||
* the function was invoked on.
|
||||
*
|
||||
* Depending on the platform, the user may be allowed to input paths that
|
||||
* don't yet exist.
|
||||
*
|
||||
* \param callback The function to be invoked when the user selects a folder
|
||||
* and accepts, or the user cancels the dialog, or an error
|
||||
* occurs. The first argument is a null-terminated list of C
|
||||
* strings, representing the paths chosen by the user. The
|
||||
* list will be empty if the user canceled the dialog, and it
|
||||
* will be NULL if an error occured. If an error occured, it
|
||||
* can be fetched with SDL_GetError(). The second argument is
|
||||
* the userdata pointer passed to the function.
|
||||
* \param userdata An optional pointer to pass extra data to the callback when
|
||||
* it will be invoked.
|
||||
* \param window The window that the dialog should be modal for. May be NULL.
|
||||
* Not all platforms support this option.
|
||||
* \param default_location The default folder or file to start the dialog at.
|
||||
* May be NULL. Not all platforms support this option.
|
||||
* \param allow_many If non-zero, the user will be allowed to select multiple
|
||||
* entries. Not all platforms support this option.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ShowOpenFileDialog
|
||||
*/
|
||||
extern 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
|
||||
}
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif /* SDL_joystick_h_ */
|
@ -25,9 +25,11 @@
|
||||
* This is a simple file to encapsulate the EGL API headers.
|
||||
*/
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
|
||||
#if defined(__vita__) || defined(__psp2__)
|
||||
#if !defined(_MSC_VER) && !defined(SDL_PLATFORM_ANDROID) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
|
||||
#if defined(SDL_PLATFORM_VITA)
|
||||
#include <psp2/display.h>
|
||||
#include <psp2/gxm.h>
|
||||
#include <psp2/types.h>
|
||||
@ -419,7 +421,7 @@ typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
#elif defined(SDL_PLATFORM_EMSCRIPTEN)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef int EGLNativePixmapType;
|
||||
|
@ -56,13 +56,13 @@ _m_prefetch(void *__P)
|
||||
/* @} */
|
||||
|
||||
#ifndef SDL_BYTEORDER
|
||||
#ifdef __linux__
|
||||
#ifdef SDL_PLATFORM_LINUX
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#elif defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
#elif defined(SDL_PLATFORM_OPENBSD) || defined(__DragonFly__)
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
#elif defined(SDL_PLATFORM_FREEBSD) || defined(SDL_PLATFORM_NETBSD)
|
||||
#include <sys/endian.h>
|
||||
#define SDL_BYTEORDER BYTE_ORDER
|
||||
/* predefs from newer gcc and clang versions: */
|
||||
@ -84,7 +84,7 @@ _m_prefetch(void *__P)
|
||||
#else
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||
#endif
|
||||
#endif /* __linux__ */
|
||||
#endif /* SDL_PLATFORM_LINUX */
|
||||
#endif /* !SDL_BYTEORDER */
|
||||
|
||||
#ifndef SDL_FLOATWORDORDER
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_touch.h>
|
||||
#include <SDL3/SDL_video.h>
|
||||
#include <SDL3/SDL_camera.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
@ -97,8 +98,9 @@ typedef enum
|
||||
SDL_EVENT_DISPLAY_REMOVED, /**< Display has been removed from the system */
|
||||
SDL_EVENT_DISPLAY_MOVED, /**< Display has changed position */
|
||||
SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, /**< Display has changed content scale */
|
||||
SDL_EVENT_DISPLAY_HDR_STATE_CHANGED, /**< Display HDR properties have changed */
|
||||
SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION,
|
||||
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
|
||||
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_HDR_STATE_CHANGED,
|
||||
|
||||
/* Window events */
|
||||
/* 0x200 was SDL_WINDOWEVENT, reserve the number for sdl2-compat */
|
||||
@ -141,20 +143,25 @@ typedef enum
|
||||
SDL_EVENT_TEXT_INPUT, /**< Keyboard text input */
|
||||
SDL_EVENT_KEYMAP_CHANGED, /**< Keymap changed due to a system event such as an
|
||||
input language or keyboard layout change. */
|
||||
SDL_EVENT_KEYBOARD_ADDED, /**< A new keyboard has been inserted into the system */
|
||||
SDL_EVENT_KEYBOARD_REMOVED, /**< A keyboard has been removed */
|
||||
|
||||
/* Mouse events */
|
||||
SDL_EVENT_MOUSE_MOTION = 0x400, /**< Mouse moved */
|
||||
SDL_EVENT_MOUSE_BUTTON_DOWN, /**< Mouse button pressed */
|
||||
SDL_EVENT_MOUSE_BUTTON_UP, /**< Mouse button released */
|
||||
SDL_EVENT_MOUSE_WHEEL, /**< Mouse wheel motion */
|
||||
SDL_EVENT_MOUSE_ADDED, /**< A new mouse has been inserted into the system */
|
||||
SDL_EVENT_MOUSE_REMOVED, /**< A mouse has been removed */
|
||||
|
||||
/* Joystick events */
|
||||
SDL_EVENT_JOYSTICK_AXIS_MOTION = 0x600, /**< Joystick axis motion */
|
||||
SDL_EVENT_JOYSTICK_HAT_MOTION = 0x602, /**< Joystick hat position change */
|
||||
SDL_EVENT_JOYSTICK_BALL_MOTION, /**< Joystick trackball motion */
|
||||
SDL_EVENT_JOYSTICK_HAT_MOTION, /**< Joystick hat position change */
|
||||
SDL_EVENT_JOYSTICK_BUTTON_DOWN, /**< Joystick button pressed */
|
||||
SDL_EVENT_JOYSTICK_BUTTON_UP, /**< Joystick button released */
|
||||
SDL_EVENT_JOYSTICK_ADDED, /**< A new joystick has been inserted into the system */
|
||||
SDL_EVENT_JOYSTICK_REMOVED, /**< An opened joystick has been removed */
|
||||
SDL_EVENT_JOYSTICK_ADDED, /**< A new joystick has been inserted into the system */
|
||||
SDL_EVENT_JOYSTICK_REMOVED, /**< An opened joystick has been removed */
|
||||
SDL_EVENT_JOYSTICK_BATTERY_UPDATED, /**< Joystick battery level change */
|
||||
SDL_EVENT_JOYSTICK_UPDATE_COMPLETE, /**< Joystick update is complete */
|
||||
|
||||
@ -204,6 +211,12 @@ typedef enum
|
||||
SDL_EVENT_PEN_BUTTON_DOWN, /**< Pressure-sensitive pen button pressed */
|
||||
SDL_EVENT_PEN_BUTTON_UP, /**< Pressure-sensitive pen button released */
|
||||
|
||||
/* Camera hotplug events */
|
||||
SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400, /**< A new camera device is available */
|
||||
SDL_EVENT_CAMERA_DEVICE_REMOVED, /**< A camera device has been removed. */
|
||||
SDL_EVENT_CAMERA_DEVICE_APPROVED, /**< A camera device has been approved for use by the user. */
|
||||
SDL_EVENT_CAMERA_DEVICE_DENIED, /**< A camera device has been denied for use by the user. */
|
||||
|
||||
/* Render events */
|
||||
SDL_EVENT_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
|
||||
SDL_EVENT_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
|
||||
@ -219,7 +232,11 @@ typedef enum
|
||||
/**
|
||||
* This last event is only for bounding internal arrays
|
||||
*/
|
||||
SDL_EVENT_LAST = 0xFFFF
|
||||
SDL_EVENT_LAST = 0xFFFF,
|
||||
|
||||
/* This just makes sure the enum is the size of Uint32 */
|
||||
SDL_EVENT_ENUM_PADDING = 0x7FFFFFFF
|
||||
|
||||
} SDL_EventType;
|
||||
|
||||
/**
|
||||
@ -227,7 +244,8 @@ typedef enum
|
||||
*/
|
||||
typedef struct SDL_CommonEvent
|
||||
{
|
||||
Uint32 type;
|
||||
Uint32 type; /**< Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
} SDL_CommonEvent;
|
||||
|
||||
@ -236,7 +254,8 @@ typedef struct SDL_CommonEvent
|
||||
*/
|
||||
typedef struct SDL_DisplayEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_DISPLAYEVENT_* */
|
||||
SDL_EventType type; /**< ::SDL_DISPLAYEVENT_* */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_DisplayID displayID;/**< The associated display */
|
||||
Sint32 data1; /**< event dependent data */
|
||||
@ -247,21 +266,35 @@ typedef struct SDL_DisplayEvent
|
||||
*/
|
||||
typedef struct SDL_WindowEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_WINDOWEVENT_* */
|
||||
SDL_EventType type; /**< ::SDL_WINDOWEVENT_* */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_WindowID windowID; /**< The associated window */
|
||||
Sint32 data1; /**< event dependent data */
|
||||
Sint32 data2; /**< event dependent data */
|
||||
} SDL_WindowEvent;
|
||||
|
||||
/**
|
||||
* Keyboard device event structure (event.kdevice.*)
|
||||
*/
|
||||
typedef struct SDL_KeyboardDeviceEvent
|
||||
{
|
||||
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 */
|
||||
} SDL_KeyboardDeviceEvent;
|
||||
|
||||
/**
|
||||
* Keyboard button event structure (event.key.*)
|
||||
*/
|
||||
typedef struct SDL_KeyboardEvent
|
||||
{
|
||||
Uint32 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 repeat; /**< Non-zero if this is a key repeat */
|
||||
Uint8 padding2;
|
||||
@ -278,7 +311,8 @@ typedef struct SDL_KeyboardEvent
|
||||
*/
|
||||
typedef struct SDL_TextEditingEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
char *text; /**< The editing text */
|
||||
@ -286,7 +320,6 @@ typedef struct SDL_TextEditingEvent
|
||||
Sint32 length; /**< The length of selected editing text */
|
||||
} SDL_TextEditingEvent;
|
||||
|
||||
#define SDL_TEXTINPUTEVENT_TEXT_SIZE 64
|
||||
/**
|
||||
* Keyboard text input event structure (event.text.*)
|
||||
*
|
||||
@ -295,18 +328,31 @@ typedef struct SDL_TextEditingEvent
|
||||
*/
|
||||
typedef struct SDL_TextInputEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
char *text; /**< The input text */
|
||||
} SDL_TextInputEvent;
|
||||
|
||||
/**
|
||||
* Mouse device event structure (event.mdevice.*)
|
||||
*/
|
||||
typedef struct SDL_MouseDeviceEvent
|
||||
{
|
||||
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 */
|
||||
} SDL_MouseDeviceEvent;
|
||||
|
||||
/**
|
||||
* Mouse motion event structure (event.motion.*)
|
||||
*/
|
||||
typedef struct SDL_MouseMotionEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */
|
||||
@ -322,7 +368,8 @@ typedef struct SDL_MouseMotionEvent
|
||||
*/
|
||||
typedef struct SDL_MouseButtonEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
@ -339,15 +386,16 @@ typedef struct SDL_MouseButtonEvent
|
||||
*/
|
||||
typedef struct SDL_MouseWheelEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
SDL_MouseID which; /**< The mouse instance id, SDL_TOUCH_MOUSEID, or SDL_PEN_MOUSEID */
|
||||
float x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
|
||||
float y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
|
||||
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
||||
float mouseX; /**< X coordinate, relative to window */
|
||||
float mouseY; /**< Y coordinate, relative to window */
|
||||
SDL_MouseWheelDirection direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
||||
float mouse_x; /**< X coordinate, relative to window */
|
||||
float mouse_y; /**< Y coordinate, relative to window */
|
||||
} SDL_MouseWheelEvent;
|
||||
|
||||
/**
|
||||
@ -355,7 +403,8 @@ typedef struct SDL_MouseWheelEvent
|
||||
*/
|
||||
typedef struct SDL_JoyAxisEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
Uint8 axis; /**< The joystick axis index */
|
||||
@ -366,12 +415,30 @@ typedef struct SDL_JoyAxisEvent
|
||||
Uint16 padding4;
|
||||
} SDL_JoyAxisEvent;
|
||||
|
||||
/**
|
||||
* \brief Joystick trackball motion event structure (event.jball.*)
|
||||
*/
|
||||
typedef struct SDL_JoyBallEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_JOYBALLMOTION */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_JoystickID which; /**< The joystick instance id */
|
||||
Uint8 ball; /**< The joystick trackball index */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
Sint16 xrel; /**< The relative motion in the X direction */
|
||||
Sint16 yrel; /**< The relative motion in the Y direction */
|
||||
} SDL_JoyBallEvent;
|
||||
|
||||
/**
|
||||
* Joystick hat position change event structure (event.jhat.*)
|
||||
*/
|
||||
typedef struct SDL_JoyHatEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
@ -391,7 +458,8 @@ typedef struct SDL_JoyHatEvent
|
||||
*/
|
||||
typedef struct SDL_JoyButtonEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
@ -405,7 +473,8 @@ typedef struct SDL_JoyButtonEvent
|
||||
*/
|
||||
typedef struct SDL_JoyDeviceEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
} SDL_JoyDeviceEvent;
|
||||
@ -415,7 +484,8 @@ typedef struct SDL_JoyDeviceEvent
|
||||
*/
|
||||
typedef struct SDL_JoyBatteryEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
SDL_JoystickPowerLevel level; /**< The joystick battery level */
|
||||
@ -426,7 +496,8 @@ typedef struct SDL_JoyBatteryEvent
|
||||
*/
|
||||
typedef struct SDL_GamepadAxisEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
Uint8 axis; /**< The gamepad axis (SDL_GamepadAxis) */
|
||||
@ -443,7 +514,8 @@ typedef struct SDL_GamepadAxisEvent
|
||||
*/
|
||||
typedef struct SDL_GamepadButtonEvent
|
||||
{
|
||||
Uint32 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) */
|
||||
@ -458,7 +530,8 @@ typedef struct SDL_GamepadButtonEvent
|
||||
*/
|
||||
typedef struct SDL_GamepadDeviceEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
} SDL_GamepadDeviceEvent;
|
||||
@ -468,7 +541,8 @@ typedef struct SDL_GamepadDeviceEvent
|
||||
*/
|
||||
typedef struct SDL_GamepadTouchpadEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
Sint32 touchpad; /**< The index of the touchpad */
|
||||
@ -483,7 +557,8 @@ typedef struct SDL_GamepadTouchpadEvent
|
||||
*/
|
||||
typedef struct SDL_GamepadSensorEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
@ -496,7 +571,8 @@ typedef struct SDL_GamepadSensorEvent
|
||||
*/
|
||||
typedef struct SDL_AudioDeviceEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
|
||||
@ -505,16 +581,30 @@ typedef struct SDL_AudioDeviceEvent
|
||||
Uint8 padding3;
|
||||
} SDL_AudioDeviceEvent;
|
||||
|
||||
/**
|
||||
* Camera device event structure (event.cdevice.*)
|
||||
*/
|
||||
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 */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_CameraDeviceID which; /**< SDL_CameraDeviceID for the device being added or removed or changing */
|
||||
Uint8 padding1;
|
||||
Uint8 padding2;
|
||||
Uint8 padding3;
|
||||
} SDL_CameraDeviceEvent;
|
||||
|
||||
/**
|
||||
* Touch finger event structure (event.tfinger.*)
|
||||
*/
|
||||
typedef struct SDL_TouchFingerEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
SDL_FingerID fingerId;
|
||||
SDL_TouchID touchID; /**< The touch device id */
|
||||
SDL_FingerID fingerID;
|
||||
float x; /**< Normalized in the range 0...1 */
|
||||
float y; /**< Normalized in the range 0...1 */
|
||||
float dx; /**< Normalized in the range -1...1 */
|
||||
@ -530,17 +620,16 @@ typedef struct SDL_TouchFingerEvent
|
||||
*/
|
||||
typedef struct SDL_PenTipEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_PEN_DOWN or ::SDL_EVENT_PEN_UP */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
Uint32 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. */
|
||||
float x; /**< X coordinate, relative to window */
|
||||
float y; /**< Y coordinate, relative to window */
|
||||
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. */
|
||||
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) */
|
||||
} SDL_PenTipEvent;
|
||||
|
||||
@ -549,17 +638,16 @@ typedef struct SDL_PenTipEvent
|
||||
*/
|
||||
typedef struct SDL_PenMotionEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_PEN_MOTION */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
Uint32 windowID; /**< The window with pen focus, if any */
|
||||
SDL_PenID which; /**< The pen instance id */
|
||||
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. */
|
||||
float x; /**< X coordinate, relative to window */
|
||||
float y; /**< Y coordinate, relative to window */
|
||||
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) */
|
||||
} SDL_PenMotionEvent;
|
||||
|
||||
@ -568,17 +656,16 @@ typedef struct SDL_PenMotionEvent
|
||||
*/
|
||||
typedef struct SDL_PenButtonEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_PEN_BUTTON_DOWN or ::SDL_EVENT_PEN_BUTTON_UP */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
Uint32 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. */
|
||||
float x; /**< X coordinate, relative to window */
|
||||
float y; /**< Y coordinate, relative to window */
|
||||
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. */
|
||||
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) */
|
||||
} SDL_PenButtonEvent;
|
||||
|
||||
@ -590,7 +677,8 @@ typedef struct SDL_PenButtonEvent
|
||||
*/
|
||||
typedef struct SDL_DropEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
float x; /**< X coordinate, relative to window (not on begin) */
|
||||
@ -604,7 +692,8 @@ typedef struct SDL_DropEvent
|
||||
*/
|
||||
typedef struct SDL_ClipboardEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_CLIPBOARD_UPDATE */
|
||||
SDL_EventType type; /**< ::SDL_EVENT_CLIPBOARD_UPDATE */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
} SDL_ClipboardEvent;
|
||||
|
||||
@ -613,7 +702,8 @@ typedef struct SDL_ClipboardEvent
|
||||
*/
|
||||
typedef struct SDL_SensorEvent
|
||||
{
|
||||
Uint32 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 */
|
||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_GetSensorData() */
|
||||
@ -625,7 +715,8 @@ typedef struct SDL_SensorEvent
|
||||
*/
|
||||
typedef struct SDL_QuitEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_QUIT */
|
||||
SDL_EventType type; /**< ::SDL_EVENT_QUIT */
|
||||
Uint32 reserved;
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
} SDL_QuitEvent;
|
||||
|
||||
@ -634,7 +725,8 @@ typedef struct SDL_QuitEvent
|
||||
*/
|
||||
typedef struct SDL_UserEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_USER through ::SDL_EVENT_LAST-1 */
|
||||
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 */
|
||||
Sint32 code; /**< User defined event code */
|
||||
@ -648,27 +740,31 @@ typedef struct SDL_UserEvent
|
||||
*/
|
||||
typedef union SDL_Event
|
||||
{
|
||||
Uint32 type; /**< Event type, shared with all events */
|
||||
Uint32 type; /**< Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration */
|
||||
SDL_CommonEvent common; /**< Common event data */
|
||||
SDL_DisplayEvent display; /**< Display event data */
|
||||
SDL_WindowEvent window; /**< Window event data */
|
||||
SDL_KeyboardDeviceEvent kdevice; /**< Keyboard device change event data */
|
||||
SDL_KeyboardEvent key; /**< Keyboard event data */
|
||||
SDL_TextEditingEvent edit; /**< Text editing event data */
|
||||
SDL_TextInputEvent text; /**< Text input event data */
|
||||
SDL_MouseDeviceEvent mdevice; /**< Mouse device change event data */
|
||||
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
|
||||
SDL_MouseButtonEvent button; /**< Mouse button event data */
|
||||
SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
|
||||
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
|
||||
SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
|
||||
SDL_JoyBallEvent jball; /**< Joystick ball event data */
|
||||
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
|
||||
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
|
||||
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
|
||||
SDL_JoyBatteryEvent jbattery; /**< Joystick battery event data */
|
||||
SDL_GamepadDeviceEvent gdevice; /**< Gamepad device event data */
|
||||
SDL_GamepadAxisEvent gaxis; /**< Gamepad axis event data */
|
||||
SDL_GamepadButtonEvent gbutton; /**< Gamepad button event data */
|
||||
SDL_GamepadDeviceEvent gdevice; /**< Gamepad device event data */
|
||||
SDL_GamepadTouchpadEvent gtouchpad; /**< Gamepad touchpad event data */
|
||||
SDL_GamepadSensorEvent gsensor; /**< Gamepad sensor event data */
|
||||
SDL_AudioDeviceEvent adevice; /**< Audio device event data */
|
||||
SDL_CameraDeviceEvent cdevice; /**< Camera device event data */
|
||||
SDL_SensorEvent sensor; /**< Sensor event data */
|
||||
SDL_QuitEvent quit; /**< Quit request event data */
|
||||
SDL_UserEvent user; /**< Custom event data */
|
||||
@ -823,6 +919,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
|
||||
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
|
||||
* on the main thread immediately before the flush call.
|
||||
*
|
||||
* If you have user events with custom data that needs to be freed, you should
|
||||
* use SDL_PeepEvents() to remove and clean up those events before calling
|
||||
* this function.
|
||||
*
|
||||
* \param type the type of event to be cleared; see SDL_EventType for details
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -1151,15 +1251,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type);
|
||||
* Allocate a set of user-defined events, and return the beginning event
|
||||
* number for that set of events.
|
||||
*
|
||||
* Calling this function with `numevents` <= 0 is an error and will return
|
||||
* (Uint32)-1.
|
||||
*
|
||||
* Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or
|
||||
* 0xFFFFFFFF), but is clearer to write.
|
||||
*
|
||||
* \param numevents the number of events to be allocated
|
||||
* \returns the beginning event number, or (Uint32)-1 if there are not enough
|
||||
* user-defined events left.
|
||||
* \returns the beginning event number, or 0 if numevents is invalid or if
|
||||
* there are not enough user-defined events left.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
|
@ -206,8 +206,8 @@ typedef enum
|
||||
} SDL_Folder;
|
||||
|
||||
/**
|
||||
* Finds the most suitable user folder for @p purpose, and returns its path in
|
||||
* OS-specific notation.
|
||||
* Finds the most suitable user folder for the specified purpose, and returns
|
||||
* its path in OS-specific notation.
|
||||
*
|
||||
* Many OSes provide certain standard folders for certain purposes, such as
|
||||
* storing pictures, music or videos for a certain user. This function gives
|
||||
@ -231,11 +231,92 @@ typedef enum
|
||||
* folder, or NULL if an error happened.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Folder
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetUserFolder(SDL_Folder folder);
|
||||
|
||||
|
||||
/* Abstract filesystem interface */
|
||||
|
||||
typedef enum SDL_PathType
|
||||
{
|
||||
SDL_PATHTYPE_NONE, /**< path does not exist */
|
||||
SDL_PATHTYPE_FILE, /**< a normal file */
|
||||
SDL_PATHTYPE_DIRECTORY, /**< a directory */
|
||||
SDL_PATHTYPE_OTHER /**< something completely different like a device node (not a symlink, those are always followed) */
|
||||
} SDL_PathType;
|
||||
|
||||
typedef struct SDL_PathInfo
|
||||
{
|
||||
SDL_PathType type; /* the path type */
|
||||
Uint64 size; /* the file size in bytes */
|
||||
SDL_Time create_time; /* the time when the path was created */
|
||||
SDL_Time modify_time; /* the last time the path was modified */
|
||||
SDL_Time access_time; /* the last time the path was read */
|
||||
} SDL_PathInfo;
|
||||
|
||||
/**
|
||||
* Create a directory.
|
||||
*
|
||||
* \param path the path of the directory to create
|
||||
* \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_CreateDirectory(const char *path);
|
||||
|
||||
/* Callback for directory enumeration. Return 1 to keep enumerating, 0 to stop enumerating (no error), -1 to stop enumerating and report an error. `dirname` is the directory being enumerated, `fname` is the enumerated entry. */
|
||||
typedef int (SDLCALL *SDL_EnumerateDirectoryCallback)(void *userdata, const char *dirname, const char *fname);
|
||||
|
||||
/**
|
||||
* Enumerate a directory.
|
||||
*
|
||||
* \param path the path of the directory to enumerate
|
||||
* \param callback a function that is called for each entry in the directory
|
||||
* \param userdata a pointer that is passed to `callback`
|
||||
* \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_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata);
|
||||
|
||||
/**
|
||||
* Remove a file or an empty directory.
|
||||
*
|
||||
* \param path the path of the directory to enumerate
|
||||
* \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_RemovePath(const char *path);
|
||||
|
||||
/**
|
||||
* Rename a file or directory.
|
||||
*
|
||||
* \param oldpath the old path
|
||||
* \param newpath the new path
|
||||
* \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_RenamePath(const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path.
|
||||
*
|
||||
* \param path the path to query
|
||||
* \param info a pointer filled in with information about the path, or NULL to
|
||||
* check for the existence of a file
|
||||
* \returns 0 on success or a negative error code if the file doesn't exist,
|
||||
* or another failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_joystick.h>
|
||||
#include <SDL3/SDL_properties.h>
|
||||
#include <SDL3/SDL_rwops.h>
|
||||
#include <SDL3/SDL_iostream.h>
|
||||
#include <SDL3/SDL_sensor.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
@ -113,12 +113,17 @@ typedef enum
|
||||
SDL_GAMEPAD_BUTTON_DPAD_DOWN,
|
||||
SDL_GAMEPAD_BUTTON_DPAD_LEFT,
|
||||
SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
|
||||
SDL_GAMEPAD_BUTTON_MISC1, /* Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button) */
|
||||
SDL_GAMEPAD_BUTTON_MISC1, /* Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button) */
|
||||
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1, /* Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1) */
|
||||
SDL_GAMEPAD_BUTTON_LEFT_PADDLE1, /* Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3) */
|
||||
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2, /* Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2) */
|
||||
SDL_GAMEPAD_BUTTON_LEFT_PADDLE2, /* Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4) */
|
||||
SDL_GAMEPAD_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
||||
SDL_GAMEPAD_BUTTON_MISC2, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC3, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC4, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC5, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MISC6, /* Additional button */
|
||||
SDL_GAMEPAD_BUTTON_MAX
|
||||
} SDL_GamepadButton;
|
||||
|
||||
@ -173,9 +178,9 @@ typedef enum
|
||||
SDL_GAMEPAD_BINDTYPE_HAT
|
||||
} SDL_GamepadBindingType;
|
||||
|
||||
typedef struct
|
||||
typedef struct SDL_GamepadBinding
|
||||
{
|
||||
SDL_GamepadBindingType inputType;
|
||||
SDL_GamepadBindingType input_type;
|
||||
union
|
||||
{
|
||||
int button;
|
||||
@ -195,7 +200,7 @@ typedef struct
|
||||
|
||||
} input;
|
||||
|
||||
SDL_GamepadBindingType outputType;
|
||||
SDL_GamepadBindingType output_type;
|
||||
union
|
||||
{
|
||||
SDL_GamepadButton button;
|
||||
@ -246,7 +251,7 @@ typedef struct
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a seekable SDL data stream.
|
||||
* Load a set of gamepad mappings from an SDL_IOStream.
|
||||
*
|
||||
* You can call this function several times, if needed, to load different
|
||||
* database files.
|
||||
@ -263,7 +268,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
* constrained environment.
|
||||
*
|
||||
* \param src the data stream for the mappings to be added
|
||||
* \param freesrc if SDL_TRUE, calls SDL_RWclose() on `src` before returning,
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error
|
||||
* \returns the number of mappings added or -1 on error; call SDL_GetError()
|
||||
* for more information.
|
||||
@ -272,9 +277,10 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping);
|
||||
*
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_AddGamepadMappingsFromFile
|
||||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_bool freesrc);
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Load a set of gamepad mappings from a file.
|
||||
@ -296,7 +302,8 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromRW(SDL_RWops *src, SDL_boo
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_AddGamepadMappingsFromRW
|
||||
* \sa SDL_AddGamepadMappingsFromIO
|
||||
* \sa SDL_GetGamepadMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
@ -314,7 +321,7 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
extern DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
|
||||
/**
|
||||
* Get the mapping at a particular index.
|
||||
* Get the current gamepad mappings.
|
||||
*
|
||||
* You must free the returned pointer with SDL_free() when you are done with
|
||||
* it, but you do _not_ free each string in the array.
|
||||
@ -358,6 +365,7 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID gui
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AddGamepadMapping
|
||||
* \sa SDL_GetGamepadInstanceMapping
|
||||
* \sa SDL_GetGamepadMappingForGUID
|
||||
* \sa SDL_SetGamepadMapping
|
||||
*/
|
||||
@ -381,6 +389,17 @@ extern DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad);
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping);
|
||||
|
||||
/**
|
||||
* Return whether a gamepad is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a gamepad is connected, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected gamepads.
|
||||
*
|
||||
@ -391,6 +410,7 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadMapping(SDL_JoystickID instance_id, co
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasGamepad
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
@ -404,6 +424,7 @@ extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoysticks
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
@ -420,7 +441,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadName
|
||||
* \sa SDL_OpenGamepad
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID instance_id);
|
||||
|
||||
@ -436,7 +457,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID in
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPath
|
||||
* \sa SDL_OpenGamepad
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID instance_id);
|
||||
|
||||
@ -451,7 +472,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID in
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPlayerIndex
|
||||
* \sa SDL_OpenGamepad
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
|
||||
@ -468,6 +489,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID ins
|
||||
*
|
||||
* \sa SDL_GetGamepadGUID
|
||||
* \sa SDL_GetGamepadGUIDString
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id);
|
||||
|
||||
@ -482,6 +504,9 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_Joystick
|
||||
* index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadVendor
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id);
|
||||
|
||||
@ -496,6 +521,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID insta
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadProduct
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id);
|
||||
|
||||
@ -510,6 +538,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID inst
|
||||
* invalid index, this function returns zero
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadProductVersion
|
||||
* \sa SDL_GetGamepads
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
|
||||
@ -522,6 +553,10 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_Joystick
|
||||
* \returns the gamepad type.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadType
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetRealGamepadInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
@ -534,6 +569,10 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickI
|
||||
* \returns the gamepad type.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceType
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetRealGamepadType
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
@ -547,6 +586,9 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_Joyst
|
||||
* no mapping is available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepads
|
||||
* \sa SDL_GetGamepadMapping
|
||||
*/
|
||||
extern DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id);
|
||||
|
||||
@ -594,6 +636,19 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_in
|
||||
*
|
||||
* These properties are shared with the underlying joystick object.
|
||||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN`: true if this gamepad has an LED
|
||||
* that has adjustable brightness
|
||||
* - `SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN`: true if this gamepad has an LED
|
||||
* that has adjustable color
|
||||
* - `SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN`: true if this gamepad has a
|
||||
* player LED
|
||||
* - `SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN`: true if this gamepad has
|
||||
* left/right rumble
|
||||
* - `SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN`: true if this gamepad has
|
||||
* simple trigger rumble
|
||||
*
|
||||
* \param gamepad a gamepad identifier previously returned by
|
||||
* SDL_OpenGamepad()
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
@ -606,6 +661,12 @@ extern DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_in
|
||||
*/
|
||||
extern 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
|
||||
#define SDL_PROP_GAMEPAD_CAP_PLAYER_LED_BOOLEAN SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN
|
||||
#define SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN
|
||||
|
||||
/**
|
||||
* Get the instance ID of an opened gamepad.
|
||||
*
|
||||
@ -615,8 +676,6 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *g
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -631,7 +690,6 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gam
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceName
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -684,6 +742,8 @@ extern DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *game
|
||||
* \returns the player index for gamepad, or -1 if it's not available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -697,6 +757,8 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad);
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index);
|
||||
|
||||
@ -709,6 +771,8 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int
|
||||
* \returns the USB vendor ID, or zero if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceVendor
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -721,6 +785,8 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad);
|
||||
* \returns the USB product ID, or zero if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceProduct
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -733,6 +799,8 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad);
|
||||
* \returns the USB product version, or zero if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadInstanceProductVersion
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -794,9 +862,6 @@ extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_GetGamepadPowerLevel(SDL_Game
|
||||
* connected, or SDL_FALSE if not.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseGamepad
|
||||
* \sa SDL_OpenGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -830,6 +895,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepa
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadEventsEnabled
|
||||
* \sa SDL_UpdateGamepads
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetGamepadEventsEnabled(SDL_bool enabled);
|
||||
|
||||
@ -942,7 +1008,7 @@ extern DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const char
|
||||
*
|
||||
* \sa SDL_GetGamepadAxisFromString
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has a given axis.
|
||||
@ -955,6 +1021,9 @@ extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForAxis(SDL_GamepadAxis
|
||||
* \returns SDL_TRUE if the gamepad has this axis, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
|
||||
@ -977,6 +1046,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_Ga
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasAxis
|
||||
* \sa SDL_GetGamepadButton
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis);
|
||||
@ -994,6 +1064,8 @@ extern DECLSPEC Sint16 SDLCALL SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_Game
|
||||
* `SDL_GAMEPAD_BUTTON_INVALID` if no match was found.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadStringForButton
|
||||
*/
|
||||
extern DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(const char *str);
|
||||
|
||||
@ -1024,6 +1096,8 @@ extern DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadBut
|
||||
* \returns SDL_TRUE if the gamepad has this button, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasAxis
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
|
||||
@ -1037,6 +1111,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasButton
|
||||
* \sa SDL_GetGamepadAxis
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button);
|
||||
@ -1074,6 +1149,8 @@ extern DECLSPEC SDL_GamepadButtonLabel SDLCALL SDL_GetGamepadButtonLabel(SDL_Gam
|
||||
* \returns number of touchpads
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
||||
|
||||
@ -1086,6 +1163,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpads(SDL_Gamepad *gamepad);
|
||||
* \returns number of supported simultaneous fingers
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadTouchpadFinger
|
||||
* \sa SDL_GetNumGamepadTouchpads
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad);
|
||||
|
||||
@ -1103,6 +1183,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepa
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumGamepadTouchpadFingers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
|
||||
|
||||
@ -1114,6 +1196,10 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, i
|
||||
* \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetGamepadSensorData
|
||||
* \sa SDL_GetGamepadSensorDataRate
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
@ -1127,6 +1213,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasSensor
|
||||
* \sa SDL_GamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled);
|
||||
|
||||
@ -1138,6 +1227,8 @@ extern DECLSPEC int SDLCALL SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SD
|
||||
* \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetGamepadSensorEnabled
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type);
|
||||
|
||||
@ -1175,6 +1266,9 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_S
|
||||
* Each call to this function cancels any previous rumble effect, and calling
|
||||
* it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* This function requires you to process SDL events or call
|
||||
* SDL_UpdateJoysticks() to update rumble state.
|
||||
*
|
||||
* \param gamepad The gamepad to vibrate
|
||||
* \param low_frequency_rumble The intensity of the low frequency (left)
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
@ -1184,8 +1278,6 @@ extern DECLSPEC int SDLCALL SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_S
|
||||
* \returns 0, or -1 if rumble isn't supported on this gamepad
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
@ -1199,6 +1291,9 @@ extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_f
|
||||
* whole. This is currently only supported on Xbox One gamepads. If you want
|
||||
* the (more common) whole-gamepad rumble, use SDL_RumbleGamepad() instead.
|
||||
*
|
||||
* This function requires you to process SDL events or call
|
||||
* SDL_UpdateJoysticks() to update rumble state.
|
||||
*
|
||||
* \param gamepad The gamepad to vibrate
|
||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||
* to 0xFFFF
|
||||
@ -1210,50 +1305,19 @@ extern DECLSPEC int SDLCALL SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_f
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GamepadHasRumbleTriggers
|
||||
* \sa SDL_RumbleGamepad
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has an LED.
|
||||
*
|
||||
* \param gamepad The gamepad to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have a modifiable
|
||||
* LED
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasLED(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has rumble support.
|
||||
*
|
||||
* \param gamepad The gamepad to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have rumble
|
||||
* support
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleGamepad
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasRumble(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Query whether a gamepad has rumble support on triggers.
|
||||
*
|
||||
* \param gamepad The gamepad to query
|
||||
* \returns SDL_TRUE, or SDL_FALSE if this gamepad does not have trigger
|
||||
* rumble support
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleGamepadTriggers
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GamepadHasRumbleTriggers(SDL_Gamepad *gamepad);
|
||||
|
||||
/**
|
||||
* Update a gamepad's LED color.
|
||||
*
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* For gamepads with a single color LED, the maximum of the RGB values will be
|
||||
* used as the LED brightness.
|
||||
*
|
||||
* \param gamepad The gamepad to update
|
||||
* \param red The intensity of the red LED
|
||||
* \param green The intensity of the green LED
|
||||
|
@ -52,7 +52,7 @@ extern "C" {
|
||||
* GUIDs may be platform-dependent (i.e., the same device may report
|
||||
* different GUIDs on different operating systems).
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct SDL_GUID {
|
||||
Uint8 data[16];
|
||||
} SDL_GUID;
|
||||
|
||||
|
@ -27,55 +27,60 @@
|
||||
* The basic usage is as follows:
|
||||
* - Initialize the subsystem (::SDL_INIT_HAPTIC).
|
||||
* - Open a haptic device.
|
||||
* - SDL_HapticOpen() to open from index.
|
||||
* - SDL_HapticOpenFromJoystick() to open from an existing joystick.
|
||||
* - SDL_OpenHaptic() to open from index.
|
||||
* - SDL_OpenHapticFromJoystick() to open from an existing joystick.
|
||||
* - Create an effect (::SDL_HapticEffect).
|
||||
* - Upload the effect with SDL_HapticNewEffect().
|
||||
* - Run the effect with SDL_HapticRunEffect().
|
||||
* - (optional) Free the effect with SDL_HapticDestroyEffect().
|
||||
* - Close the haptic device with SDL_HapticClose().
|
||||
* - 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().
|
||||
*
|
||||
* \par Simple rumble example:
|
||||
* \code
|
||||
* SDL_Haptic *haptic;
|
||||
* SDL_Haptic *haptic = NULL;
|
||||
*
|
||||
* // Open the device
|
||||
* haptic = SDL_HapticOpen( 0 );
|
||||
* SDL_HapticID *haptics = SDL_GetHaptics(NULL);
|
||||
* if (haptics) {
|
||||
* haptic = SDL_OpenHaptic(haptics[0]);
|
||||
* SDL_free(haptics);
|
||||
* }
|
||||
* if (haptic == NULL)
|
||||
* return -1;
|
||||
*
|
||||
* // Initialize simple rumble
|
||||
* if (SDL_HapticRumbleInit( haptic ) != 0)
|
||||
* if (SDL_InitHapticRumble(haptic) != 0)
|
||||
* return -1;
|
||||
*
|
||||
* // Play effect at 50% strength for 2 seconds
|
||||
* if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0)
|
||||
* if (SDL_PlayHapticRumble(haptic, 0.5, 2000) != 0)
|
||||
* return -1;
|
||||
* SDL_Delay( 2000 );
|
||||
* SDL_Delay(2000);
|
||||
*
|
||||
* // Clean up
|
||||
* SDL_HapticClose( haptic );
|
||||
* SDL_CloseHaptic(haptic);
|
||||
* \endcode
|
||||
*
|
||||
* \par Complete example:
|
||||
* \code
|
||||
* int test_haptic( SDL_Joystick * joystick ) {
|
||||
* int test_haptic(SDL_Joystick *joystick)
|
||||
* {
|
||||
* SDL_Haptic *haptic;
|
||||
* SDL_HapticEffect effect;
|
||||
* int effect_id;
|
||||
*
|
||||
* // Open the device
|
||||
* haptic = SDL_HapticOpenFromJoystick( joystick );
|
||||
* haptic = SDL_OpenHapticFromJoystick(joystick);
|
||||
* if (haptic == NULL) return -1; // Most likely joystick isn't haptic
|
||||
*
|
||||
* // See if it can do sine waves
|
||||
* if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
|
||||
* SDL_HapticClose(haptic); // No sine effect
|
||||
* if ((SDL_GetHapticFeatures(haptic) & SDL_HAPTIC_SINE)==0) {
|
||||
* SDL_CloseHaptic(haptic); // No sine effect
|
||||
* return -1;
|
||||
* }
|
||||
*
|
||||
* // Create the effect
|
||||
* SDL_memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
|
||||
* SDL_memset(&effect, 0, sizeof(SDL_HapticEffect)); // 0 is safe default
|
||||
* effect.type = SDL_HAPTIC_SINE;
|
||||
* effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
|
||||
* effect.periodic.direction.dir[0] = 18000; // Force comes from south
|
||||
@ -86,21 +91,23 @@
|
||||
* effect.periodic.fade_length = 1000; // Takes 1 second to fade away
|
||||
*
|
||||
* // Upload the effect
|
||||
* effect_id = SDL_HapticNewEffect( haptic, &effect );
|
||||
* effect_id = SDL_CreateHapticEffect(haptic, &effect);
|
||||
*
|
||||
* // Test the effect
|
||||
* SDL_HapticRunEffect( haptic, effect_id, 1 );
|
||||
* SDL_Delay( 5000); // Wait for the effect to finish
|
||||
* SDL_RunHapticEffect(haptic, effect_id, 1);
|
||||
* SDL_Delay(5000); // Wait for the effect to finish
|
||||
*
|
||||
* // We destroy the effect, although closing the device also does this
|
||||
* SDL_HapticDestroyEffect( haptic, effect_id );
|
||||
* SDL_DestroyHapticEffect(haptic, effect_id);
|
||||
*
|
||||
* // Close the device
|
||||
* SDL_HapticClose(haptic);
|
||||
* SDL_CloseHaptic(haptic);
|
||||
*
|
||||
* return 0; // Success
|
||||
* }
|
||||
* \endcode
|
||||
*
|
||||
* Note that the SDL haptic subsystem is not thread-safe.
|
||||
*/
|
||||
|
||||
#ifndef SDL_haptic_h_
|
||||
@ -132,9 +139,9 @@ extern "C" {
|
||||
*
|
||||
* The haptic structure used to identify an SDL haptic.
|
||||
*
|
||||
* \sa SDL_HapticOpen
|
||||
* \sa SDL_HapticOpenFromJoystick
|
||||
* \sa SDL_HapticClose
|
||||
* \sa SDL_OpenHaptic
|
||||
* \sa SDL_OpenHapticFromJoystick
|
||||
* \sa SDL_CloseHaptic
|
||||
*/
|
||||
struct SDL_Haptic;
|
||||
typedef struct SDL_Haptic SDL_Haptic;
|
||||
@ -159,7 +166,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticCondition
|
||||
*/
|
||||
#define SDL_HAPTIC_CONSTANT (1u<<0)
|
||||
#define SDL_HAPTIC_CONSTANT (1u<<0)
|
||||
|
||||
/**
|
||||
* Sine wave effect supported.
|
||||
@ -168,21 +175,16 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticPeriodic
|
||||
*/
|
||||
#define SDL_HAPTIC_SINE (1u<<1)
|
||||
#define SDL_HAPTIC_SINE (1u<<1)
|
||||
|
||||
/**
|
||||
* Left/Right effect supported.
|
||||
* Square wave effect supported.
|
||||
*
|
||||
* Haptic effect for direct control over high/low frequency motors.
|
||||
* Periodic haptic effect that simulates square waves.
|
||||
*
|
||||
* \sa SDL_HapticLeftRight
|
||||
* \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
|
||||
* we ran out of bits, and this is important for XInput devices.
|
||||
* \sa SDL_HapticPeriodic
|
||||
*/
|
||||
#define SDL_HAPTIC_LEFTRIGHT (1u<<2)
|
||||
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/* #define SDL_HAPTIC_SQUARE (1<<2) */
|
||||
#define SDL_HAPTIC_SQUARE (1<<2)
|
||||
|
||||
/**
|
||||
* Triangle wave effect supported.
|
||||
@ -191,7 +193,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticPeriodic
|
||||
*/
|
||||
#define SDL_HAPTIC_TRIANGLE (1u<<3)
|
||||
#define SDL_HAPTIC_TRIANGLE (1u<<3)
|
||||
|
||||
/**
|
||||
* Sawtoothup wave effect supported.
|
||||
@ -200,7 +202,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticPeriodic
|
||||
*/
|
||||
#define SDL_HAPTIC_SAWTOOTHUP (1u<<4)
|
||||
#define SDL_HAPTIC_SAWTOOTHUP (1u<<4)
|
||||
|
||||
/**
|
||||
* Sawtoothdown wave effect supported.
|
||||
@ -218,7 +220,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticRamp
|
||||
*/
|
||||
#define SDL_HAPTIC_RAMP (1u<<6)
|
||||
#define SDL_HAPTIC_RAMP (1u<<6)
|
||||
|
||||
/**
|
||||
* Spring effect supported - uses axes position.
|
||||
@ -228,7 +230,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticCondition
|
||||
*/
|
||||
#define SDL_HAPTIC_SPRING (1u<<7)
|
||||
#define SDL_HAPTIC_SPRING (1u<<7)
|
||||
|
||||
/**
|
||||
* Damper effect supported - uses axes velocity.
|
||||
@ -238,7 +240,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticCondition
|
||||
*/
|
||||
#define SDL_HAPTIC_DAMPER (1u<<8)
|
||||
#define SDL_HAPTIC_DAMPER (1u<<8)
|
||||
|
||||
/**
|
||||
* Inertia effect supported - uses axes acceleration.
|
||||
@ -248,7 +250,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticCondition
|
||||
*/
|
||||
#define SDL_HAPTIC_INERTIA (1u<<9)
|
||||
#define SDL_HAPTIC_INERTIA (1u<<9)
|
||||
|
||||
/**
|
||||
* Friction effect supported - uses axes movement.
|
||||
@ -258,14 +260,30 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* \sa SDL_HapticCondition
|
||||
*/
|
||||
#define SDL_HAPTIC_FRICTION (1u<<10)
|
||||
#define SDL_HAPTIC_FRICTION (1u<<10)
|
||||
|
||||
/**
|
||||
* Left/Right effect supported.
|
||||
*
|
||||
* Haptic effect for direct control over high/low frequency motors.
|
||||
*
|
||||
* \sa SDL_HapticLeftRight
|
||||
*/
|
||||
#define SDL_HAPTIC_LEFTRIGHT (1u<<11)
|
||||
|
||||
/**
|
||||
* Reserved for future use
|
||||
*/
|
||||
#define SDL_HAPTIC_RESERVED1 (1u<<12)
|
||||
#define SDL_HAPTIC_RESERVED2 (1u<<13)
|
||||
#define SDL_HAPTIC_RESERVED3 (1u<<14)
|
||||
|
||||
/**
|
||||
* Custom effect is supported.
|
||||
*
|
||||
* User defined custom haptic effect.
|
||||
*/
|
||||
#define SDL_HAPTIC_CUSTOM (1u<<11)
|
||||
#define SDL_HAPTIC_CUSTOM (1u<<15)
|
||||
|
||||
/* @} *//* Haptic effects */
|
||||
|
||||
@ -276,37 +294,37 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* Device supports setting the global gain.
|
||||
*
|
||||
* \sa SDL_HapticSetGain
|
||||
* \sa SDL_SetHapticGain
|
||||
*/
|
||||
#define SDL_HAPTIC_GAIN (1u<<12)
|
||||
#define SDL_HAPTIC_GAIN (1u<<16)
|
||||
|
||||
/**
|
||||
* Device can set autocenter.
|
||||
*
|
||||
* Device supports setting autocenter.
|
||||
*
|
||||
* \sa SDL_HapticSetAutocenter
|
||||
* \sa SDL_SetHapticAutocenter
|
||||
*/
|
||||
#define SDL_HAPTIC_AUTOCENTER (1u<<13)
|
||||
#define SDL_HAPTIC_AUTOCENTER (1u<<17)
|
||||
|
||||
/**
|
||||
* Device can be queried for effect status.
|
||||
*
|
||||
* Device supports querying effect status.
|
||||
*
|
||||
* \sa SDL_HapticGetEffectStatus
|
||||
* \sa SDL_GetHapticEffectStatus
|
||||
*/
|
||||
#define SDL_HAPTIC_STATUS (1u<<14)
|
||||
#define SDL_HAPTIC_STATUS (1u<<18)
|
||||
|
||||
/**
|
||||
* Device can be paused.
|
||||
*
|
||||
* Devices supports being paused.
|
||||
*
|
||||
* \sa SDL_HapticPause
|
||||
* \sa SDL_HapticUnpause
|
||||
* \sa SDL_PauseHaptic
|
||||
* \sa SDL_ResumeHaptic
|
||||
*/
|
||||
#define SDL_HAPTIC_PAUSE (1u<<15)
|
||||
#define SDL_HAPTIC_PAUSE (1u<<19)
|
||||
|
||||
|
||||
/**
|
||||
@ -356,7 +374,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
/**
|
||||
* Used to play a device an infinite number of times.
|
||||
*
|
||||
* \sa SDL_HapticRunEffect
|
||||
* \sa SDL_RunHapticEffect
|
||||
*/
|
||||
#define SDL_HAPTIC_INFINITY 4294967295U
|
||||
|
||||
@ -455,7 +473,7 @@ typedef struct SDL_Haptic SDL_Haptic;
|
||||
* \sa SDL_HAPTIC_SPHERICAL
|
||||
* \sa SDL_HAPTIC_STEERING_AXIS
|
||||
* \sa SDL_HapticEffect
|
||||
* \sa SDL_HapticNumAxes
|
||||
* \sa SDL_GetNumHapticAxes
|
||||
*/
|
||||
typedef struct SDL_HapticDirection
|
||||
{
|
||||
@ -504,7 +522,7 @@ typedef struct SDL_HapticConstant
|
||||
*
|
||||
* The struct handles the following effects:
|
||||
* - ::SDL_HAPTIC_SINE
|
||||
* - ::SDL_HAPTIC_LEFTRIGHT
|
||||
* - ::SDL_HAPTIC_SQUARE
|
||||
* - ::SDL_HAPTIC_TRIANGLE
|
||||
* - ::SDL_HAPTIC_SAWTOOTHUP
|
||||
* - ::SDL_HAPTIC_SAWTOOTHDOWN
|
||||
@ -550,7 +568,7 @@ typedef struct SDL_HapticConstant
|
||||
\endverbatim
|
||||
*
|
||||
* \sa SDL_HAPTIC_SINE
|
||||
* \sa SDL_HAPTIC_LEFTRIGHT
|
||||
* \sa SDL_HAPTIC_SQUARE
|
||||
* \sa SDL_HAPTIC_TRIANGLE
|
||||
* \sa SDL_HAPTIC_SAWTOOTHUP
|
||||
* \sa SDL_HAPTIC_SAWTOOTHDOWN
|
||||
@ -559,7 +577,7 @@ typedef struct SDL_HapticConstant
|
||||
typedef struct SDL_HapticPeriodic
|
||||
{
|
||||
/* Header */
|
||||
Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT,
|
||||
Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_SQUARE
|
||||
::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
|
||||
::SDL_HAPTIC_SAWTOOTHDOWN */
|
||||
SDL_HapticDirection direction; /**< Direction of the effect. */
|
||||
@ -819,36 +837,46 @@ typedef union SDL_HapticEffect
|
||||
SDL_HapticCustom custom; /**< Custom effect. */
|
||||
} SDL_HapticEffect;
|
||||
|
||||
/**
|
||||
* This is a unique ID for a haptic device for the time it is connected to the system, and is never reused for the lifetime of the application. If the haptic device is disconnected and reconnected, it will get a new ID.
|
||||
*
|
||||
* The ID value starts at 1 and increments from there. The value 0 is an invalid ID.
|
||||
*/
|
||||
typedef Uint32 SDL_HapticID;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Count the number of haptic devices attached to the system.
|
||||
* Get a list of currently connected haptic devices.
|
||||
*
|
||||
* \returns the number of haptic devices detected on the system or a negative
|
||||
* error code on failure; call SDL_GetError() for more information.
|
||||
* \param count a pointer filled in with the number of haptic devices returned
|
||||
* \returns a 0 terminated array of haptic device instance IDs which should be
|
||||
* freed with SDL_free(), or NULL on error; call SDL_GetError() for
|
||||
* more details.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticName
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
|
||||
extern DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a haptic device.
|
||||
*
|
||||
* This can be called before any joysticks are opened. If no name can be
|
||||
* found, this function returns NULL.
|
||||
* This can be called before any haptic devices are opened.
|
||||
*
|
||||
* \param device_index index of the device to query.
|
||||
* \returns the name of the device or NULL on failure; call SDL_GetError() for
|
||||
* more information.
|
||||
* \param instance_id the haptic device instance ID
|
||||
* \returns the name of the selected haptic device. If no name can be found,
|
||||
* this function returns NULL; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_NumHaptics
|
||||
* \sa SDL_GetHapticName
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetHapticInstanceName(SDL_HapticID instance_id);
|
||||
|
||||
/**
|
||||
* Open a haptic device for use.
|
||||
@ -857,53 +885,60 @@ extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
|
||||
* system.
|
||||
*
|
||||
* When opening a haptic device, its gain will be set to maximum and
|
||||
* autocenter will be disabled. To modify these values use SDL_HapticSetGain()
|
||||
* and SDL_HapticSetAutocenter().
|
||||
* autocenter will be disabled. To modify these values use SDL_SetHapticGain()
|
||||
* and SDL_SetHapticAutocenter().
|
||||
*
|
||||
* \param device_index index of the device to open
|
||||
* \param instance_id the haptic device instance ID
|
||||
* \returns the device identifier or NULL on failure; call SDL_GetError() for
|
||||
* more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticClose
|
||||
* \sa SDL_HapticIndex
|
||||
* \sa SDL_HapticOpenFromJoystick
|
||||
* \sa SDL_HapticOpenFromMouse
|
||||
* \sa SDL_HapticPause
|
||||
* \sa SDL_HapticSetAutocenter
|
||||
* \sa SDL_HapticSetGain
|
||||
* \sa SDL_HapticStopAll
|
||||
* \sa SDL_CloseHaptic
|
||||
* \sa SDL_GetHaptics
|
||||
* \sa SDL_OpenHapticFromJoystick
|
||||
* \sa SDL_OpenHapticFromMouse
|
||||
* \sa SDL_SetHapticAutocenter
|
||||
* \sa SDL_SetHapticGain
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index);
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id);
|
||||
|
||||
|
||||
/**
|
||||
* Check if the haptic device at the designated index has been opened.
|
||||
* Get the SDL_Haptic associated with an instance ID, if it has been opened.
|
||||
*
|
||||
* \param device_index the index of the device to query
|
||||
* \returns 1 if it has been opened, 0 if it hasn't or on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
* \param instance_id the instance ID to get the SDL_Haptic for
|
||||
* \returns an SDL_Haptic on success or NULL on failure or if it hasn't been
|
||||
* opened yet; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticIndex
|
||||
* \sa SDL_HapticOpen
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index);
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromInstanceID(SDL_HapticID instance_id);
|
||||
|
||||
/**
|
||||
* Get the index of a haptic device.
|
||||
* Get the instance ID of an opened haptic device.
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to query
|
||||
* \returns the index of the specified haptic device or a negative error code
|
||||
* on failure; call SDL_GetError() for more information.
|
||||
* \returns the instance ID of the specified haptic device on success or 0 on
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticInstanceID(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a haptic device.
|
||||
*
|
||||
* \param haptic the SDL_Haptic obtained from SDL_OpenJoystick()
|
||||
* \returns the name of the selected haptic device. If no name can be found,
|
||||
* this function returns NULL; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticOpen
|
||||
* \sa SDL_HapticOpened
|
||||
* \sa SDL_GetHapticInstanceName
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Query whether or not the current mouse has haptic capabilities.
|
||||
@ -912,9 +947,9 @@ extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticOpenFromMouse
|
||||
* \sa SDL_OpenHapticFromMouse
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void);
|
||||
|
||||
/**
|
||||
* Try to open a haptic device from the current mouse.
|
||||
@ -924,24 +959,22 @@ extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticOpen
|
||||
* \sa SDL_MouseIsHaptic
|
||||
* \sa SDL_CloseHaptic
|
||||
* \sa SDL_IsMouseHaptic
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromMouse(void);
|
||||
|
||||
/**
|
||||
* Query if a joystick has haptic features.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to test for haptic capabilities
|
||||
* \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a
|
||||
* negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
* \returns SDL_TRUE if the joystick is haptic or SDL_FALSE if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticOpenFromJoystick
|
||||
* \sa SDL_OpenHapticFromJoystick
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Open a haptic device for use from a joystick device.
|
||||
@ -960,30 +993,28 @@ extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticClose
|
||||
* \sa SDL_HapticOpen
|
||||
* \sa SDL_JoystickIsHaptic
|
||||
* \sa SDL_CloseHaptic
|
||||
* \sa SDL_IsJoystickHaptic
|
||||
*/
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
|
||||
joystick);
|
||||
extern DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromJoystick(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Close a haptic device previously opened with SDL_HapticOpen().
|
||||
* Close a haptic device previously opened with SDL_OpenHaptic().
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to close
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticOpen
|
||||
* \sa SDL_OpenHaptic
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
|
||||
extern DECLSPEC void SDLCALL SDL_CloseHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the number of effects a haptic device can store.
|
||||
*
|
||||
* On some platforms this isn't fully supported, and therefore is an
|
||||
* approximation. Always check to see if your created effect was actually
|
||||
* created and do not rely solely on SDL_HapticNumEffects().
|
||||
* created and do not rely solely on SDL_GetMaxHapticEffects().
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to query
|
||||
* \returns the number of effects the haptic device can store or a negative
|
||||
@ -991,10 +1022,10 @@ extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticNumEffectsPlaying
|
||||
* \sa SDL_HapticQuery
|
||||
* \sa SDL_GetMaxHapticEffectsPlaying
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_GetMaxHapticEffects(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the number of effects a haptic device can play at the same time.
|
||||
@ -1008,10 +1039,10 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticNumEffects
|
||||
* \sa SDL_HapticQuery
|
||||
* \sa SDL_GetMaxHapticEffects
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_GetMaxHapticEffectsPlaying(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Get the haptic device's supported features in bitwise manner.
|
||||
@ -1023,9 +1054,9 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticEffectSupported
|
||||
* \sa SDL_HapticNumEffects
|
||||
* \sa SDL_GetMaxHapticEffects
|
||||
*/
|
||||
extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetHapticFeatures(SDL_Haptic *haptic);
|
||||
|
||||
|
||||
/**
|
||||
@ -1040,25 +1071,21 @@ extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumHapticAxes(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Check to see if an effect is supported by a haptic device.
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to query
|
||||
* \param effect the desired effect to query
|
||||
* \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a
|
||||
* negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
* \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticNewEffect
|
||||
* \sa SDL_HapticQuery
|
||||
* \sa SDL_CreateHapticEffect
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
|
||||
SDL_HapticEffect *
|
||||
effect);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
|
||||
/**
|
||||
* Create a new haptic effect on a specified device.
|
||||
@ -1071,12 +1098,11 @@ extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticDestroyEffect
|
||||
* \sa SDL_HapticRunEffect
|
||||
* \sa SDL_HapticUpdateEffect
|
||||
* \sa SDL_DestroyHapticEffect
|
||||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_UpdateHapticEffect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
|
||||
SDL_HapticEffect * effect);
|
||||
extern DECLSPEC int SDLCALL SDL_CreateHapticEffect(SDL_Haptic *haptic, const SDL_HapticEffect *effect);
|
||||
|
||||
/**
|
||||
* Update the properties of an effect.
|
||||
@ -1084,7 +1110,7 @@ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
|
||||
* Can be used dynamically, although behavior when dynamically changing
|
||||
* direction may be strange. Specifically the effect may re-upload itself and
|
||||
* start playing from the start. You also cannot change the type either when
|
||||
* running SDL_HapticUpdateEffect().
|
||||
* running SDL_UpdateHapticEffect().
|
||||
*
|
||||
* \param haptic the SDL_Haptic device that has the effect
|
||||
* \param effect the identifier of the effect to update
|
||||
@ -1095,13 +1121,10 @@ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticDestroyEffect
|
||||
* \sa SDL_HapticNewEffect
|
||||
* \sa SDL_HapticRunEffect
|
||||
* \sa SDL_CreateHapticEffect
|
||||
* \sa SDL_RunHapticEffect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
|
||||
int effect,
|
||||
SDL_HapticEffect * data);
|
||||
extern DECLSPEC int SDLCALL SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data);
|
||||
|
||||
/**
|
||||
* Run the haptic effect on its associated haptic device.
|
||||
@ -1121,13 +1144,11 @@ extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticDestroyEffect
|
||||
* \sa SDL_HapticGetEffectStatus
|
||||
* \sa SDL_HapticStopEffect
|
||||
* \sa SDL_GetHapticEffectStatus
|
||||
* \sa SDL_StopHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
|
||||
int effect,
|
||||
Uint32 iterations);
|
||||
extern DECLSPEC int SDLCALL SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations);
|
||||
|
||||
/**
|
||||
* Stop the haptic effect on its associated haptic device.
|
||||
@ -1141,11 +1162,10 @@ extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticDestroyEffect
|
||||
* \sa SDL_HapticRunEffect
|
||||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
|
||||
int effect);
|
||||
extern DECLSPEC int SDLCALL SDL_StopHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Destroy a haptic effect on the device.
|
||||
@ -1158,10 +1178,9 @@ extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticNewEffect
|
||||
* \sa SDL_CreateHapticEffect
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
|
||||
int effect);
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Get the status of the current effect on the specified haptic device.
|
||||
@ -1174,12 +1193,8 @@ extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
|
||||
* code on failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticRunEffect
|
||||
* \sa SDL_HapticStopEffect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
|
||||
int effect);
|
||||
extern DECLSPEC int SDLCALL SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect);
|
||||
|
||||
/**
|
||||
* Set the global gain of the specified haptic device.
|
||||
@ -1188,7 +1203,7 @@ extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
|
||||
*
|
||||
* The user may specify the maximum gain by setting the environment variable
|
||||
* `SDL_HAPTIC_GAIN_MAX` which should be between 0 and 100. All calls to
|
||||
* SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the
|
||||
* SDL_SetHapticGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the
|
||||
* maximum.
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to set the gain on
|
||||
@ -1198,9 +1213,9 @@ extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticQuery
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
|
||||
extern DECLSPEC int SDLCALL SDL_SetHapticGain(SDL_Haptic *haptic, int gain);
|
||||
|
||||
/**
|
||||
* Set the global autocenter of the device.
|
||||
@ -1217,16 +1232,15 @@ extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticQuery
|
||||
* \sa SDL_GetHapticFeatures
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
|
||||
int autocenter);
|
||||
extern DECLSPEC int SDLCALL SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter);
|
||||
|
||||
/**
|
||||
* Pause a haptic device.
|
||||
*
|
||||
* Device must support the `SDL_HAPTIC_PAUSE` feature. Call
|
||||
* SDL_HapticUnpause() to resume playback.
|
||||
* Device must support the `SDL_HAPTIC_PAUSE` feature. Call SDL_ResumeHaptic()
|
||||
* to resume playback.
|
||||
*
|
||||
* Do not modify the effects nor add new ones while the device is paused. That
|
||||
* can cause all sorts of weird errors.
|
||||
@ -1237,14 +1251,14 @@ extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticUnpause
|
||||
* \sa SDL_ResumeHaptic
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_PauseHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Unpause a haptic device.
|
||||
* Resume a haptic device.
|
||||
*
|
||||
* Call to unpause after SDL_HapticPause().
|
||||
* Call to unpause after SDL_PauseHaptic().
|
||||
*
|
||||
* \param haptic the SDL_Haptic device to unpause
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
@ -1252,9 +1266,9 @@ extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticPause
|
||||
* \sa SDL_PauseHaptic
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_ResumeHaptic(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Stop all the currently playing effects on a haptic device.
|
||||
@ -1264,24 +1278,23 @@ extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RunHapticEffect
|
||||
* \sa SDL_StopHapticEffects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_StopHapticEffects(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Check whether rumble is supported on a haptic device.
|
||||
*
|
||||
* \param haptic haptic device to check for rumble support
|
||||
* \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a
|
||||
* negative error code on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
* \returns SDL_TRUE if the effect is supported or SDL_FALSE if it isn't.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticRumbleInit
|
||||
* \sa SDL_HapticRumblePlay
|
||||
* \sa SDL_HapticRumbleStop
|
||||
* \sa SDL_InitHapticRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HapticRumbleSupported(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Initialize a haptic device for simple rumble playback.
|
||||
@ -1292,12 +1305,11 @@ extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticOpen
|
||||
* \sa SDL_HapticRumblePlay
|
||||
* \sa SDL_HapticRumbleStop
|
||||
* \sa SDL_PlayHapticRumble
|
||||
* \sa SDL_StopHapticRumble
|
||||
* \sa SDL_HapticRumbleSupported
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_InitHapticRumble(SDL_Haptic *haptic);
|
||||
|
||||
/**
|
||||
* Run a simple rumble effect on a haptic device.
|
||||
@ -1310,11 +1322,10 @@ extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticRumbleInit
|
||||
* \sa SDL_HapticRumbleStop
|
||||
* \sa SDL_HapticRumbleSupported
|
||||
* \sa SDL_InitHapticRumble
|
||||
* \sa SDL_StopHapticRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
|
||||
extern DECLSPEC int SDLCALL SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length);
|
||||
|
||||
/**
|
||||
* Stop the simple rumble on a haptic device.
|
||||
@ -1325,11 +1336,9 @@ extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float stre
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HapticRumbleInit
|
||||
* \sa SDL_HapticRumblePlay
|
||||
* \sa SDL_HapticRumbleSupported
|
||||
* \sa SDL_PlayHapticRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
|
||||
extern DECLSPEC int SDLCALL SDL_StopHapticRumble(SDL_Haptic *haptic);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -53,18 +53,15 @@ extern "C" {
|
||||
typedef enum
|
||||
{
|
||||
SDL_INIT_TIMER = 0x00000001,
|
||||
SDL_INIT_AUDIO = 0x00000010,
|
||||
SDL_INIT_AUDIO = 0x00000010, /**< `SDL_INIT_AUDIO` implies `SDL_INIT_EVENTS` */
|
||||
SDL_INIT_VIDEO = 0x00000020, /**< `SDL_INIT_VIDEO` implies `SDL_INIT_EVENTS` */
|
||||
SDL_INIT_JOYSTICK = 0x00000200, /**< `SDL_INIT_JOYSTICK` implies `SDL_INIT_EVENTS` */
|
||||
SDL_INIT_HAPTIC = 0x00001000,
|
||||
SDL_INIT_GAMEPAD = 0x00002000, /**< `SDL_INIT_GAMEPAD` implies `SDL_INIT_JOYSTICK` */
|
||||
SDL_INIT_EVENTS = 0x00004000,
|
||||
SDL_INIT_SENSOR = 0x00008000
|
||||
SDL_INIT_SENSOR = 0x00008000, /**< `SDL_INIT_SENSOR` implies `SDL_INIT_EVENTS` */
|
||||
SDL_INIT_CAMERA = 0x00010000 /**< `SDL_INIT_CAMERA` implies `SDL_INIT_EVENTS` */
|
||||
} SDL_InitFlags;
|
||||
#define SDL_INIT_EVERYTHING ( \
|
||||
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
||||
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMEPAD | SDL_INIT_SENSOR \
|
||||
)
|
||||
|
||||
/**
|
||||
* Initialize the SDL library.
|
||||
@ -73,7 +70,7 @@ typedef enum
|
||||
* two may be used interchangeably. Though for readability of your code
|
||||
* SDL_InitSubSystem() might be preferred.
|
||||
*
|
||||
* The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
|
||||
* The file I/O (for example: SDL_IOFromFile) and threading (SDL_CreateThread)
|
||||
* subsystems are initialized by default. Message boxes
|
||||
* (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
|
||||
* video subsystem, in hopes of being useful in showing an error dialog when
|
||||
@ -94,7 +91,7 @@ typedef enum
|
||||
* - `SDL_INIT_GAMEPAD`: gamepad subsystem; automatically initializes the
|
||||
* joystick subsystem
|
||||
* - `SDL_INIT_EVENTS`: events subsystem
|
||||
* - `SDL_INIT_EVERYTHING`: all of the above subsystems
|
||||
* - `SDL_INIT_SENSOR`: sensor subsystem
|
||||
*
|
||||
* Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
|
||||
* for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
|
||||
|
@ -64,7 +64,7 @@ _m_prefetch(void *__P)
|
||||
# ifdef __ARM_NEON
|
||||
# define SDL_NEON_INTRINSICS 1
|
||||
# include <arm_neon.h>
|
||||
# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
|
||||
# elif defined(SDL_PLATFORM_WINDOWS)
|
||||
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
||||
# ifdef _M_ARM
|
||||
# define SDL_NEON_INTRINSICS 1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -137,6 +137,17 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lo
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
|
||||
|
||||
/**
|
||||
* Return whether a joystick is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a joystick is connected, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected joysticks.
|
||||
*
|
||||
@ -147,6 +158,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasJoystick
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count);
|
||||
@ -163,7 +175,7 @@ extern DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickName
|
||||
* \sa SDL_OpenJoystick
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_JoystickID instance_id);
|
||||
|
||||
@ -179,7 +191,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_JoystickID i
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickPath
|
||||
* \sa SDL_OpenJoystick
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_JoystickID instance_id);
|
||||
|
||||
@ -194,7 +206,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_JoystickID i
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickPlayerIndex
|
||||
* \sa SDL_OpenJoystick
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID instance_id);
|
||||
|
||||
@ -204,8 +216,8 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID in
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param instance_id the joystick instance ID
|
||||
* \returns the GUID of the selected joystick. If called on an invalid index,
|
||||
* this function returns a zero GUID
|
||||
* \returns the GUID of the selected joystick. If called with an invalid
|
||||
* instance_id, this function returns a zero GUID.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -221,10 +233,13 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickInstanceGUID(SDL_Joystic
|
||||
* available this function returns 0.
|
||||
*
|
||||
* \param instance_id the joystick instance ID
|
||||
* \returns the USB vendor ID of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero
|
||||
* \returns the USB vendor ID of the selected joystick. If called with an
|
||||
* invalid instance_id, this function returns 0.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickVendor
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID instance_id);
|
||||
|
||||
@ -235,10 +250,13 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID inst
|
||||
* available this function returns 0.
|
||||
*
|
||||
* \param instance_id the joystick instance ID
|
||||
* \returns the USB product ID of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero
|
||||
* \returns the USB product ID of the selected joystick. If called with an
|
||||
* invalid instance_id, this function returns 0.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickProduct
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID instance_id);
|
||||
|
||||
@ -249,10 +267,13 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID ins
|
||||
* isn't available this function returns 0.
|
||||
*
|
||||
* \param instance_id the joystick instance ID
|
||||
* \returns the product version of the selected joystick. If called on an
|
||||
* invalid index, this function returns zero
|
||||
* \returns the product version of the selected joystick. If called with an
|
||||
* invalid instance_id, this function returns 0.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickProductVersion
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_JoystickID instance_id);
|
||||
|
||||
@ -262,10 +283,14 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_Joystic
|
||||
* This can be called before any joysticks are opened.
|
||||
*
|
||||
* \param instance_id the joystick instance ID
|
||||
* \returns the SDL_JoystickType of the selected joystick. If called on an
|
||||
* invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`
|
||||
* \returns the SDL_JoystickType of the selected joystick. If called with an
|
||||
* invalid instance_id, this function returns
|
||||
* `SDL_JOYSTICK_TYPE_UNKNOWN`.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickType
|
||||
* \sa SDL_GetJoysticks
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickInstanceType(SDL_JoystickID instance_id);
|
||||
|
||||
@ -304,6 +329,9 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_Joystick
|
||||
* for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickPlayerIndex
|
||||
* \sa SDL_SetJoystickPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index);
|
||||
|
||||
@ -318,6 +346,9 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AttachVirtualJoystickEx
|
||||
* \sa SDL_DetachVirtualJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(SDL_JoystickType type,
|
||||
int naxes,
|
||||
@ -371,6 +402,9 @@ typedef struct SDL_VirtualJoystickDesc
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AttachVirtualJoystick
|
||||
* \sa SDL_DetachVirtualJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystickEx(const SDL_VirtualJoystickDesc *desc);
|
||||
|
||||
@ -383,6 +417,9 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystickEx(const SDL_Vir
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AttachVirtualJoystick
|
||||
* \sa SDL_AttachVirtualJoystickEx
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
|
||||
|
||||
@ -460,6 +497,19 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, in
|
||||
/**
|
||||
* Get the properties associated with a joystick.
|
||||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN`: true if this joystick has an
|
||||
* LED that has adjustable brightness
|
||||
* - `SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN`: true if this joystick has an LED
|
||||
* that has adjustable color
|
||||
* - `SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN`: true if this joystick has a
|
||||
* player LED
|
||||
* - `SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN`: true if this joystick has
|
||||
* left/right rumble
|
||||
* - `SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN`: true if this joystick has
|
||||
* simple trigger rumble
|
||||
*
|
||||
* \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
@ -471,6 +521,12 @@ extern DECLSPEC int SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, in
|
||||
*/
|
||||
extern 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"
|
||||
#define SDL_PROP_JOYSTICK_CAP_PLAYER_LED_BOOLEAN "SDL.joystick.cap.player_led"
|
||||
#define SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN "SDL.joystick.cap.rumble"
|
||||
#define SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN "SDL.joystick.cap.trigger_rumble"
|
||||
|
||||
/**
|
||||
* Get the implementation dependent name of a joystick.
|
||||
*
|
||||
@ -481,7 +537,6 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickInstanceName
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick);
|
||||
|
||||
@ -508,6 +563,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick);
|
||||
* \returns the player index, or -1 if it's not available.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetJoystickPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
|
||||
|
||||
@ -521,6 +578,8 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickPlayerIndex
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
|
||||
|
||||
@ -550,6 +609,8 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joyst
|
||||
* \returns the USB vendor ID of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickInstanceVendor
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
|
||||
|
||||
@ -562,6 +623,8 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick);
|
||||
* \returns the USB product ID of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickInstanceProduct
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
|
||||
|
||||
@ -574,6 +637,8 @@ extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick);
|
||||
* \returns the product version of the selected joystick, or 0 if unavailable.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickInstanceProductVersion
|
||||
*/
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick);
|
||||
|
||||
@ -610,6 +675,8 @@ extern DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystic
|
||||
* \returns the SDL_JoystickType of the selected joystick.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickInstanceType
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick);
|
||||
|
||||
@ -675,9 +742,6 @@ extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseJoystick
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
||||
|
||||
@ -689,8 +753,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystick);
|
||||
* failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *joystick);
|
||||
|
||||
@ -709,10 +771,33 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *j
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickAxis
|
||||
* \sa SDL_OpenJoystick
|
||||
* \sa SDL_GetNumJoystickBalls
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of trackballs on a joystick.
|
||||
*
|
||||
* Joystick trackballs have only relative motion events associated with them
|
||||
* and their state cannot be polled.
|
||||
*
|
||||
* Most joysticks do not have trackballs.
|
||||
*
|
||||
* \param joystick an SDL_Joystick structure containing joystick information
|
||||
* \returns the number of trackballs 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.
|
||||
*
|
||||
* \sa SDL_GetJoystickBall
|
||||
* \sa SDL_GetNumJoystickAxes
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickBalls(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Get the number of POV hats on a joystick.
|
||||
*
|
||||
@ -723,7 +808,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickAxes(SDL_Joystick *joystick);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickHat
|
||||
* \sa SDL_OpenJoystick
|
||||
* \sa SDL_GetNumJoystickAxes
|
||||
* \sa SDL_GetNumJoystickBalls
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
|
||||
|
||||
@ -737,7 +824,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickHats(SDL_Joystick *joystick);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetJoystickButton
|
||||
* \sa SDL_OpenJoystick
|
||||
* \sa SDL_GetNumJoystickAxes
|
||||
* \sa SDL_GetNumJoystickBalls
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
|
||||
|
||||
@ -753,6 +842,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumJoystickButtons(SDL_Joystick *joystick);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickEventsEnabled
|
||||
* \sa SDL_UpdateJoysticks
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetJoystickEventsEnabled(SDL_bool enabled);
|
||||
|
||||
@ -804,8 +894,7 @@ extern DECLSPEC void SDLCALL SDL_UpdateJoysticks(void);
|
||||
*
|
||||
* \sa SDL_GetNumJoystickAxes
|
||||
*/
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick,
|
||||
int axis);
|
||||
extern DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis);
|
||||
|
||||
/**
|
||||
* Get the initial state of an axis control on a joystick.
|
||||
@ -821,8 +910,28 @@ extern DECLSPEC Sint16 SDLCALL SDL_GetJoystickAxis(SDL_Joystick *joystick,
|
||||
*
|
||||
* \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 DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state);
|
||||
|
||||
/**
|
||||
* Get the ball axis change since the last poll.
|
||||
*
|
||||
* Trackballs can only return relative motion since the last call to
|
||||
* SDL_GetJoystickBall(), these motion deltas are placed into `dx` and `dy`.
|
||||
*
|
||||
* Most joysticks do not have trackballs.
|
||||
*
|
||||
* \param joystick the SDL_Joystick to query
|
||||
* \param ball the ball index to query; ball indices start at index 0
|
||||
* \param dx stores the difference in the x axis position since the last poll
|
||||
* \param dy stores the difference in the y axis position since the last poll
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_GetNumJoystickBalls
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
|
||||
|
||||
/**
|
||||
* \name Hat positions
|
||||
@ -862,8 +971,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetJoystickAxisInitialState(SDL_Joystick *j
|
||||
*
|
||||
* \sa SDL_GetNumJoystickHats
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick,
|
||||
int hat);
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick, int hat);
|
||||
|
||||
/**
|
||||
* Get the current state of a button on a joystick.
|
||||
@ -877,8 +985,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickHat(SDL_Joystick *joystick,
|
||||
*
|
||||
* \sa SDL_GetNumJoystickButtons
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick,
|
||||
int button);
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick, int button);
|
||||
|
||||
/**
|
||||
* Start a rumble effect.
|
||||
@ -886,6 +993,9 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick,
|
||||
* Each call to this function cancels any previous rumble effect, and calling
|
||||
* it with 0 intensity stops any rumbling.
|
||||
*
|
||||
* This function requires you to process SDL events or call
|
||||
* SDL_UpdateJoysticks() to update rumble state.
|
||||
*
|
||||
* \param joystick The joystick to vibrate
|
||||
* \param low_frequency_rumble The intensity of the low frequency (left)
|
||||
* rumble motor, from 0 to 0xFFFF
|
||||
@ -895,8 +1005,6 @@ extern DECLSPEC Uint8 SDLCALL SDL_GetJoystickButton(SDL_Joystick *joystick,
|
||||
* \returns 0, or -1 if rumble isn't supported on this joystick
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickHasRumble
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
|
||||
|
||||
@ -911,6 +1019,9 @@ extern DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 lo
|
||||
* want the (more common) whole-controller rumble, use SDL_RumbleJoystick()
|
||||
* instead.
|
||||
*
|
||||
* This function requires you to process SDL events or call
|
||||
* SDL_UpdateJoysticks() to update rumble state.
|
||||
*
|
||||
* \param joystick The joystick to vibrate
|
||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||
* to 0xFFFF
|
||||
@ -922,47 +1033,9 @@ extern DECLSPEC int SDLCALL SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 lo
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_JoystickHasRumbleTriggers
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Query whether a joystick has an LED.
|
||||
*
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* \param joystick The joystick to query
|
||||
* \returns SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE
|
||||
* otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Query whether a joystick has rumble support.
|
||||
*
|
||||
* \param joystick The joystick to query
|
||||
* \returns SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleJoystick
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick);
|
||||
|
||||
/**
|
||||
* Query whether a joystick has rumble support on triggers.
|
||||
*
|
||||
* \param joystick The joystick to query
|
||||
* \returns SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_RumbleJoystickTriggers
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick);
|
||||
extern DECLSPEC int SDLCALL SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
|
||||
|
||||
/**
|
||||
* Update a joystick's LED color.
|
||||
@ -970,6 +1043,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joy
|
||||
* An example of a joystick LED is the light on the back of a PlayStation 4's
|
||||
* DualShock 4 controller.
|
||||
*
|
||||
* For joysticks with a single color LED, the maximum of the RGB values will
|
||||
* be used as the LED brightness.
|
||||
*
|
||||
* \param joystick The joystick to update
|
||||
* \param red The intensity of the red LED
|
||||
* \param green The intensity of the green LED
|
||||
|
@ -39,6 +39,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef Uint32 SDL_KeyboardID;
|
||||
|
||||
/**
|
||||
* The SDL keysym structure, used in key events.
|
||||
*
|
||||
@ -54,6 +56,52 @@ typedef struct SDL_Keysym
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Return whether a keyboard is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a keyboard is connected, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetKeyboards
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected keyboards.
|
||||
*
|
||||
* Note that this will include any device or virtual driver that includes
|
||||
* keyboard functionality, including some mice, KVM switches, motherboard
|
||||
* power buttons, etc. You should wait for input from a device before you
|
||||
* consider it actively in use.
|
||||
*
|
||||
* \param count a pointer filled in with the number of keyboards returned
|
||||
* \returns a 0 terminated array of keyboards instance IDs which should be
|
||||
* freed with SDL_free(), or NULL on error; call SDL_GetError() for
|
||||
* more details.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetKeyboardInstanceName
|
||||
* \sa SDL_HasKeyboard
|
||||
*/
|
||||
extern DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count);
|
||||
|
||||
/**
|
||||
* Get the name of a keyboard.
|
||||
*
|
||||
* This function returns "" if the keyboard doesn't have a name.
|
||||
*
|
||||
* \param instance_id the keyboard instance ID
|
||||
* \returns the name of the selected keyboard, or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetKeyboards
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetKeyboardInstanceName(SDL_KeyboardID instance_id);
|
||||
|
||||
/**
|
||||
* Query the window which currently has keyboard focus.
|
||||
*
|
||||
@ -251,6 +299,8 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
||||
* and SDL_TextEditingEvent (SDL_EVENT_TEXT_EDITING) events. Please use this
|
||||
* function in pair with SDL_StopTextInput().
|
||||
*
|
||||
* Text input events are received by default.
|
||||
*
|
||||
* On some platforms using this function activates the screen keyboard.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
@ -274,6 +324,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(void);
|
||||
/**
|
||||
* Stop receiving any text input events.
|
||||
*
|
||||
* Text input events are received by default.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StartTextInput
|
||||
@ -290,15 +342,6 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
||||
|
||||
/**
|
||||
* Returns if an IME Composite or Candidate window is currently shown.
|
||||
*
|
||||
* \returns SDL_TRUE if shown, else SDL_FALSE
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_TextInputShown(void);
|
||||
|
||||
/**
|
||||
* Set the rectangle used to type Unicode text inputs.
|
||||
*
|
||||
|
@ -87,7 +87,6 @@ extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LoadObject
|
||||
* \sa SDL_UnloadObject
|
||||
*/
|
||||
extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_LoadFunction(void *handle, const char *name);
|
||||
|
||||
@ -98,7 +97,6 @@ extern DECLSPEC SDL_FunctionPointer SDLCALL SDL_LoadFunction(void *handle, const
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LoadFunction
|
||||
* \sa SDL_LoadObject
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
||||
|
@ -59,7 +59,7 @@ extern "C" {
|
||||
* By default the application category is enabled at the INFO level,
|
||||
* the assert category is enabled at the WARN level, test is enabled
|
||||
* at the VERBOSE level and all other categories are enabled at the
|
||||
* CRITICAL level.
|
||||
* ERROR level.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@ -118,6 +118,7 @@ typedef enum
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogResetPriorities
|
||||
* \sa SDL_LogSetPriority
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
|
||||
@ -131,6 +132,7 @@ 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
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
|
||||
@ -358,7 +360,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
|
||||
*
|
||||
* This function is called by SDL when there is new text to be logged.
|
||||
*
|
||||
* \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction()
|
||||
* \param userdata what was passed as `userdata` to SDL_SetLogOutputFunction()
|
||||
* \param category the category of the message
|
||||
* \param priority the priority of the message
|
||||
* \param message the message being output
|
||||
@ -375,9 +377,9 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogSetOutputFunction
|
||||
* \sa SDL_SetLogOutputFunction
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
||||
extern DECLSPEC void SDLCALL SDL_GetLogOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
|
||||
|
||||
/**
|
||||
* Replace the default log output function with one of your own.
|
||||
@ -387,9 +389,9 @@ extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *cal
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LogGetOutputFunction
|
||||
* \sa SDL_GetLogOutputFunction
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
||||
extern DECLSPEC void SDLCALL SDL_SetLogOutputFunction(SDL_LogOutputFunction callback, void *userdata);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
@ -22,6 +22,7 @@
|
||||
#ifndef SDL_main_h_
|
||||
#define SDL_main_h_
|
||||
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_events.h>
|
||||
|
||||
@ -40,94 +41,93 @@
|
||||
*/
|
||||
|
||||
#ifndef SDL_MAIN_HANDLED
|
||||
#ifdef __WIN32__
|
||||
/* On Windows SDL provides WinMain(), which parses the command line and passes
|
||||
the arguments to your main function.
|
||||
#ifdef SDL_PLATFORM_WIN32
|
||||
/* On Windows SDL provides WinMain(), which parses the command line and passes
|
||||
the arguments to your main function.
|
||||
|
||||
If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
|
||||
#elif defined(__WINRT__)
|
||||
/* On WinRT, SDL provides a main function that initializes CoreApplication,
|
||||
creating an instance of IFrameworkView in the process.
|
||||
#elif defined(SDL_PLATFORM_WINRT)
|
||||
/* On WinRT, SDL provides a main function that initializes CoreApplication,
|
||||
creating an instance of IFrameworkView in the process.
|
||||
|
||||
Ideally, #include'ing SDL_main.h is enough to get a main() function working.
|
||||
However, that requires the source file your main() is in to be compiled
|
||||
as C++ *and* with the /ZW compiler flag. If that's not feasible, add an
|
||||
otherwise empty .cpp file that only contains `#include <SDL3/SDL_main.h>`
|
||||
and build that with /ZW (still include SDL_main.h in your other file with main()!).
|
||||
In XAML apps, instead the function SDL_RunApp() must be called with a pointer
|
||||
to the Direct3D-hosted XAML control passed in as the "reserved" argument.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
Ideally, #include'ing SDL_main.h is enough to get a main() function working.
|
||||
However, that requires the source file your main() is in to be compiled
|
||||
as C++ *and* with the /ZW compiler flag. If that's not feasible, add an
|
||||
otherwise empty .cpp file that only contains `#include <SDL3/SDL_main.h>`
|
||||
and build that with /ZW (still include SDL_main.h in your other file with main()!).
|
||||
In XAML apps, instead the function SDL_RunApp() must be called with a pointer
|
||||
to the Direct3D-hosted XAML control passed in as the "reserved" argument.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
|
||||
#elif defined(__GDK__)
|
||||
/* On GDK, SDL provides a main function that initializes the game runtime.
|
||||
#elif defined(SDL_PLATFORM_GDK)
|
||||
/* On GDK, SDL provides a main function that initializes the game runtime.
|
||||
|
||||
If you prefer to write your own WinMain-function instead of having SDL
|
||||
provide one that calls your main() function,
|
||||
#define SDL_MAIN_HANDLED before #include'ing SDL_main.h
|
||||
and call the SDL_RunApp function from your entry point.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
If you prefer to write your own WinMain-function instead of having SDL
|
||||
provide one that calls your main() function,
|
||||
#define SDL_MAIN_HANDLED before #include'ing SDL_main.h
|
||||
and call the SDL_RunApp function from your entry point.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
|
||||
#elif defined(__IOS__)
|
||||
/* On iOS SDL provides a main function that creates an application delegate
|
||||
and starts the iOS application run loop.
|
||||
#elif defined(SDL_PLATFORM_IOS)
|
||||
/* On iOS SDL provides a main function that creates an application delegate
|
||||
and starts the iOS application run loop.
|
||||
|
||||
To use it, just #include SDL_main.h in the source file that contains your
|
||||
main() function.
|
||||
To use it, just #include SDL_main.h in the source file that contains your
|
||||
main() function.
|
||||
|
||||
See src/video/uikit/SDL_uikitappdelegate.m for more details.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
See src/video/uikit/SDL_uikitappdelegate.m for more details.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
|
||||
#elif defined(__ANDROID__)
|
||||
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
||||
main activity entry point.
|
||||
#elif defined(SDL_PLATFORM_ANDROID)
|
||||
/* On Android SDL provides a Java class in SDLActivity.java that is the
|
||||
main activity entry point.
|
||||
|
||||
See docs/README-android.md for more details on extending that class.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
See docs/README-android.md for more details on extending that class.
|
||||
*/
|
||||
#define SDL_MAIN_NEEDED
|
||||
|
||||
/* We need to export SDL_main so it can be launched from Java */
|
||||
#define SDLMAIN_DECLSPEC DECLSPEC
|
||||
/* We need to export SDL_main so it can be launched from Java */
|
||||
#define SDLMAIN_DECLSPEC DECLSPEC
|
||||
|
||||
#elif defined(__PSP__)
|
||||
/* On PSP SDL provides a main function that sets the module info,
|
||||
activates the GPU and starts the thread required to be able to exit
|
||||
the software.
|
||||
#elif defined(SDL_PLATFORM_PSP)
|
||||
/* On PSP SDL provides a main function that sets the module info,
|
||||
activates the GPU and starts the thread required to be able to exit
|
||||
the software.
|
||||
|
||||
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
|
||||
#elif defined(__PS2__)
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
#elif defined(SDL_PLATFORM_PS2)
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
|
||||
#define SDL_PS2_SKIP_IOP_RESET() \
|
||||
void reset_IOP(); \
|
||||
void reset_IOP() {}
|
||||
#define SDL_PS2_SKIP_IOP_RESET() \
|
||||
void reset_IOP(); \
|
||||
void reset_IOP() {}
|
||||
|
||||
#elif defined(__3DS__)
|
||||
/*
|
||||
On N3DS, SDL provides a main function that sets up the screens
|
||||
and storage.
|
||||
#elif defined(SDL_PLATFORM_3DS)
|
||||
/*
|
||||
On N3DS, SDL provides a main function that sets up the screens
|
||||
and storage.
|
||||
|
||||
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
|
||||
#elif defined(__NGAGE__)
|
||||
#elif defined(SDL_PLATFORM_NGAGE)
|
||||
/*
|
||||
TODO: not sure if it should be SDL_MAIN_NEEDED, in SDL2 ngage had a
|
||||
main implementation, but wasn't mentioned in SDL_main.h
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
|
||||
/*
|
||||
TODO: not sure if it should be SDL_MAIN_NEEDED, in SDL2 ngage had a
|
||||
main implementation, but wasn't mentioned in SDL_main.h
|
||||
*/
|
||||
#define SDL_MAIN_AVAILABLE
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif /* SDL_MAIN_HANDLED */
|
||||
|
||||
#ifndef SDLMAIN_DECLSPEC
|
||||
@ -150,7 +150,7 @@
|
||||
*/
|
||||
|
||||
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) || defined(SDL_MAIN_USE_CALLBACKS)
|
||||
#define main SDL_main
|
||||
#define main SDL_main
|
||||
#endif
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
@ -158,10 +158,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int (SDLCALL *SDL_AppInit_func)(int argc, char *argv[]);
|
||||
typedef int (SDLCALL *SDL_AppIterate_func)(void);
|
||||
typedef int (SDLCALL *SDL_AppEvent_func)(const SDL_Event *event);
|
||||
typedef void (SDLCALL *SDL_AppQuit_func)(void);
|
||||
typedef int (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]);
|
||||
typedef int (SDLCALL *SDL_AppIterate_func)(void *appstate);
|
||||
typedef int (SDLCALL *SDL_AppEvent_func)(void *appstate, const SDL_Event *event);
|
||||
typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate);
|
||||
|
||||
/**
|
||||
* You can (optionally!) define SDL_MAIN_USE_CALLBACKS before including
|
||||
@ -203,6 +203,12 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void);
|
||||
* This function should not go into an infinite mainloop; it should do any
|
||||
* one-time setup it requires and then return.
|
||||
*
|
||||
* The app may optionally assign a pointer to `*appstate`. This pointer will
|
||||
* be provided on every future call to the other entry points, to allow
|
||||
* application state to be preserved between functions without the app
|
||||
* needing to use a global variable. If this isn't set, the pointer will
|
||||
* be NULL in future entry points.
|
||||
*
|
||||
* If this function returns 0, the app will proceed to normal operation,
|
||||
* and will begin receiving repeated calls to SDL_AppIterate and SDL_AppEvent
|
||||
* for the life of the program. If this function returns < 0, SDL will
|
||||
@ -210,6 +216,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void);
|
||||
* an error to the platform. If it returns > 0, the SDL calls SDL_AppQuit
|
||||
* and terminates with an exit code that reports success to the platform.
|
||||
*
|
||||
* \param appstate a place where the app can optionally store a pointer for future use.
|
||||
* \param argc The standard ANSI C main's argc; number of elements in `argv`
|
||||
* \param argv The standard ANSI C main's argv; array of command line arguments.
|
||||
* \returns -1 to terminate with an error, 1 to terminate with success, 0 to continue.
|
||||
@ -222,7 +229,7 @@ typedef void (SDLCALL *SDL_AppQuit_func)(void);
|
||||
* \sa SDL_AppEvent
|
||||
* \sa SDL_AppQuit
|
||||
*/
|
||||
extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(int argc, char *argv[]);
|
||||
extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(void **appstate, int argc, char *argv[]);
|
||||
|
||||
/**
|
||||
* App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps.
|
||||
@ -248,6 +255,9 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(int argc, char *argv[]);
|
||||
* This function should not go into an infinite mainloop; it should do one
|
||||
* iteration of whatever the program does and return.
|
||||
*
|
||||
* The `appstate` parameter is an optional pointer provided by the app during
|
||||
* SDL_AppInit(). If the app never provided a pointer, this will be NULL.
|
||||
*
|
||||
* If this function returns 0, the app will continue normal operation,
|
||||
* receiving repeated calls to SDL_AppIterate and SDL_AppEvent for the life
|
||||
* of the program. If this function returns < 0, SDL will call SDL_AppQuit
|
||||
@ -255,6 +265,7 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(int argc, char *argv[]);
|
||||
* platform. If it returns > 0, the SDL calls SDL_AppQuit and terminates with
|
||||
* an exit code that reports success to the platform.
|
||||
*
|
||||
* \param appstate an optional pointer, provided by the app in SDL_AppInit.
|
||||
* \returns -1 to terminate with an error, 1 to terminate with success, 0 to continue.
|
||||
*
|
||||
* \threadsafety This function is not thread safe.
|
||||
@ -263,9 +274,8 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppInit(int argc, char *argv[]);
|
||||
*
|
||||
* \sa SDL_AppInit
|
||||
* \sa SDL_AppEvent
|
||||
* \sa SDL_AppQuit
|
||||
*/
|
||||
extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void);
|
||||
extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void *appstate);
|
||||
|
||||
/**
|
||||
* App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps.
|
||||
@ -294,6 +304,9 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void);
|
||||
* This function should not go into an infinite mainloop; it should handle
|
||||
* the provided event appropriately and return.
|
||||
*
|
||||
* The `appstate` parameter is an optional pointer provided by the app during
|
||||
* SDL_AppInit(). If the app never provided a pointer, this will be NULL.
|
||||
*
|
||||
* If this function returns 0, the app will continue normal operation,
|
||||
* receiving repeated calls to SDL_AppIterate and SDL_AppEvent for the life
|
||||
* of the program. If this function returns < 0, SDL will call SDL_AppQuit
|
||||
@ -301,6 +314,8 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void);
|
||||
* platform. If it returns > 0, the SDL calls SDL_AppQuit and terminates with
|
||||
* an exit code that reports success to the platform.
|
||||
*
|
||||
* \param appstate an optional pointer, provided by the app in SDL_AppInit.
|
||||
* \param event the new event for the app to examine.
|
||||
* \returns -1 to terminate with an error, 1 to terminate with success, 0 to continue.
|
||||
*
|
||||
* \threadsafety This function is not thread safe.
|
||||
@ -309,9 +324,8 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppIterate(void);
|
||||
*
|
||||
* \sa SDL_AppInit
|
||||
* \sa SDL_AppIterate
|
||||
* \sa SDL_AppQuit
|
||||
*/
|
||||
extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(const SDL_Event *event);
|
||||
extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(void *appstate, const SDL_Event *event);
|
||||
|
||||
/**
|
||||
* App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps.
|
||||
@ -332,15 +346,20 @@ extern SDLMAIN_DECLSPEC int SDLCALL SDL_AppEvent(const SDL_Event *event);
|
||||
* it after this function returns and before the process terminates, but
|
||||
* it is safe to do so.
|
||||
*
|
||||
* The `appstate` parameter is an optional pointer provided by the app during
|
||||
* SDL_AppInit(). If the app never provided a pointer, this will be NULL.
|
||||
* This function call is the last time this pointer will be provided, so
|
||||
* any resources to it should be cleaned up here.
|
||||
*
|
||||
* \param appstate an optional pointer, provided by the app in SDL_AppInit.
|
||||
*
|
||||
* \threadsafety This function is not thread safe.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_AppInit
|
||||
* \sa SDL_AppIterate
|
||||
* \sa SDL_AppEvent
|
||||
*/
|
||||
extern SDLMAIN_DECLSPEC void SDLCALL SDL_AppQuit(void);
|
||||
extern SDLMAIN_DECLSPEC void SDLCALL SDL_AppQuit(void *appstate);
|
||||
|
||||
#endif /* SDL_MAIN_USE_CALLBACKS */
|
||||
|
||||
@ -422,7 +441,7 @@ extern DECLSPEC int SDLCALL SDL_RunApp(int argc, char* argv[], SDL_main_func mai
|
||||
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);
|
||||
|
||||
|
||||
#if defined(__WIN32__) || defined(__GDK__)
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
|
||||
/**
|
||||
* Register a win32 window class for SDL's use.
|
||||
@ -467,27 +486,9 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
|
||||
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
|
||||
|
||||
|
||||
#ifdef __WINRT__
|
||||
|
||||
/* for compatibility with SDL2's function of this name */
|
||||
#define SDL_WinRTRunApp(MAIN_FUNC, RESERVED) SDL_RunApp(0, NULL, MAIN_FUNC, RESERVED)
|
||||
|
||||
#endif /* __WINRT__ */
|
||||
|
||||
#ifdef __IOS__
|
||||
|
||||
/* for compatibility with SDL2's function of this name */
|
||||
#define SDL_UIKitRunApp(ARGC, ARGV, MAIN_FUNC) SDL_RunApp(ARGC, ARGV, MAIN_FUNC, NULL)
|
||||
|
||||
#endif /* __IOS__ */
|
||||
|
||||
#ifdef __GDK__
|
||||
|
||||
/* for compatibility with SDL2's function of this name */
|
||||
#define SDL_GDKRunApp(MAIN_FUNC, RESERVED) SDL_RunApp(0, NULL, MAIN_FUNC, RESERVED)
|
||||
#ifdef SDL_PLATFORM_GDK
|
||||
|
||||
/**
|
||||
* Callback from the application to let the suspend continue.
|
||||
@ -496,7 +497,7 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
||||
|
||||
#endif /* __GDK__ */
|
||||
#endif /* SDL_PLATFORM_GDK */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@ -505,31 +506,29 @@ extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#if !defined(SDL_MAIN_HANDLED) && !defined(SDL_MAIN_NOIMPL)
|
||||
/* include header-only SDL_main implementations */
|
||||
#if defined(SDL_MAIN_USE_CALLBACKS) \
|
||||
|| defined(__WIN32__) || defined(__GDK__) || defined(__IOS__) || defined(__TVOS__) \
|
||||
|| defined(__3DS__) || defined(__NGAGE__) || defined(__PS2__) || defined(__PSP__)
|
||||
/* include header-only SDL_main implementations */
|
||||
#if defined(SDL_MAIN_USE_CALLBACKS) \
|
||||
|| defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS) \
|
||||
|| defined(SDL_PLATFORM_3DS) || defined(SDL_PLATFORM_NGAGE) || defined(SDL_PLATFORM_PS2) || defined(SDL_PLATFORM_PSP)
|
||||
|
||||
/* platforms which main (-equivalent) can be implemented in plain C */
|
||||
#include <SDL3/SDL_main_impl.h>
|
||||
/* platforms which main (-equivalent) can be implemented in plain C */
|
||||
#include <SDL3/SDL_main_impl.h>
|
||||
|
||||
#elif defined(__WINRT__) /* C++ platforms */
|
||||
#elif defined(SDL_PLATFORM_WINRT) /* C++ platforms */
|
||||
#ifdef __cplusplus
|
||||
#include <SDL3/SDL_main_impl.h>
|
||||
#else
|
||||
/* Note: to get rid of the following warning, you can #define SDL_MAIN_NOIMPL before including SDL_main.h
|
||||
* in your C sourcefile that contains the standard main. Do *not* use SDL_MAIN_HANDLED for that, then SDL_main won't find your main()!
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma message("Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C (then continue including SDL_main.h there!) and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>")
|
||||
#elif defined(__GNUC__) /* gcc, clang, mingw and compatible are matched by this and have #warning */
|
||||
#warning "Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>"
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <SDL3/SDL_main_impl.h>
|
||||
#else
|
||||
/* Note: to get rid of the following warning, you can #define SDL_MAIN_NOIMPL before including SDL_main.h
|
||||
* in your C sourcefile that contains the standard main. Do *not* use SDL_MAIN_HANDLED for that, then SDL_main won't find your main()!
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma message("Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C (then continue including SDL_main.h there!) and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>")
|
||||
#elif defined(__GNUC__) /* gcc, clang, mingw and compatible are matched by this and have #warning */
|
||||
#warning "Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>"
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* C++ platforms like __WINRT__ etc */
|
||||
|
||||
#endif /* SDL_MAIN_HANDLED */
|
||||
#endif /* C++ platforms like SDL_PLATFORM_WINRT etc */
|
||||
#endif
|
||||
|
||||
#endif /* SDL_main_h_ */
|
||||
|
@ -35,181 +35,180 @@
|
||||
and main() is implemented in plain C */
|
||||
#if !defined(SDL_MAIN_HANDLED) && !defined(SDL_MAIN_NOIMPL)
|
||||
|
||||
/* the implementations below must be able to use the implement real main(), nothing renamed
|
||||
(the user's main() will be renamed to SDL_main so it can be called from here) */
|
||||
#ifdef main
|
||||
# undef main
|
||||
#endif /* main */
|
||||
/* the implementations below must be able to use the implement real main(), nothing renamed
|
||||
(the user's main() will be renamed to SDL_main so it can be called from here) */
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
|
||||
#ifdef SDL_MAIN_USE_CALLBACKS
|
||||
#ifdef SDL_MAIN_USE_CALLBACKS
|
||||
|
||||
#if 0
|
||||
/* currently there are no platforms that _need_ a magic entry point here
|
||||
for callbacks, but if one shows up, implement it here. */
|
||||
#if 0
|
||||
/* currently there are no platforms that _need_ a magic entry point here
|
||||
for callbacks, but if one shows up, implement it here. */
|
||||
|
||||
#else /* use a standard SDL_main, which the app SHOULD NOT ALSO SUPPLY. */
|
||||
#else /* use a standard SDL_main, which the app SHOULD NOT ALSO SUPPLY. */
|
||||
|
||||
/* this define makes the normal SDL_main entry point stuff work...we just provide SDL_main() instead of the app. */
|
||||
#define SDL_MAIN_CALLBACK_STANDARD 1
|
||||
/* this define makes the normal SDL_main entry point stuff work...we just provide SDL_main() instead of the app. */
|
||||
#define SDL_MAIN_CALLBACK_STANDARD 1
|
||||
|
||||
int SDL_main(int argc, char **argv)
|
||||
{
|
||||
return SDL_EnterAppMainCallbacks(argc, argv, SDL_AppInit, SDL_AppIterate, SDL_AppEvent, SDL_AppQuit);
|
||||
}
|
||||
int SDL_main(int argc, char **argv)
|
||||
{
|
||||
return SDL_EnterAppMainCallbacks(argc, argv, SDL_AppInit, SDL_AppIterate, SDL_AppEvent, SDL_AppQuit);
|
||||
}
|
||||
|
||||
#endif /* platform-specific tests */
|
||||
#endif /* platform-specific tests */
|
||||
|
||||
#endif /* SDL_MAIN_USE_CALLBACKS */
|
||||
#endif /* SDL_MAIN_USE_CALLBACKS */
|
||||
|
||||
|
||||
/* set up the usual SDL_main stuff if we're not using callbacks or if we are but need the normal entry point. */
|
||||
#if !defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)
|
||||
/* set up the usual SDL_main stuff if we're not using callbacks or if we are but need the normal entry point. */
|
||||
#if !defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD)
|
||||
|
||||
#if defined(__WIN32__) || defined(__GDK__)
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
|
||||
/* these defines/typedefs are needed for the WinMain() definition */
|
||||
#ifndef WINAPI
|
||||
#define WINAPI __stdcall
|
||||
#endif
|
||||
/* these defines/typedefs are needed for the WinMain() definition */
|
||||
#ifndef WINAPI
|
||||
#define WINAPI __stdcall
|
||||
#endif
|
||||
|
||||
typedef struct HINSTANCE__ * HINSTANCE;
|
||||
typedef char* LPSTR;
|
||||
typedef wchar_t* PWSTR;
|
||||
typedef struct HINSTANCE__ * HINSTANCE;
|
||||
typedef char* LPSTR;
|
||||
typedef wchar_t* PWSTR;
|
||||
|
||||
/* The VC++ compiler needs main/wmain defined, but not for GDK */
|
||||
#if defined(_MSC_VER) && !defined(__GDK__)
|
||||
/* The VC++ compiler needs main/wmain defined, but not for GDK */
|
||||
#if defined(_MSC_VER) && !defined(SDL_PLATFORM_GDK)
|
||||
|
||||
/* This is where execution begins [console apps] */
|
||||
#if defined( UNICODE ) && UNICODE
|
||||
int wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
|
||||
{
|
||||
(void)argc;
|
||||
(void)wargv;
|
||||
(void)wenvp;
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#else /* ANSI */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#endif /* UNICODE */
|
||||
/* This is where execution begins [console apps] */
|
||||
#if defined( UNICODE ) && UNICODE
|
||||
int wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
|
||||
{
|
||||
(void)argc;
|
||||
(void)wargv;
|
||||
(void)wenvp;
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#else /* ANSI */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#endif /* UNICODE */
|
||||
|
||||
#endif /* _MSC_VER && ! __GDK__ */
|
||||
#endif /* _MSC_VER && ! SDL_PLATFORM_GDK */
|
||||
|
||||
/* This is where execution begins [windowed apps and GDK] */
|
||||
/* This is where execution begins [windowed apps and GDK] */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if defined( UNICODE ) && UNICODE
|
||||
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, PWSTR szCmdLine, int sw)
|
||||
#else /* ANSI */
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
|
||||
#endif
|
||||
{
|
||||
(void)hInst;
|
||||
(void)hPrev;
|
||||
(void)szCmdLine;
|
||||
(void)sw;
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* end of __WIN32__ and __GDK__ impls */
|
||||
#elif defined(__WINRT__)
|
||||
#if defined( UNICODE ) && UNICODE
|
||||
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, PWSTR szCmdLine, int sw)
|
||||
#else /* ANSI */
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
|
||||
#endif
|
||||
{
|
||||
(void)hInst;
|
||||
(void)hPrev;
|
||||
(void)szCmdLine;
|
||||
(void)sw;
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
|
||||
/* WinRT main based on SDL_winrt_main_NonXAML.cpp, placed in the public domain by David Ludwig 3/13/14 */
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#include <wrl.h>
|
||||
/* end of SDL_PLATFORM_WIN32 and SDL_PLATFORM_GDK impls */
|
||||
|
||||
/* At least one file in any SDL/WinRT app appears to require compilation
|
||||
with C++/CX, otherwise a Windows Metadata file won't get created, and
|
||||
an APPX0702 build error can appear shortly after linking.
|
||||
#elif defined(SDL_PLATFORM_WINRT)
|
||||
|
||||
The following set of preprocessor code forces this file to be compiled
|
||||
as C++/CX, which appears to cause Visual C++ 2012's build tools to
|
||||
create this .winmd file, and will help allow builds of SDL/WinRT apps
|
||||
to proceed without error.
|
||||
/* WinRT main based on SDL_winrt_main_NonXAML.cpp, placed in the public domain by David Ludwig 3/13/14 */
|
||||
|
||||
If other files in an app's project enable C++/CX compilation, then it might
|
||||
be possible for the .cpp file including SDL_main.h to be compiled without /ZW,
|
||||
for Visual C++'s build tools to create a winmd file, and for the app to
|
||||
build without APPX0702 errors. In this case, if
|
||||
SDL_WINRT_METADATA_FILE_AVAILABLE is defined as a C/C++ macro, then
|
||||
the #error (to force C++/CX compilation) will be disabled.
|
||||
#include <wrl.h>
|
||||
|
||||
Please note that /ZW can be specified on a file-by-file basis. To do this,
|
||||
right click on the file in Visual C++, click Properties, then change the
|
||||
setting through the dialog that comes up.
|
||||
*/
|
||||
#ifndef SDL_WINRT_METADATA_FILE_AVAILABLE
|
||||
#if !defined(__cplusplus) || !defined(__cplusplus_winrt)
|
||||
#error The C++ file that includes SDL_main.h must be compiled as C++ code with /ZW, otherwise build errors due to missing .winmd files can occur.
|
||||
#endif
|
||||
#endif
|
||||
/* At least one file in any SDL/WinRT app appears to require compilation
|
||||
with C++/CX, otherwise a Windows Metadata file won't get created, and
|
||||
an APPX0702 build error can appear shortly after linking.
|
||||
|
||||
/* Prevent MSVC++ from warning about threading models when defining our
|
||||
custom WinMain. The threading model will instead be set via a direct
|
||||
call to Windows::Foundation::Initialize (rather than via an attributed
|
||||
function).
|
||||
The following set of preprocessor code forces this file to be compiled
|
||||
as C++/CX, which appears to cause Visual C++ 2012's build tools to
|
||||
create this .winmd file, and will help allow builds of SDL/WinRT apps
|
||||
to proceed without error.
|
||||
|
||||
To note, this warning (C4447) does not seem to come up unless this file
|
||||
is compiled with C++/CX enabled (via the /ZW compiler flag).
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4447)
|
||||
#endif
|
||||
If other files in an app's project enable C++/CX compilation, then it might
|
||||
be possible for the .cpp file including SDL_main.h to be compiled without /ZW,
|
||||
for Visual C++'s build tools to create a winmd file, and for the app to
|
||||
build without APPX0702 errors. In this case, if
|
||||
SDL_WINRT_METADATA_FILE_AVAILABLE is defined as a C/C++ macro, then
|
||||
the #error (to force C++/CX compilation) will be disabled.
|
||||
|
||||
/* Make sure the function to initialize the Windows Runtime gets linked in. */
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "runtimeobject.lib")
|
||||
#endif
|
||||
Please note that /ZW can be specified on a file-by-file basis. To do this,
|
||||
right click on the file in Visual C++, click Properties, then change the
|
||||
setting through the dialog that comes up.
|
||||
*/
|
||||
#ifndef SDL_WINRT_METADATA_FILE_AVAILABLE
|
||||
#if !defined(__cplusplus) || !defined(__cplusplus_winrt)
|
||||
#error The C++ file that includes SDL_main.h must be compiled as C++ code with /ZW, otherwise build errors due to missing .winmd files can occur.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
/* Prevent MSVC++ from warning about threading models when defining our
|
||||
custom WinMain. The threading model will instead be set via a direct
|
||||
call to Windows::Foundation::Initialize (rather than via an attributed
|
||||
function).
|
||||
|
||||
/* end of WinRT impl */
|
||||
#elif defined(__NGAGE__)
|
||||
To note, this warning (C4447) does not seem to come up unless this file
|
||||
is compiled with C++/CX enabled (via the /ZW compiler flag).
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4447)
|
||||
/* Make sure the function to initialize the Windows Runtime gets linked in. */
|
||||
#pragma comment(lib, "runtimeobject.lib")
|
||||
#endif
|
||||
|
||||
/* same typedef as in ngage SDKs e32def.h */
|
||||
typedef signed int TInt;
|
||||
/* TODO: if it turns out that this only works when built as C++,
|
||||
move __NGAGE__ into the C++ section in SDL_main.h */
|
||||
TInt E32Main()
|
||||
{
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
{
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
/* end of __NGAGE__ impl */
|
||||
/* end of WinRT impl */
|
||||
|
||||
#else /* platforms that use a standard main() and just call SDL_RunApp(), like iOS and 3DS */
|
||||
#elif defined(SDL_PLATFORM_NGAGE)
|
||||
/* same typedef as in ngage SDKs e32def.h */
|
||||
typedef signed int TInt;
|
||||
/* TODO: if it turns out that this only works when built as C++,
|
||||
move SDL_PLATFORM_NGAGE into the C++ section in SDL_main.h */
|
||||
TInt E32Main()
|
||||
{
|
||||
return SDL_RunApp(0, NULL, SDL_main, NULL);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return SDL_RunApp(argc, argv, SDL_main, NULL);
|
||||
}
|
||||
/* end of SDL_PLATFORM_NGAGE impl */
|
||||
|
||||
/* end of impls for standard-conforming platforms */
|
||||
#else /* platforms that use a standard main() and just call SDL_RunApp(), like iOS and 3DS */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return SDL_RunApp(argc, argv, SDL_main, NULL);
|
||||
}
|
||||
|
||||
#endif /* __WIN32__ etc */
|
||||
/* end of impls for standard-conforming platforms */
|
||||
|
||||
#endif /* !defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD) */
|
||||
#endif /* SDL_PLATFORM_WIN32 etc */
|
||||
|
||||
/* rename users main() function to SDL_main() so it can be called from the wrappers above */
|
||||
#define main SDL_main
|
||||
#endif /* !defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_CALLBACK_STANDARD) */
|
||||
|
||||
/* rename users main() function to SDL_main() so it can be called from the wrappers above */
|
||||
#define main SDL_main
|
||||
|
||||
#endif /* SDL_MAIN_HANDLED */
|
||||
|
||||
|
@ -58,8 +58,8 @@ typedef enum
|
||||
typedef struct
|
||||
{
|
||||
Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */
|
||||
int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */
|
||||
const char * text; /**< The UTF-8 button text */
|
||||
int buttonID; /**< User defined button id (value returned via SDL_ShowMessageBox) */
|
||||
const char *text; /**< The UTF-8 button text */
|
||||
} SDL_MessageBoxButtonData;
|
||||
|
||||
/**
|
||||
|
@ -89,8 +89,6 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
|
||||
* \returns a pointer
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Metal_CreateView
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
||||
|
||||
|
@ -81,6 +81,52 @@ typedef enum
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/**
|
||||
* Return whether a mouse is currently connected.
|
||||
*
|
||||
* \returns SDL_TRUE if a mouse is connected, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetMice
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void);
|
||||
|
||||
/**
|
||||
* Get a list of currently connected mice.
|
||||
*
|
||||
* Note that this will include any device or virtual driver that includes
|
||||
* mouse functionality, including some game controllers, KVM switches, etc.
|
||||
* You should wait for input from a device before you consider it actively in
|
||||
* use.
|
||||
*
|
||||
* \param count a pointer filled in with the number of mice returned
|
||||
* \returns a 0 terminated array of mouse instance IDs which should be freed
|
||||
* with SDL_free(), or NULL on error; call SDL_GetError() for more
|
||||
* details.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetMouseInstanceName
|
||||
* \sa SDL_HasMouse
|
||||
*/
|
||||
extern DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count);
|
||||
|
||||
/**
|
||||
* Get the name of a mouse.
|
||||
*
|
||||
* This function returns "" if the mouse doesn't have a name.
|
||||
*
|
||||
* \param instance_id the mouse instance ID
|
||||
* \returns the name of the selected mouse, or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetMice
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetMouseInstanceName(SDL_MouseID instance_id);
|
||||
|
||||
/**
|
||||
* Get the window which currently has mouse focus.
|
||||
*
|
||||
@ -109,7 +155,6 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
|
||||
*
|
||||
* \sa SDL_GetGlobalMouseState
|
||||
* \sa SDL_GetRelativeMouseState
|
||||
* \sa SDL_PumpEvents
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(float *x, float *y);
|
||||
|
||||
@ -139,6 +184,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(float *x, float *y);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CaptureMouse
|
||||
* \sa SDL_GetMouseState
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(float *x, float *y);
|
||||
|
||||
@ -239,8 +285,8 @@ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
||||
* mouse while the user is dragging something, until the user releases a mouse
|
||||
* button. It is not recommended that you capture the mouse for long periods
|
||||
* of time, such as the entire time your app is running. For that, you should
|
||||
* probably use SDL_SetRelativeMouseMode() or SDL_SetWindowGrab(), depending
|
||||
* on your goals.
|
||||
* probably use SDL_SetRelativeMouseMode() or SDL_SetWindowMouseGrab(),
|
||||
* depending on your goals.
|
||||
*
|
||||
* While captured, mouse events still report coordinates relative to the
|
||||
* current (foreground) window, but those coordinates may be outside the
|
||||
@ -318,6 +364,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateColorCursor
|
||||
* \sa SDL_CreateSystemCursor
|
||||
* \sa SDL_DestroyCursor
|
||||
* \sa SDL_SetCursor
|
||||
*/
|
||||
@ -338,7 +386,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateCursor
|
||||
* \sa SDL_CreateSystemCursor
|
||||
* \sa SDL_DestroyCursor
|
||||
* \sa SDL_SetCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
|
||||
int hot_x,
|
||||
@ -371,7 +421,6 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateCursor
|
||||
* \sa SDL_GetCursor
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
|
||||
@ -399,8 +448,6 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
||||
* \returns the default cursor on success or NULL on failure.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSystemCursor
|
||||
*/
|
||||
extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
|
||||
|
||||
|
@ -171,6 +171,9 @@ extern DECLSPEC SDL_Mutex *SDLCALL SDL_CreateMutex(void);
|
||||
* \param mutex the mutex to lock
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_TryLockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
|
||||
|
||||
@ -193,8 +196,6 @@ extern DECLSPEC void SDLCALL SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateMutex
|
||||
* \sa SDL_DestroyMutex
|
||||
* \sa SDL_LockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
@ -213,6 +214,9 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_Mutex *mutex) SDL_TRY_ACQUIRE(0
|
||||
* \param mutex the mutex to unlock.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LockMutex
|
||||
* \sa SDL_TryLockMutex
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(mutex);
|
||||
|
||||
@ -230,9 +234,6 @@ extern DECLSPEC void SDLCALL SDL_UnlockMutex(SDL_Mutex *mutex) SDL_RELEASE(mutex
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateMutex
|
||||
* \sa SDL_LockMutex
|
||||
* \sa SDL_TryLockMutex
|
||||
* \sa SDL_UnlockMutex
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_Mutex *mutex);
|
||||
|
||||
@ -290,8 +291,8 @@ typedef struct SDL_RWLock SDL_RWLock;
|
||||
*
|
||||
* \sa SDL_DestroyRWLock
|
||||
* \sa SDL_LockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_LockRWLockForWriting
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
@ -328,6 +329,8 @@ extern DECLSPEC SDL_RWLock *SDLCALL SDL_CreateRWLock(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LockRWLockForWriting
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_ACQUIRE_SHARED(rwlock);
|
||||
@ -357,6 +360,8 @@ extern DECLSPEC void SDLCALL SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_AC
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_ACQUIRE(rwlock);
|
||||
@ -383,9 +388,8 @@ extern DECLSPEC void SDLCALL SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_AC
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateRWLock
|
||||
* \sa SDL_DestroyRWLock
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_LockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE_SHARED(0, rwlock);
|
||||
@ -417,9 +421,8 @@ extern DECLSPEC int SDLCALL SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) SDL_
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateRWLock
|
||||
* \sa SDL_DestroyRWLock
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_LockRWLockForWriting
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_TRY_ACQUIRE(0, rwlock);
|
||||
@ -441,6 +444,11 @@ extern DECLSPEC int SDLCALL SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) SDL_
|
||||
* \param rwlock the rwlock to unlock.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LockRWLockForReading
|
||||
* \sa SDL_LockRWLockForWriting
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEASE_GENERIC(rwlock);
|
||||
|
||||
@ -458,11 +466,6 @@ extern DECLSPEC void SDLCALL SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_RELEASE_GE
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateRWLock
|
||||
* \sa SDL_LockRWLockForReading
|
||||
* \sa SDL_LockRWLockForWriting
|
||||
* \sa SDL_TryLockRWLockForReading
|
||||
* \sa SDL_TryLockRWLockForWriting
|
||||
* \sa SDL_UnlockRWLock
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyRWLock(SDL_RWLock *rwlock);
|
||||
|
||||
@ -513,11 +516,6 @@ extern DECLSPEC SDL_Semaphore *SDLCALL SDL_CreateSemaphore(Uint32 initial_value)
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
* \sa SDL_PostSemaphore
|
||||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_GetSemaphoreValue
|
||||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
|
||||
|
||||
@ -538,12 +536,8 @@ extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
* \sa SDL_DestroySemaphore
|
||||
* \sa SDL_PostSemaphore
|
||||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_GetSemaphoreValue
|
||||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
||||
@ -563,10 +557,7 @@ extern DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
* \sa SDL_DestroySemaphore
|
||||
* \sa SDL_PostSemaphore
|
||||
* \sa SDL_GetSemaphoreValue
|
||||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
@ -588,11 +579,8 @@ extern DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
* \sa SDL_DestroySemaphore
|
||||
* \sa SDL_PostSemaphore
|
||||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_GetSemaphoreValue
|
||||
* \sa SDL_WaitSemaphore
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS);
|
||||
@ -606,10 +594,7 @@ extern DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
* \sa SDL_DestroySemaphore
|
||||
* \sa SDL_TryWaitSemaphore
|
||||
* \sa SDL_GetSemaphoreValue
|
||||
* \sa SDL_WaitSemaphore
|
||||
* \sa SDL_WaitSemaphoreTimeout
|
||||
*/
|
||||
@ -622,8 +607,6 @@ extern DECLSPEC int SDLCALL SDL_PostSemaphore(SDL_Semaphore *sem);
|
||||
* \returns the current value of the semaphore.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateSemaphore
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetSemaphoreValue(SDL_Semaphore *sem);
|
||||
|
||||
@ -662,10 +645,6 @@ extern DECLSPEC SDL_Condition *SDLCALL SDL_CreateCondition(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BroadcastCondition
|
||||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
* \sa SDL_CreateCondition
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
|
||||
@ -682,8 +661,6 @@ extern DECLSPEC void SDLCALL SDL_DestroyCondition(SDL_Condition *cond);
|
||||
* \sa SDL_BroadcastCondition
|
||||
* \sa SDL_WaitCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
* \sa SDL_CreateCondition
|
||||
* \sa SDL_DestroyCondition
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
|
||||
|
||||
@ -699,8 +676,6 @@ extern DECLSPEC int SDLCALL SDL_SignalCondition(SDL_Condition *cond);
|
||||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
* \sa SDL_CreateCondition
|
||||
* \sa SDL_DestroyCondition
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
|
||||
|
||||
@ -729,8 +704,6 @@ extern DECLSPEC int SDLCALL SDL_BroadcastCondition(SDL_Condition *cond);
|
||||
* \sa SDL_BroadcastCondition
|
||||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitConditionTimeout
|
||||
* \sa SDL_CreateCondition
|
||||
* \sa SDL_DestroyCondition
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex);
|
||||
|
||||
@ -760,8 +733,6 @@ extern DECLSPEC int SDLCALL SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mu
|
||||
* \sa SDL_BroadcastCondition
|
||||
* \sa SDL_SignalCondition
|
||||
* \sa SDL_WaitCondition
|
||||
* \sa SDL_CreateCondition
|
||||
* \sa SDL_DestroyCondition
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_WaitConditionTimeout(SDL_Condition *cond,
|
||||
SDL_Mutex *mutex, Sint32 timeoutMS);
|
||||
|
@ -40,6 +40,11 @@
|
||||
#ifdef SDL_ENABLE_OLD_NAMES
|
||||
|
||||
/* ##SDL_atomic.h */
|
||||
#define SDL_AtomicCAS SDL_AtomicCompareAndSwap
|
||||
#define SDL_AtomicCASPtr SDL_AtomicCompareAndSwapPointer
|
||||
#define SDL_AtomicLock SDL_LockSpinlock
|
||||
#define SDL_AtomicTryLock SDL_TryLockSpinlock
|
||||
#define SDL_AtomicUnlock SDL_UnlockSpinlock
|
||||
#define SDL_atomic_t SDL_AtomicInt
|
||||
|
||||
/* ##SDL_audio.h */
|
||||
@ -64,6 +69,7 @@
|
||||
#define SDL_AudioStreamPut SDL_PutAudioStreamData
|
||||
#define SDL_FreeAudioStream SDL_DestroyAudioStream
|
||||
#define SDL_FreeWAV SDL_free
|
||||
#define SDL_LoadWAV_RW SDL_LoadWAV_IO
|
||||
#define SDL_NewAudioStream SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_events.h */
|
||||
@ -110,6 +116,7 @@
|
||||
#define SDL_JOYBUTTONUP SDL_EVENT_JOYSTICK_BUTTON_UP
|
||||
#define SDL_JOYDEVICEADDED SDL_EVENT_JOYSTICK_ADDED
|
||||
#define SDL_JOYDEVICEREMOVED SDL_EVENT_JOYSTICK_REMOVED
|
||||
#define SDL_JOYBALLMOTION SDL_EVENT_JOYSTICK_BALL_MOTION
|
||||
#define SDL_JOYHATMOTION SDL_EVENT_JOYSTICK_HAT_MOTION
|
||||
#define SDL_KEYDOWN SDL_EVENT_KEY_DOWN
|
||||
#define SDL_KEYMAPCHANGED SDL_EVENT_KEYMAP_CHANGED
|
||||
@ -198,7 +205,7 @@
|
||||
#define SDL_GameController SDL_Gamepad
|
||||
#define SDL_GameControllerAddMapping SDL_AddGamepadMapping
|
||||
#define SDL_GameControllerAddMappingsFromFile SDL_AddGamepadMappingsFromFile
|
||||
#define SDL_GameControllerAddMappingsFromRW SDL_AddGamepadMappingsFromRW
|
||||
#define SDL_GameControllerAddMappingsFromRW SDL_AddGamepadMappingsFromIO
|
||||
#define SDL_GameControllerAxis SDL_GamepadAxis
|
||||
#define SDL_GameControllerBindType SDL_GamepadBindingType
|
||||
#define SDL_GameControllerButton SDL_GamepadButton
|
||||
@ -230,9 +237,6 @@
|
||||
#define SDL_GameControllerGetVendor SDL_GetGamepadVendor
|
||||
#define SDL_GameControllerHasAxis SDL_GamepadHasAxis
|
||||
#define SDL_GameControllerHasButton SDL_GamepadHasButton
|
||||
#define SDL_GameControllerHasLED SDL_GamepadHasLED
|
||||
#define SDL_GameControllerHasRumble SDL_GamepadHasRumble
|
||||
#define SDL_GameControllerHasRumbleTriggers SDL_GamepadHasRumbleTriggers
|
||||
#define SDL_GameControllerHasSensor SDL_GamepadHasSensor
|
||||
#define SDL_GameControllerIsSensorEnabled SDL_GamepadSensorEnabled
|
||||
#define SDL_GameControllerMapping SDL_GetGamepadMapping
|
||||
@ -251,6 +255,43 @@
|
||||
#define SDL_INIT_GAMECONTROLLER SDL_INIT_GAMEPAD
|
||||
#define SDL_IsGameController SDL_IsGamepad
|
||||
|
||||
/* ##SDL_haptic.h */
|
||||
#define SDL_HapticClose SDL_CloseHaptic
|
||||
#define SDL_HapticDestroyEffect SDL_DestroyHapticEffect
|
||||
#define SDL_HapticGetEffectStatus SDL_GetHapticEffectStatus
|
||||
#define SDL_HapticNewEffect SDL_CreateHapticEffect
|
||||
#define SDL_HapticNumAxes SDL_GetNumHapticAxes
|
||||
#define SDL_HapticNumEffects SDL_GetMaxHapticEffects
|
||||
#define SDL_HapticNumEffectsPlaying SDL_GetMaxHapticEffectsPlaying
|
||||
#define SDL_HapticOpen SDL_OpenHaptic
|
||||
#define SDL_HapticOpenFromJoystick SDL_OpenHapticFromJoystick
|
||||
#define SDL_HapticOpenFromMouse SDL_OpenHapticFromMouse
|
||||
#define SDL_HapticPause SDL_PauseHaptic
|
||||
#define SDL_HapticQuery SDL_GetHapticFeatures
|
||||
#define SDL_HapticRumbleInit SDL_InitHapticRumble
|
||||
#define SDL_HapticRumblePlay SDL_PlayHapticRumble
|
||||
#define SDL_HapticRumbleStop SDL_StopHapticRumble
|
||||
#define SDL_HapticRunEffect SDL_RunHapticEffect
|
||||
#define SDL_HapticSetAutocenter SDL_SetHapticAutocenter
|
||||
#define SDL_HapticSetGain SDL_SetHapticGain
|
||||
#define SDL_HapticStopAll SDL_StopHapticEffects
|
||||
#define SDL_HapticStopEffect SDL_StopHapticEffect
|
||||
#define SDL_HapticUnpause SDL_ResumeHaptic
|
||||
#define SDL_HapticUpdateEffect SDL_UpdateHapticEffect
|
||||
#define SDL_JoystickIsHaptic SDL_IsJoystickHaptic
|
||||
#define SDL_MouseIsHaptic SDL_IsMouseHaptic
|
||||
|
||||
/* ##SDL_hints.h */
|
||||
#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST
|
||||
#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT
|
||||
#define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
|
||||
#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE
|
||||
#define SDL_HINT_LINUX_DIGITAL_HATS SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS
|
||||
#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
|
||||
#define SDL_JoystickAttachVirtual SDL_AttachVirtualJoystick
|
||||
@ -263,6 +304,7 @@
|
||||
#define SDL_JoystickGetAttached SDL_JoystickConnected
|
||||
#define SDL_JoystickGetAxis SDL_GetJoystickAxis
|
||||
#define SDL_JoystickGetAxisInitialState SDL_GetJoystickAxisInitialState
|
||||
#define SDL_JoystickGetBall SDL_GetJoystickBall
|
||||
#define SDL_JoystickGetButton SDL_GetJoystickButton
|
||||
#define SDL_JoystickGetFirmwareVersion SDL_GetJoystickFirmwareVersion
|
||||
#define SDL_JoystickGetGUID SDL_GetJoystickGUID
|
||||
@ -279,6 +321,7 @@
|
||||
#define SDL_JoystickIsVirtual SDL_IsJoystickVirtual
|
||||
#define SDL_JoystickName SDL_GetJoystickName
|
||||
#define SDL_JoystickNumAxes SDL_GetNumJoystickAxes
|
||||
#define SDL_JoystickNumBalls SDL_GetNumJoystickBalls
|
||||
#define SDL_JoystickNumButtons SDL_GetNumJoystickButtons
|
||||
#define SDL_JoystickNumHats SDL_GetNumJoystickHats
|
||||
#define SDL_JoystickOpen SDL_OpenJoystick
|
||||
@ -296,7 +339,6 @@
|
||||
/* ##SDL_keyboard.h */
|
||||
#define SDL_IsScreenKeyboardShown SDL_ScreenKeyboardShown
|
||||
#define SDL_IsTextInputActive SDL_TextInputActive
|
||||
#define SDL_IsTextInputShown SDL_TextInputShown
|
||||
|
||||
/* ##SDL_keycode.h */
|
||||
#define KMOD_ALT SDL_KMOD_ALT
|
||||
@ -318,6 +360,10 @@
|
||||
#define KMOD_SCROLL SDL_KMOD_SCROLL
|
||||
#define KMOD_SHIFT SDL_KMOD_SHIFT
|
||||
|
||||
/* ##SDL_log.h */
|
||||
#define SDL_LogGetOutputFunction SDL_GetLogOutputFunction
|
||||
#define SDL_LogSetOutputFunction SDL_SetLogOutputFunction
|
||||
|
||||
/* ##SDL_mouse.h */
|
||||
#define SDL_FreeCursor SDL_DestroyCursor
|
||||
|
||||
@ -349,14 +395,6 @@
|
||||
#define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_XRGB8888
|
||||
#define SDL_PixelFormatEnumToMasks SDL_GetMasksForPixelFormatEnum
|
||||
|
||||
/* ##SDL_platform.h */
|
||||
#ifdef __IOS__
|
||||
#define __IPHONEOS__ __IOS__
|
||||
#endif
|
||||
#ifdef __MACOS__
|
||||
#define __MACOSX__ __MACOS__
|
||||
#endif
|
||||
|
||||
/* ##SDL_rect.h */
|
||||
#define SDL_EncloseFPoints SDL_GetRectEnclosingPointsFloat
|
||||
#define SDL_EnclosePoints SDL_GetRectEnclosingPoints
|
||||
@ -415,11 +453,19 @@
|
||||
#define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST
|
||||
|
||||
/* ##SDL_rwops.h */
|
||||
#define RW_SEEK_CUR SDL_RW_SEEK_CUR
|
||||
#define RW_SEEK_END SDL_RW_SEEK_END
|
||||
#define RW_SEEK_SET SDL_RW_SEEK_SET
|
||||
#define SDL_AllocRW SDL_CreateRW
|
||||
#define SDL_FreeRW SDL_DestroyRW
|
||||
#define RW_SEEK_CUR SDL_IO_SEEK_CUR
|
||||
#define RW_SEEK_END SDL_IO_SEEK_END
|
||||
#define RW_SEEK_SET SDL_IO_SEEK_SET
|
||||
#define SDL_RWFromConstMem SDL_IOFromConstMem
|
||||
#define SDL_RWFromFile SDL_IOFromFile
|
||||
#define SDL_RWFromMem SDL_IOFromMem
|
||||
#define SDL_RWclose SDL_CloseIO
|
||||
#define SDL_RWops SDL_IOStream
|
||||
#define SDL_RWread SDL_ReadIO
|
||||
#define SDL_RWseek SDL_SeekIO
|
||||
#define SDL_RWsize SDL_GetIOSize
|
||||
#define SDL_RWtell SDL_TellIO
|
||||
#define SDL_RWwrite SDL_WriteIO
|
||||
#define SDL_ReadBE16 SDL_ReadU16BE
|
||||
#define SDL_ReadBE32 SDL_ReadU32BE
|
||||
#define SDL_ReadBE64 SDL_ReadU64BE
|
||||
@ -455,8 +501,10 @@
|
||||
#define SDL_GetColorKey SDL_GetSurfaceColorKey
|
||||
#define SDL_HasColorKey SDL_SurfaceHasColorKey
|
||||
#define SDL_HasSurfaceRLE SDL_SurfaceHasRLE
|
||||
#define SDL_LoadBMP_RW SDL_LoadBMP_IO
|
||||
#define SDL_LowerBlit SDL_BlitSurfaceUnchecked
|
||||
#define SDL_LowerBlitScaled SDL_BlitSurfaceUncheckedScaled
|
||||
#define SDL_SaveBMP_RW SDL_SaveBMP_IO
|
||||
#define SDL_SetClipRect SDL_SetSurfaceClipRect
|
||||
#define SDL_SetColorKey SDL_SetSurfaceColorKey
|
||||
#define SDL_UpperBlit SDL_BlitSurface
|
||||
@ -467,10 +515,14 @@
|
||||
#define SDL_TLSCreate SDL_CreateTLS
|
||||
#define SDL_TLSGet SDL_GetTLS
|
||||
#define SDL_TLSSet SDL_SetTLS
|
||||
#define SDL_threadID SDL_ThreadID
|
||||
|
||||
/* ##SDL_timer.h */
|
||||
#define SDL_GetTicks64 SDL_GetTicks
|
||||
|
||||
/* ##SDL_version.h */
|
||||
#define SDL_version SDL_Version
|
||||
|
||||
/* ##SDL_video.h */
|
||||
#define SDL_GetClosestDisplayMode SDL_GetClosestFullscreenDisplayMode
|
||||
#define SDL_GetDisplayOrientation SDL_GetCurrentDisplayOrientation
|
||||
@ -478,6 +530,7 @@
|
||||
#define SDL_GetRectDisplayIndex SDL_GetDisplayForRect
|
||||
#define SDL_GetWindowDisplayIndex SDL_GetDisplayForWindow
|
||||
#define SDL_GetWindowDisplayMode SDL_GetWindowFullscreenMode
|
||||
#define SDL_HasWindowSurface SDL_WindowHasSurface
|
||||
#define SDL_IsScreenSaverEnabled SDL_ScreenSaverEnabled
|
||||
#define SDL_SetWindowDisplayMode SDL_SetWindowFullscreenMode
|
||||
#define SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_HIGH_PIXEL_DENSITY
|
||||
@ -486,6 +539,13 @@
|
||||
|
||||
#elif !defined(SDL_DISABLE_OLD_NAMES)
|
||||
|
||||
/* ##SDL_atomic.h */
|
||||
#define SDL_AtomicCAS SDL_AtomicCAS_renamed_SDL_AtomicCompareAndSwap
|
||||
#define SDL_AtomicCASPtr SDL_AtomicCASPtr_renamed_SDL_AtomicCompareAndSwapPointer
|
||||
#define SDL_AtomicLock SDL_AtomicLock_renamed_SDL_LockSpinlock
|
||||
#define SDL_AtomicTryLock SDL_AtomicTryLock_renamed_SDL_TryLockSpinlock
|
||||
#define SDL_AtomicUnlock SDL_AtomicUnlock_renamed_SDL_UnlockSpinlock
|
||||
|
||||
/* ##SDL_audio.h */
|
||||
#define AUDIO_F32 AUDIO_F32_renamed_SDL_AUDIO_F32LE
|
||||
#define AUDIO_F32LSB AUDIO_F32LSB_renamed_SDL_AUDIO_F32LE
|
||||
@ -508,6 +568,7 @@
|
||||
#define SDL_AudioStreamPut SDL_AudioStreamPut_renamed_SDL_PutAudioStreamData
|
||||
#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_NewAudioStream SDL_NewAudioStream_renamed_SDL_CreateAudioStream
|
||||
|
||||
/* ##SDL_events.h */
|
||||
@ -554,6 +615,7 @@
|
||||
#define SDL_JOYBUTTONUP SDL_JOYBUTTONUP_renamed_SDL_EVENT_JOYSTICK_BUTTON_UP
|
||||
#define SDL_JOYDEVICEADDED SDL_JOYDEVICEADDED_renamed_SDL_EVENT_JOYSTICK_ADDED
|
||||
#define SDL_JOYDEVICEREMOVED SDL_JOYDEVICEREMOVED_renamed_SDL_EVENT_JOYSTICK_REMOVED
|
||||
#define SDL_JOYBALLMOTION SDL_JOYBALLMOTION_renamed_SDL_EVENT_JOYSTICK_BALL_MOTION
|
||||
#define SDL_JOYHATMOTION SDL_JOYHATMOTION_renamed_SDL_EVENT_JOYSTICK_HAT_MOTION
|
||||
#define SDL_KEYDOWN SDL_KEYDOWN_renamed_SDL_EVENT_KEY_DOWN
|
||||
#define SDL_KEYMAPCHANGED SDL_KEYMAPCHANGED_renamed_SDL_EVENT_KEYMAP_CHANGED
|
||||
@ -642,7 +704,7 @@
|
||||
#define SDL_GameController SDL_GameController_renamed_SDL_Gamepad
|
||||
#define SDL_GameControllerAddMapping SDL_GameControllerAddMapping_renamed_SDL_AddGamepadMapping
|
||||
#define SDL_GameControllerAddMappingsFromFile SDL_GameControllerAddMappingsFromFile_renamed_SDL_AddGamepadMappingsFromFile
|
||||
#define SDL_GameControllerAddMappingsFromRW SDL_GameControllerAddMappingsFromRW_renamed_SDL_AddGamepadMappingsFromRW
|
||||
#define SDL_GameControllerAddMappingsFromRW SDL_GameControllerAddMappingsFromRW_renamed_SDL_AddGamepadMappingsFromIO
|
||||
#define SDL_GameControllerAxis SDL_GameControllerAxis_renamed_SDL_GamepadAxis
|
||||
#define SDL_GameControllerBindType SDL_GameControllerBindType_renamed_SDL_GamepadBindingType
|
||||
#define SDL_GameControllerButton SDL_GameControllerButton_renamed_SDL_GamepadButton
|
||||
@ -674,9 +736,6 @@
|
||||
#define SDL_GameControllerGetVendor SDL_GameControllerGetVendor_renamed_SDL_GetGamepadVendor
|
||||
#define SDL_GameControllerHasAxis SDL_GameControllerHasAxis_renamed_SDL_GamepadHasAxis
|
||||
#define SDL_GameControllerHasButton SDL_GameControllerHasButton_renamed_SDL_GamepadHasButton
|
||||
#define SDL_GameControllerHasLED SDL_GameControllerHasLED_renamed_SDL_GamepadHasLED
|
||||
#define SDL_GameControllerHasRumble SDL_GameControllerHasRumble_renamed_SDL_GamepadHasRumble
|
||||
#define SDL_GameControllerHasRumbleTriggers SDL_GameControllerHasRumbleTriggers_renamed_SDL_GamepadHasRumbleTriggers
|
||||
#define SDL_GameControllerHasSensor SDL_GameControllerHasSensor_renamed_SDL_GamepadHasSensor
|
||||
#define SDL_GameControllerIsSensorEnabled SDL_GameControllerIsSensorEnabled_renamed_SDL_GamepadSensorEnabled
|
||||
#define SDL_GameControllerMapping SDL_GameControllerMapping_renamed_SDL_GetGamepadMapping
|
||||
@ -696,6 +755,43 @@
|
||||
#define SDL_INIT_GAMECONTROLLER SDL_INIT_GAMECONTROLLER_renamed_SDL_INIT_GAMEPAD
|
||||
#define SDL_IsGameController SDL_IsGameController_renamed_SDL_IsGamepad
|
||||
|
||||
/* ##SDL_haptic.h */
|
||||
#define SDL_HapticClose SDL_HapticClose_renamed_SDL_CloseHaptic
|
||||
#define SDL_HapticDestroyEffect SDL_HapticDestroyEffect_renamed_SDL_DestroyHapticEffect
|
||||
#define SDL_HapticGetEffectStatus SDL_HapticGetEffectStatus_renamed_SDL_GetHapticEffectStatus
|
||||
#define SDL_HapticNewEffect SDL_HapticNewEffect_renamed_SDL_CreateHapticEffect
|
||||
#define SDL_HapticNumAxes SDL_HapticNumAxes_renamed_SDL_GetNumHapticAxes
|
||||
#define SDL_HapticNumEffects SDL_HapticNumEffects_renamed_SDL_GetMaxHapticEffects
|
||||
#define SDL_HapticNumEffectsPlaying SDL_HapticNumEffectsPlaying_renamed_SDL_GetMaxHapticEffectsPlaying
|
||||
#define SDL_HapticOpen SDL_HapticOpen_renamed_SDL_OpenHaptic
|
||||
#define SDL_HapticOpenFromJoystick SDL_HapticOpenFromJoystick_renamed_SDL_OpenHapticFromJoystick
|
||||
#define SDL_HapticOpenFromMouse SDL_HapticOpenFromMouse_renamed_SDL_OpenHapticFromMouse
|
||||
#define SDL_HapticPause SDL_HapticPause_renamed_SDL_PauseHaptic
|
||||
#define SDL_HapticQuery SDL_HapticQuery_renamed_SDL_GetHapticFeatures
|
||||
#define SDL_HapticRumbleInit SDL_HapticRumbleInit_renamed_SDL_InitHapticRumble
|
||||
#define SDL_HapticRumblePlay SDL_HapticRumblePlay_renamed_SDL_PlayHapticRumble
|
||||
#define SDL_HapticRumbleStop SDL_HapticRumbleStop_renamed_SDL_StopHapticRumble
|
||||
#define SDL_HapticRunEffect SDL_HapticRunEffect_renamed_SDL_RunHapticEffect
|
||||
#define SDL_HapticSetAutocenter SDL_HapticSetAutocenter_renamed_SDL_SetHapticAutocenter
|
||||
#define SDL_HapticSetGain SDL_HapticSetGain_renamed_SDL_SetHapticGain
|
||||
#define SDL_HapticStopAll SDL_HapticStopAll_renamed_SDL_StopHapticEffects
|
||||
#define SDL_HapticStopEffect SDL_HapticStopEffect_renamed_SDL_StopHapticEffect
|
||||
#define SDL_HapticUnpause SDL_HapticUnpause_renamed_SDL_ResumeHaptic
|
||||
#define SDL_HapticUpdateEffect SDL_HapticUpdateEffect_renamed_SDL_UpdateHapticEffect
|
||||
#define SDL_JoystickIsHaptic SDL_JoystickIsHaptic_renamed_SDL_IsJoystickHaptic
|
||||
#define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic
|
||||
|
||||
/* ##SDL_hints.h */
|
||||
#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST
|
||||
#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT
|
||||
#define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
|
||||
#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE_renamed_SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE
|
||||
#define SDL_HINT_LINUX_DIGITAL_HATS SDL_HINT_LINUX_DIGITAL_HATS_renamed_SDL_HINT_JOYSTICK_LINUX_DIGITAL_HATS
|
||||
#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
|
||||
#define SDL_JoystickAttachVirtual SDL_JoystickAttachVirtual_renamed_SDL_AttachVirtualJoystick
|
||||
@ -708,6 +804,7 @@
|
||||
#define SDL_JoystickGetAttached SDL_JoystickGetAttached_renamed_SDL_JoystickConnected
|
||||
#define SDL_JoystickGetAxis SDL_JoystickGetAxis_renamed_SDL_GetJoystickAxis
|
||||
#define SDL_JoystickGetAxisInitialState SDL_JoystickGetAxisInitialState_renamed_SDL_GetJoystickAxisInitialState
|
||||
#define SDL_JoystickGetBall SDL_JoystickGetBall_renamed_SDL_GetJoystickBall
|
||||
#define SDL_JoystickGetButton SDL_JoystickGetButton_renamed_SDL_GetJoystickButton
|
||||
#define SDL_JoystickGetFirmwareVersion SDL_JoystickGetFirmwareVersion_renamed_SDL_GetJoystickFirmwareVersion
|
||||
#define SDL_JoystickGetGUID SDL_JoystickGetGUID_renamed_SDL_GetJoystickGUID
|
||||
@ -724,6 +821,7 @@
|
||||
#define SDL_JoystickIsVirtual SDL_JoystickIsVirtual_renamed_SDL_IsJoystickVirtual
|
||||
#define SDL_JoystickName SDL_JoystickName_renamed_SDL_GetJoystickName
|
||||
#define SDL_JoystickNumAxes SDL_JoystickNumAxes_renamed_SDL_GetNumJoystickAxes
|
||||
#define SDL_JoystickNumBalls SDL_JoystickNumBalls_renamed_SDL_GetNumJoystickBalls
|
||||
#define SDL_JoystickNumButtons SDL_JoystickNumButtons_renamed_SDL_GetNumJoystickButtons
|
||||
#define SDL_JoystickNumHats SDL_JoystickNumHats_renamed_SDL_GetNumJoystickHats
|
||||
#define SDL_JoystickOpen SDL_JoystickOpen_renamed_SDL_OpenJoystick
|
||||
@ -741,7 +839,6 @@
|
||||
/* ##SDL_keyboard.h */
|
||||
#define SDL_IsScreenKeyboardShown SDL_IsScreenKeyboardShown_renamed_SDL_ScreenKeyboardShown
|
||||
#define SDL_IsTextInputActive SDL_IsTextInputActive_renamed_SDL_TextInputActive
|
||||
#define SDL_IsTextInputShown SDL_IsTextInputShown_renamed_SDL_TextInputShown
|
||||
|
||||
/* ##SDL_keycode.h */
|
||||
#define KMOD_ALT KMOD_ALT_renamed_SDL_KMOD_ALT
|
||||
@ -763,6 +860,10 @@
|
||||
#define KMOD_SCROLL KMOD_SCROLL_renamed_SDL_KMOD_SCROLL
|
||||
#define KMOD_SHIFT KMOD_SHIFT_renamed_SDL_KMOD_SHIFT
|
||||
|
||||
/* ##SDL_log.h */
|
||||
#define SDL_LogGetOutputFunction SDL_LogGetOutputFunction_renamed_SDL_GetLogOutputFunction
|
||||
#define SDL_LogSetOutputFunction SDL_LogSetOutputFunction_renamed_SDL_SetLogOutputFunction
|
||||
|
||||
/* ##SDL_mouse.h */
|
||||
#define SDL_FreeCursor SDL_FreeCursor_renamed_SDL_DestroyCursor
|
||||
|
||||
@ -794,14 +895,6 @@
|
||||
#define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_RGB888_renamed_SDL_PIXELFORMAT_XRGB8888
|
||||
#define SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks_renamed_SDL_GetMasksForPixelFormatEnum
|
||||
|
||||
/* ##SDL_platform.h */
|
||||
#ifdef __IOS__
|
||||
#define __IPHONEOS__ __IPHONEOS___renamed___IOS__
|
||||
#endif
|
||||
#ifdef __MACOS__
|
||||
#define __MACOSX__ __MACOSX___renamed___MACOS__
|
||||
#endif
|
||||
|
||||
/* ##SDL_rect.h */
|
||||
#define SDL_EncloseFPoints SDL_EncloseFPoints_renamed_SDL_GetRectEnclosingPointsFloat
|
||||
#define SDL_EnclosePoints SDL_EnclosePoints_renamed_SDL_GetRectEnclosingPoints
|
||||
@ -860,11 +953,19 @@
|
||||
#define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST
|
||||
|
||||
/* ##SDL_rwops.h */
|
||||
#define RW_SEEK_CUR RW_SEEK_CUR_renamed_SDL_RW_SEEK_CUR
|
||||
#define RW_SEEK_END RW_SEEK_END_renamed_SDL_RW_SEEK_END
|
||||
#define RW_SEEK_SET RW_SEEK_SET_renamed_SDL_RW_SEEK_SET
|
||||
#define SDL_AllocRW SDL_AllocRW_renamed_SDL_CreateRW
|
||||
#define SDL_FreeRW SDL_FreeRW_renamed_SDL_DestroyRW
|
||||
#define RW_SEEK_CUR RW_SEEK_CUR_renamed_SDL_IO_SEEK_CUR
|
||||
#define RW_SEEK_END RW_SEEK_END_renamed_SDL_IO_SEEK_END
|
||||
#define RW_SEEK_SET RW_SEEK_SET_renamed_SDL_IO_SEEK_SET
|
||||
#define SDL_RWFromConstMem SDL_RWFromConstMem_renamed_SDL_IOFromConstMem
|
||||
#define SDL_RWFromFile SDL_RWFromFile_renamed_SDL_IOFromFile
|
||||
#define SDL_RWFromMem SDL_RWFromMem_renamed_SDL_IOFromMem
|
||||
#define SDL_RWclose SDL_RWclose_renamed_SDL_CloseIO
|
||||
#define SDL_RWops SDL_RWops_renamed_SDL_IOStream
|
||||
#define SDL_RWread SDL_RWread_renamed_SDL_ReadIO
|
||||
#define SDL_RWseek SDL_RWseek_renamed_SDL_SeekIO
|
||||
#define SDL_RWsize SDL_RWsize_renamed_SDL_GetIOSize
|
||||
#define SDL_RWtell SDL_RWtell_renamed_SDL_TellIO
|
||||
#define SDL_RWwrite SDL_RWwrite_renamed_SDL_WriteIO
|
||||
#define SDL_ReadBE16 SDL_ReadBE16_renamed_SDL_ReadU16BE
|
||||
#define SDL_ReadBE32 SDL_ReadBE32_renamed_SDL_ReadU32BE
|
||||
#define SDL_ReadBE64 SDL_ReadBE64_renamed_SDL_ReadU64BE
|
||||
@ -900,8 +1001,10 @@
|
||||
#define SDL_GetColorKey SDL_GetColorKey_renamed_SDL_GetSurfaceColorKey
|
||||
#define SDL_HasColorKey SDL_HasColorKey_renamed_SDL_SurfaceHasColorKey
|
||||
#define SDL_HasSurfaceRLE SDL_HasSurfaceRLE_renamed_SDL_SurfaceHasRLE
|
||||
#define SDL_LoadBMP_RW SDL_LoadBMP_RW_renamed_SDL_LoadBMP_IO
|
||||
#define SDL_LowerBlit SDL_LowerBlit_renamed_SDL_BlitSurfaceUnchecked
|
||||
#define SDL_LowerBlitScaled SDL_LowerBlitScaled_renamed_SDL_BlitSurfaceUncheckedScaled
|
||||
#define SDL_SaveBMP_RW SDL_SaveBMP_RW_renamed_SDL_SaveBMP_IO
|
||||
#define SDL_SetClipRect SDL_SetClipRect_renamed_SDL_SetSurfaceClipRect
|
||||
#define SDL_SetColorKey SDL_SetColorKey_renamed_SDL_SetSurfaceColorKey
|
||||
#define SDL_UpperBlit SDL_UpperBlit_renamed_SDL_BlitSurface
|
||||
@ -912,10 +1015,14 @@
|
||||
#define SDL_TLSCreate SDL_TLSCreate_renamed_SDL_CreateTLS
|
||||
#define SDL_TLSGet SDL_TLSGet_renamed_SDL_GetTLS
|
||||
#define SDL_TLSSet SDL_TLSSet_renamed_SDL_SetTLS
|
||||
#define SDL_threadID SDL_threadID_renamed_SDL_ThreadID
|
||||
|
||||
/* ##SDL_timer.h */
|
||||
#define SDL_GetTicks64 SDL_GetTicks64_renamed_SDL_GetTicks
|
||||
|
||||
/* ##SDL_version.h */
|
||||
#define SDL_version SDL_version_renamed_SDL_Version
|
||||
|
||||
/* ##SDL_video.h */
|
||||
#define SDL_GetClosestDisplayMode SDL_GetClosestDisplayMode_renamed_SDL_GetClosestFullscreenDisplayMode
|
||||
#define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_renamed_SDL_GetCurrentDisplayOrientation
|
||||
@ -923,6 +1030,7 @@
|
||||
#define SDL_GetRectDisplayIndex SDL_GetRectDisplayIndex_renamed_SDL_GetDisplayForRect
|
||||
#define SDL_GetWindowDisplayIndex SDL_GetWindowDisplayIndex_renamed_SDL_GetDisplayForWindow
|
||||
#define SDL_GetWindowDisplayMode SDL_GetWindowDisplayMode_renamed_SDL_GetWindowFullscreenMode
|
||||
#define SDL_HasWindowSurface SDL_HasWindowSurface_renamed_SDL_WindowHasSurface
|
||||
#define SDL_IsScreenSaverEnabled SDL_IsScreenSaverEnabled_renamed_SDL_ScreenSaverEnabled
|
||||
#define SDL_SetWindowDisplayMode SDL_SetWindowDisplayMode_renamed_SDL_SetWindowFullscreenMode
|
||||
#define SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_ALLOW_HIGHDPI_renamed_SDL_WINDOW_HIGH_PIXEL_DENSITY
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <SDL3/SDL_platform.h>
|
||||
|
||||
#ifndef __IOS__ /* No OpenGL on iOS. */
|
||||
#ifndef SDL_PLATFORM_IOS /* No OpenGL on iOS. */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@ -77,11 +77,7 @@
|
||||
* Begin system-specific stuff.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
|
||||
#define __WIN32__
|
||||
#endif
|
||||
|
||||
#if defined(__WIN32__) && !defined(__CYGWIN__)
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
@ -90,7 +86,7 @@
|
||||
# define GLAPI extern
|
||||
# endif /* _STATIC_MESA support */
|
||||
# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
|
||||
# define GLAPIENTRY
|
||||
# define GLAPIENTRY
|
||||
# else
|
||||
# define GLAPIENTRY __stdcall
|
||||
# endif
|
||||
@ -2118,6 +2114,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
|
||||
|
||||
#endif /* __gl_h_ */
|
||||
|
||||
#endif /* !__IOS__ */
|
||||
#endif /* !SDL_PLATFORM_IOS */
|
||||
|
||||
#endif /* SDL_opengl_h_ */
|
||||
|
@ -26,7 +26,7 @@
|
||||
*/
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
|
||||
#ifdef __IOS__
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
#include <OpenGLES/ES1/gl.h>
|
||||
#include <OpenGLES/ES1/glext.h>
|
||||
#else
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS)
|
||||
|
||||
#ifdef __IOS__
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
#include <OpenGLES/ES2/gl.h>
|
||||
#include <OpenGLES/ES2/glext.h>
|
||||
#else
|
||||
|
@ -45,9 +45,9 @@
|
||||
#ifndef SDL_pen_h_
|
||||
#define SDL_pen_h_
|
||||
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_guid.h"
|
||||
#include "SDL_stdinc.h"
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_guid.h>
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
@ -56,9 +56,9 @@ extern "C" {
|
||||
|
||||
typedef Uint32 SDL_PenID; /**< SDL_PenIDs identify pens uniquely within a session */
|
||||
|
||||
#define SDL_PEN_INVALID ((Uint32)0) /**< Reserved invalid ::SDL_PenID is valid */
|
||||
#define SDL_PEN_INVALID ((SDL_PenID)0) /**< Reserved invalid ::SDL_PenID is valid */
|
||||
|
||||
#define SDL_PEN_MOUSEID ((Uint32)-2) /**< Device ID for mouse events triggered by pen events */
|
||||
#define SDL_PEN_MOUSEID ((SDL_MouseID)-2) /**< Device ID for mouse events triggered by pen events */
|
||||
|
||||
#define SDL_PEN_INFO_UNKNOWN (-1) /**< Marks unknown information when querying the pen */
|
||||
|
||||
@ -78,9 +78,9 @@ typedef enum
|
||||
{
|
||||
SDL_PEN_AXIS_PRESSURE = 0, /**< Pen pressure. Unidirectional: 0..1.0 */
|
||||
SDL_PEN_AXIS_XTILT, /**< Pen horizontal tilt angle. Bidirectional: -90.0..90.0 (left-to-right).
|
||||
The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */
|
||||
The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */
|
||||
SDL_PEN_AXIS_YTILT, /**< Pen vertical tilt angle. Bidirectional: -90.0..90.0 (top-to-down).
|
||||
The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */
|
||||
The physical max/min tilt may be smaller than -90.0 / 90.0, cf. SDL_PenCapabilityInfo */
|
||||
SDL_PEN_AXIS_DISTANCE, /**< Pen distance to drawing surface. Unidirectional: 0.0..1.0 */
|
||||
SDL_PEN_AXIS_ROTATION, /**< Pen barrel rotation. Bidirectional: -180..179.9 (clockwise, 0 is facing up, -180.0 is facing down). */
|
||||
SDL_PEN_AXIS_SLIDER, /**< Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0..1.0 */
|
||||
@ -133,6 +133,7 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_PEN_TYPE_UNKNOWN = 0,
|
||||
SDL_PEN_TYPE_ERASER = 1, /**< Eraser */
|
||||
SDL_PEN_TYPE_PEN, /**< Generic pen; this is the default. */
|
||||
SDL_PEN_TYPE_PENCIL, /**< Pencil */
|
||||
@ -190,8 +191,6 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetPenStatus(SDL_PenID instance_id, float *x,
|
||||
* SDL_PenID.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0
|
||||
*
|
||||
* \sa SDL_GUID
|
||||
*/
|
||||
extern DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid);
|
||||
|
||||
@ -203,8 +202,6 @@ extern DECLSPEC SDL_PenID SDLCALL SDL_GetPenFromGUID(SDL_GUID guid);
|
||||
* If "instance_id" is ::SDL_PEN_INVALID, returns an all-zeroes GUID.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0
|
||||
*
|
||||
* \sa SDL_PenForID
|
||||
*/
|
||||
extern DECLSPEC SDL_GUID SDLCALL SDL_GetPenGUID(SDL_PenID instance_id);
|
||||
|
||||
|
@ -129,9 +129,11 @@ typedef enum
|
||||
{
|
||||
SDL_ARRAYORDER_NONE,
|
||||
SDL_ARRAYORDER_RGB,
|
||||
SDL_ARRAYORDER_UNUSED1, /* Left for compatibility with SDL2 */
|
||||
SDL_ARRAYORDER_UNUSED2, /* Left for compatibility with SDL2 */
|
||||
SDL_ARRAYORDER_BGR
|
||||
SDL_ARRAYORDER_RGBA,
|
||||
SDL_ARRAYORDER_ARGB,
|
||||
SDL_ARRAYORDER_BGR,
|
||||
SDL_ARRAYORDER_BGRA,
|
||||
SDL_ARRAYORDER_ABGR
|
||||
} SDL_ArrayOrder;
|
||||
|
||||
/** Packed component layout. */
|
||||
@ -163,7 +165,8 @@ typedef enum
|
||||
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
|
||||
((((X) == SDL_PIXELFORMAT_YUY2) || \
|
||||
((X) == SDL_PIXELFORMAT_UYVY) || \
|
||||
((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
|
||||
((X) == SDL_PIXELFORMAT_YVYU) || \
|
||||
((X) == SDL_PIXELFORMAT_P010)) ? 2 : 1) : (((X) >> 0) & 0xFF))
|
||||
|
||||
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
@ -194,8 +197,14 @@ typedef enum
|
||||
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))))
|
||||
|
||||
#define SDL_ISPIXELFORMAT_10BIT(format) \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) && \
|
||||
(SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010))
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32) && \
|
||||
(SDL_PIXELLAYOUT(format) == SDL_PACKEDLAYOUT_2101010)))
|
||||
|
||||
#define SDL_ISPIXELFORMAT_FLOAT(format) \
|
||||
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
|
||||
|
||||
/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
|
||||
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
||||
@ -316,6 +325,60 @@ typedef enum
|
||||
SDL_PIXELFORMAT_ABGR2101010 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
||||
SDL_PIXELFORMAT_RGB48 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGB, 0,
|
||||
48, 6),
|
||||
SDL_PIXELFORMAT_BGR48 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGR, 0,
|
||||
48, 6),
|
||||
SDL_PIXELFORMAT_RGBA64 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGBA, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_ARGB64 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ARGB, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_BGRA64 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGRA, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_ABGR64 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ABGR, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_RGB48_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGB, 0,
|
||||
48, 6),
|
||||
SDL_PIXELFORMAT_BGR48_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGR, 0,
|
||||
48, 6),
|
||||
SDL_PIXELFORMAT_RGBA64_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGBA, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_ARGB64_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ARGB, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_BGRA64_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGRA, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_ABGR64_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ABGR, 0,
|
||||
64, 8),
|
||||
SDL_PIXELFORMAT_RGB96_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGB, 0,
|
||||
96, 12),
|
||||
SDL_PIXELFORMAT_BGR96_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGR, 0,
|
||||
96, 12),
|
||||
SDL_PIXELFORMAT_RGBA128_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGBA, 0,
|
||||
128, 16),
|
||||
SDL_PIXELFORMAT_ARGB128_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ARGB, 0,
|
||||
128, 16),
|
||||
SDL_PIXELFORMAT_BGRA128_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGRA, 0,
|
||||
128, 16),
|
||||
SDL_PIXELFORMAT_ABGR128_FLOAT =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ABGR, 0,
|
||||
128, 16),
|
||||
|
||||
/* Aliases for RGBA byte arrays of color data, for the current platform */
|
||||
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||
@ -352,10 +415,250 @@ typedef enum
|
||||
SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
|
||||
SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
|
||||
SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
|
||||
SDL_PIXELFORMAT_P010 = /**< Planar mode: Y + U/V interleaved (2 planes) */
|
||||
SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'),
|
||||
SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
|
||||
SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
|
||||
} SDL_PixelFormatEnum;
|
||||
|
||||
/**
|
||||
* Pixels are a representation of a color in a particular color space.
|
||||
*
|
||||
* The first characteristic of a color space is the color type. SDL understands two different color types, RGB and YCbCr, or in SDL also referred to as YUV.
|
||||
*
|
||||
* RGB colors consist of red, green, and blue channels of color that are added together to represent the colors we see on the screen.
|
||||
* https://en.wikipedia.org/wiki/RGB_color_model
|
||||
*
|
||||
* YCbCr colors represent colors as a Y luma brightness component and red and blue chroma color offsets. This color representation takes advantage of the fact that the human eye is more sensitive to brightness than the color in an image. The Cb and Cr components are often compressed and have lower resolution than the luma component.
|
||||
* https://en.wikipedia.org/wiki/YCbCr
|
||||
*
|
||||
* When the color information in YCbCr is compressed, the Y pixels are left at full resolution and each Cr and Cb pixel represents an average of the color information in a block of Y pixels. The chroma location determines where in that block of pixels the color information is coming from.
|
||||
*
|
||||
* The color range defines how much of the pixel to use when converting a pixel into a color on the display. When the full color range is used, the entire numeric range of the pixel bits is significant. When narrow color range is used, for historical reasons, the pixel uses only a portion of the numeric range to represent colors.
|
||||
*
|
||||
* The color primaries and white point are a definition of the colors in the color space relative to the standard XYZ color space.
|
||||
* https://en.wikipedia.org/wiki/CIE_1931_color_space
|
||||
*
|
||||
* The transfer characteristic, or opto-electrical transfer function (OETF), is the way a color is converted from mathematically linear space into a non-linear output signals.
|
||||
* https://en.wikipedia.org/wiki/Rec._709#Transfer_characteristics
|
||||
*
|
||||
* The matrix coefficients are used to convert between YCbCr and RGB colors.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The color type
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_COLOR_TYPE_UNKNOWN = 0,
|
||||
SDL_COLOR_TYPE_RGB = 1,
|
||||
SDL_COLOR_TYPE_YCBCR = 2
|
||||
} SDL_ColorType;
|
||||
|
||||
/**
|
||||
* The color range, as described by https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_COLOR_RANGE_UNKNOWN = 0,
|
||||
SDL_COLOR_RANGE_LIMITED = 1, /**< Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma */
|
||||
SDL_COLOR_RANGE_FULL = 2 /**< Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma */
|
||||
} SDL_ColorRange;
|
||||
|
||||
/**
|
||||
* The color primaries, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_COLOR_PRIMARIES_UNKNOWN = 0,
|
||||
SDL_COLOR_PRIMARIES_BT709 = 1, /**< ITU-R BT.709-6 */
|
||||
SDL_COLOR_PRIMARIES_UNSPECIFIED = 2,
|
||||
SDL_COLOR_PRIMARIES_BT470M = 4, /**< ITU-R BT.470-6 System M */
|
||||
SDL_COLOR_PRIMARIES_BT470BG = 5, /**< ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625 */
|
||||
SDL_COLOR_PRIMARIES_BT601 = 6, /**< ITU-R BT.601-7 525 */
|
||||
SDL_COLOR_PRIMARIES_SMPTE240 = 7, /**< SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601 */
|
||||
SDL_COLOR_PRIMARIES_GENERIC_FILM = 8, /**< Generic film (color filters using Illuminant C) */
|
||||
SDL_COLOR_PRIMARIES_BT2020 = 9, /**< ITU-R BT.2020-2 / ITU-R BT.2100-0 */
|
||||
SDL_COLOR_PRIMARIES_XYZ = 10, /**< SMPTE ST 428-1 */
|
||||
SDL_COLOR_PRIMARIES_SMPTE431 = 11, /**< SMPTE RP 431-2 */
|
||||
SDL_COLOR_PRIMARIES_SMPTE432 = 12, /**< SMPTE EG 432-1 / DCI P3 */
|
||||
SDL_COLOR_PRIMARIES_EBU3213 = 22, /**< EBU Tech. 3213-E */
|
||||
SDL_COLOR_PRIMARIES_CUSTOM = 31
|
||||
} SDL_ColorPrimaries;
|
||||
|
||||
/**
|
||||
* The transfer characteristics, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_TRANSFER_CHARACTERISTICS_UNKNOWN = 0,
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT709 = 1, /**< Rec. ITU-R BT.709-6 / ITU-R BT1361 */
|
||||
SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED = 2,
|
||||
SDL_TRANSFER_CHARACTERISTICS_GAMMA22 = 4, /**< ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM */
|
||||
SDL_TRANSFER_CHARACTERISTICS_GAMMA28 = 5, /**< ITU-R BT.470-6 System B, G */
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT601 = 6, /**< SMPTE ST 170M / ITU-R BT.601-7 525 or 625 */
|
||||
SDL_TRANSFER_CHARACTERISTICS_SMPTE240 = 7, /**< SMPTE ST 240M */
|
||||
SDL_TRANSFER_CHARACTERISTICS_LINEAR = 8,
|
||||
SDL_TRANSFER_CHARACTERISTICS_LOG100 = 9,
|
||||
SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10 = 10,
|
||||
SDL_TRANSFER_CHARACTERISTICS_IEC61966 = 11, /**< IEC 61966-2-4 */
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT1361 = 12, /**< ITU-R BT1361 Extended Colour Gamut */
|
||||
SDL_TRANSFER_CHARACTERISTICS_SRGB = 13, /**< IEC 61966-2-1 (sRGB or sYCC) */
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT = 14, /**< ITU-R BT2020 for 10-bit system */
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT = 15, /**< ITU-R BT2020 for 12-bit system */
|
||||
SDL_TRANSFER_CHARACTERISTICS_PQ = 16, /**< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems */
|
||||
SDL_TRANSFER_CHARACTERISTICS_SMPTE428 = 17, /**< SMPTE ST 428-1 */
|
||||
SDL_TRANSFER_CHARACTERISTICS_HLG = 18, /**< ARIB STD-B67, known as "hybrid log-gamma" (HLG) */
|
||||
SDL_TRANSFER_CHARACTERISTICS_CUSTOM = 31
|
||||
} SDL_TransferCharacteristics;
|
||||
|
||||
/**
|
||||
* The matrix coefficients, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_MATRIX_COEFFICIENTS_IDENTITY = 0,
|
||||
SDL_MATRIX_COEFFICIENTS_BT709 = 1, /**< ITU-R BT.709-6 */
|
||||
SDL_MATRIX_COEFFICIENTS_UNSPECIFIED = 2,
|
||||
SDL_MATRIX_COEFFICIENTS_FCC = 4, /**< US FCC */
|
||||
SDL_MATRIX_COEFFICIENTS_BT470BG = 5, /**< ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601 */
|
||||
SDL_MATRIX_COEFFICIENTS_BT601 = 6, /**< ITU-R BT.601-7 525 */
|
||||
SDL_MATRIX_COEFFICIENTS_SMPTE240 = 7, /**< SMPTE 240M */
|
||||
SDL_MATRIX_COEFFICIENTS_YCGCO = 8,
|
||||
SDL_MATRIX_COEFFICIENTS_BT2020_NCL = 9, /**< ITU-R BT.2020-2 non-constant luminance */
|
||||
SDL_MATRIX_COEFFICIENTS_BT2020_CL = 10, /**< ITU-R BT.2020-2 constant luminance */
|
||||
SDL_MATRIX_COEFFICIENTS_SMPTE2085 = 11, /**< SMPTE ST 2085 */
|
||||
SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL = 12,
|
||||
SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL = 13,
|
||||
SDL_MATRIX_COEFFICIENTS_ICTCP = 14, /**< ITU-R BT.2100-0 ICTCP */
|
||||
SDL_MATRIX_COEFFICIENTS_CUSTOM = 31
|
||||
} SDL_MatrixCoefficients;
|
||||
|
||||
/**
|
||||
* The chroma sample location
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_CHROMA_LOCATION_NONE = 0, /**< RGB, no chroma sampling */
|
||||
SDL_CHROMA_LOCATION_LEFT = 1, /**< In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. */
|
||||
SDL_CHROMA_LOCATION_CENTER = 2, /**< In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. */
|
||||
SDL_CHROMA_LOCATION_TOPLEFT = 3 /**< In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the same location as the group's top-left Y pixel ("co-sited", "co-located"). */
|
||||
} SDL_ChromaLocation;
|
||||
|
||||
|
||||
/* Colorspace definition */
|
||||
#define SDL_DEFINE_COLORSPACE(type, range, primaries, transfer, matrix, chroma) \
|
||||
(((Uint32)(type) << 28) | ((Uint32)(range) << 24) | ((Uint32)(chroma) << 20) | \
|
||||
((Uint32)(primaries) << 10) | ((Uint32)(transfer) << 5) | ((Uint32)(matrix) << 0))
|
||||
|
||||
#define SDL_COLORSPACETYPE(X) (SDL_ColorType)(((X) >> 28) & 0x0F)
|
||||
#define SDL_COLORSPACERANGE(X) (SDL_ColorRange)(((X) >> 24) & 0x0F)
|
||||
#define SDL_COLORSPACECHROMA(X) (SDL_ChromaLocation)(((X) >> 20) & 0x0F)
|
||||
#define SDL_COLORSPACEPRIMARIES(X) (SDL_ColorPrimaries)(((X) >> 10) & 0x1F)
|
||||
#define SDL_COLORSPACETRANSFER(X) (SDL_TransferCharacteristics)(((X) >> 5) & 0x1F)
|
||||
#define SDL_COLORSPACEMATRIX(X) (SDL_MatrixCoefficients)((X) & 0x1F)
|
||||
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT601(X) (SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT601 || SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT470BG)
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT709(X) (SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT709)
|
||||
#define SDL_ISCOLORSPACE_MATRIX_BT2020_NCL(X) (SDL_COLORSPACEMATRIX(X) == SDL_MATRIX_COEFFICIENTS_BT2020_NCL)
|
||||
#define SDL_ISCOLORSPACE_LIMITED_RANGE(X) (SDL_COLORSPACERANGE(X) != SDL_COLOR_RANGE_FULL)
|
||||
#define SDL_ISCOLORSPACE_FULL_RANGE(X) (SDL_COLORSPACERANGE(X) == SDL_COLOR_RANGE_FULL)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SDL_COLORSPACE_UNKNOWN,
|
||||
|
||||
/* sRGB is a gamma corrected colorspace, and the default colorspace for SDL rendering and 8-bit RGB surfaces */
|
||||
SDL_COLORSPACE_SRGB = /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT709,
|
||||
SDL_TRANSFER_CHARACTERISTICS_SRGB,
|
||||
SDL_MATRIX_COEFFICIENTS_IDENTITY,
|
||||
SDL_CHROMA_LOCATION_NONE),
|
||||
|
||||
/* This is a linear colorspace and the default colorspace for floating point surfaces. On Windows this is the scRGB colorspace, and on Apple platforms this is kCGColorSpaceExtendedLinearSRGB for EDR content */
|
||||
SDL_COLORSPACE_SRGB_LINEAR = /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT709,
|
||||
SDL_TRANSFER_CHARACTERISTICS_LINEAR,
|
||||
SDL_MATRIX_COEFFICIENTS_IDENTITY,
|
||||
SDL_CHROMA_LOCATION_NONE),
|
||||
|
||||
/* HDR10 is a non-linear HDR colorspace and the default colorspace for 10-bit surfaces */
|
||||
SDL_COLORSPACE_HDR10 = /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT2020,
|
||||
SDL_TRANSFER_CHARACTERISTICS_PQ,
|
||||
SDL_MATRIX_COEFFICIENTS_IDENTITY,
|
||||
SDL_CHROMA_LOCATION_NONE),
|
||||
|
||||
SDL_COLORSPACE_JPEG = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT709,
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT601,
|
||||
SDL_MATRIX_COEFFICIENTS_BT601,
|
||||
SDL_CHROMA_LOCATION_NONE),
|
||||
|
||||
SDL_COLORSPACE_BT601_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_LIMITED,
|
||||
SDL_COLOR_PRIMARIES_BT601,
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT601,
|
||||
SDL_MATRIX_COEFFICIENTS_BT601,
|
||||
SDL_CHROMA_LOCATION_LEFT),
|
||||
|
||||
SDL_COLORSPACE_BT601_FULL = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT601,
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT601,
|
||||
SDL_MATRIX_COEFFICIENTS_BT601,
|
||||
SDL_CHROMA_LOCATION_LEFT),
|
||||
|
||||
SDL_COLORSPACE_BT709_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_LIMITED,
|
||||
SDL_COLOR_PRIMARIES_BT709,
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT709,
|
||||
SDL_MATRIX_COEFFICIENTS_BT709,
|
||||
SDL_CHROMA_LOCATION_LEFT),
|
||||
|
||||
SDL_COLORSPACE_BT709_FULL = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT709,
|
||||
SDL_TRANSFER_CHARACTERISTICS_BT709,
|
||||
SDL_MATRIX_COEFFICIENTS_BT709,
|
||||
SDL_CHROMA_LOCATION_LEFT),
|
||||
|
||||
SDL_COLORSPACE_BT2020_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_LIMITED,
|
||||
SDL_COLOR_PRIMARIES_BT2020,
|
||||
SDL_TRANSFER_CHARACTERISTICS_PQ,
|
||||
SDL_MATRIX_COEFFICIENTS_BT2020_NCL,
|
||||
SDL_CHROMA_LOCATION_LEFT),
|
||||
|
||||
SDL_COLORSPACE_BT2020_FULL = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 */
|
||||
SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR,
|
||||
SDL_COLOR_RANGE_FULL,
|
||||
SDL_COLOR_PRIMARIES_BT2020,
|
||||
SDL_TRANSFER_CHARACTERISTICS_PQ,
|
||||
SDL_MATRIX_COEFFICIENTS_BT2020_NCL,
|
||||
SDL_CHROMA_LOCATION_LEFT),
|
||||
|
||||
/* The default colorspace for RGB surfaces if no colorspace is specified */
|
||||
SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB,
|
||||
|
||||
/* The default colorspace for YUV surfaces if no colorspace is specified */
|
||||
SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_JPEG,
|
||||
|
||||
} SDL_Colorspace;
|
||||
|
||||
/**
|
||||
* The bits of this structure can be directly reinterpreted as an integer-packed
|
||||
* color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
|
||||
@ -370,6 +673,19 @@ typedef struct SDL_Color
|
||||
} SDL_Color;
|
||||
#define SDL_Colour SDL_Color
|
||||
|
||||
/**
|
||||
* The bits of this structure can be directly reinterpreted as a float-packed
|
||||
* color which uses the SDL_PIXELFORMAT_RGBA128_FLOAT format
|
||||
*/
|
||||
typedef struct SDL_FColor
|
||||
{
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
} SDL_FColor;
|
||||
#define SDL_FColour SDL_FColor
|
||||
|
||||
typedef struct SDL_Palette
|
||||
{
|
||||
int ncolors;
|
||||
@ -383,10 +699,10 @@ typedef struct SDL_Palette
|
||||
*/
|
||||
typedef struct SDL_PixelFormat
|
||||
{
|
||||
Uint32 format;
|
||||
SDL_PixelFormatEnum format;
|
||||
SDL_Palette *palette;
|
||||
Uint8 BitsPerPixel;
|
||||
Uint8 BytesPerPixel;
|
||||
Uint8 bits_per_pixel;
|
||||
Uint8 bytes_per_pixel;
|
||||
Uint8 padding[2];
|
||||
Uint32 Rmask;
|
||||
Uint32 Gmask;
|
||||
@ -413,7 +729,7 @@ typedef struct SDL_PixelFormat
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormatEnum format);
|
||||
|
||||
/**
|
||||
* Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
|
||||
@ -431,7 +747,7 @@ extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
||||
*
|
||||
* \sa SDL_GetPixelFormatEnumForMasks
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(Uint32 format,
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format,
|
||||
int *bpp,
|
||||
Uint32 * Rmask,
|
||||
Uint32 * Gmask,
|
||||
@ -449,13 +765,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(Uint32 format,
|
||||
* \param Gmask the green mask for the format
|
||||
* \param Bmask the blue mask for the format
|
||||
* \param Amask the alpha mask for the format
|
||||
* \returns one of the SDL_PixelFormatEnum values
|
||||
* \returns the SDL_PixelFormatEnum value corresponding to the format masks,
|
||||
* or SDL_PIXELFORMAT_UNKNOWN if there isn't a match.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetMasksForPixelFormatEnum
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
|
||||
extern DECLSPEC SDL_PixelFormatEnum SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
|
||||
Uint32 Rmask,
|
||||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
@ -475,8 +792,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp,
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_DestroyPixelFormat
|
||||
* \sa SDL_SetPixelFormatPalette
|
||||
*/
|
||||
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(Uint32 pixel_format);
|
||||
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format);
|
||||
|
||||
/**
|
||||
* Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat().
|
||||
@ -502,6 +820,8 @@ extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_DestroyPalette
|
||||
* \sa SDL_SetPaletteColors
|
||||
* \sa SDL_SetPixelFormatPalette
|
||||
*/
|
||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
|
||||
|
||||
@ -514,9 +834,6 @@ extern DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors);
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreatePalette
|
||||
* \sa SDL_DestroyPalette
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
||||
SDL_Palette *palette);
|
||||
@ -532,9 +849,6 @@ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreatePalette
|
||||
* \sa SDL_CreateSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
const SDL_Color * colors,
|
||||
|
@ -29,48 +29,40 @@
|
||||
#define SDL_platform_defines_h_
|
||||
|
||||
#ifdef _AIX
|
||||
#undef __AIX__
|
||||
#define __AIX__ 1
|
||||
#define SDL_PLATFORM_AIX 1
|
||||
#endif
|
||||
#ifdef __HAIKU__
|
||||
#undef __HAIKU__
|
||||
#define __HAIKU__ 1
|
||||
#define SDL_PLATFORM_HAIKU 1
|
||||
#endif
|
||||
#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
|
||||
#undef __BSDI__
|
||||
#define __BSDI__ 1
|
||||
#endif
|
||||
#ifdef _arch_dreamcast
|
||||
#undef __DREAMCAST__
|
||||
#define __DREAMCAST__ 1
|
||||
#define SDL_PLATFORM_BSDI 1
|
||||
#endif
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
|
||||
#undef __FREEBSD__
|
||||
#define __FREEBSD__ 1
|
||||
#define SDL_PLATFORM_FREEBSD 1
|
||||
#endif
|
||||
#if defined(hpux) || defined(__hpux) || defined(__hpux__)
|
||||
#undef __HPUX__
|
||||
#define __HPUX__ 1
|
||||
#define SDL_PLATFORM_HPUX 1
|
||||
#endif
|
||||
#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
|
||||
#undef __IRIX__
|
||||
#define __IRIX__ 1
|
||||
#define SDL_PLATFORM_IRIX 1
|
||||
#endif
|
||||
#if (defined(linux) || defined(__linux) || defined(__linux__))
|
||||
#undef __LINUX__
|
||||
#define __LINUX__ 1
|
||||
#define SDL_PLATFORM_LINUX 1
|
||||
#endif
|
||||
#if defined(ANDROID) || defined(__ANDROID__)
|
||||
#undef __ANDROID__
|
||||
#undef __LINUX__ /* do we need to do this? */
|
||||
#define __ANDROID__ 1
|
||||
#undef SDL_PLATFORM_LINUX /* do we need to do this? */
|
||||
#define SDL_PLATFORM_ANDROID 1
|
||||
#endif
|
||||
#ifdef __NGAGE__
|
||||
#undef __NGAGE__
|
||||
#define __NGAGE__ 1
|
||||
#define SDL_PLATFORM_NGAGE 1
|
||||
#endif
|
||||
|
||||
#if defined(__unix__) || defined(__unix) || defined(unix)
|
||||
#define SDL_PLATFORM_UNIX 1
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define SDL_PLATFORM_APPLE 1
|
||||
/* lets us know what version of macOS we're compiling on */
|
||||
#include <AvailabilityMacros.h>
|
||||
#include <TargetConditionals.h>
|
||||
@ -94,56 +86,58 @@
|
||||
#ifndef TARGET_OS_SIMULATOR
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#endif
|
||||
#ifndef TARGET_OS_XR
|
||||
#define TARGET_OS_XR 0
|
||||
#ifndef TARGET_OS_VISION
|
||||
#define TARGET_OS_VISION 0
|
||||
#endif
|
||||
|
||||
#if TARGET_OS_TV
|
||||
#undef __TVOS__
|
||||
#define __TVOS__ 1
|
||||
#define SDL_PLATFORM_TVOS 1
|
||||
#endif
|
||||
#if TARGET_OS_VISION
|
||||
#define SDL_PLATFORM_VISIONOS 1
|
||||
#endif
|
||||
#if TARGET_OS_IPHONE
|
||||
#undef __IOS__
|
||||
#define __IOS__ 1
|
||||
#define SDL_PLATFORM_IOS 1
|
||||
#else
|
||||
#undef __MACOS__
|
||||
#define __MACOS__ 1
|
||||
#define SDL_PLATFORM_MACOS 1
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
# error SDL for macOS only supports deploying on 10.7 and above.
|
||||
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1070 */
|
||||
#endif /* TARGET_OS_IPHONE */
|
||||
#endif /* defined(__APPLE__) */
|
||||
#endif /* defined(SDL_PLATFORM_APPLE) */
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#define SDL_PLATFORM_EMSCRIPTEN 1
|
||||
#endif
|
||||
#ifdef __NetBSD__
|
||||
#undef __NETBSD__
|
||||
#define __NETBSD__ 1
|
||||
#define SDL_PLATFORM_NETBSD 1
|
||||
#endif
|
||||
#ifdef __OpenBSD__
|
||||
#undef __OPENBSD__
|
||||
#define __OPENBSD__ 1
|
||||
#define SDL_PLATFORM_OPENBSD 1
|
||||
#endif
|
||||
#if defined(__OS2__) || defined(__EMX__)
|
||||
#undef __OS2__
|
||||
#define __OS2__ 1
|
||||
#define SDL_PLATFORM_OS2 1
|
||||
#endif
|
||||
#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
|
||||
#undef __OSF__
|
||||
#define __OSF__ 1
|
||||
#define SDL_PLATFORM_OSF 1
|
||||
#endif
|
||||
#ifdef __QNXNTO__
|
||||
#undef __QNXNTO__
|
||||
#define __QNXNTO__ 1
|
||||
#define SDL_PLATFORM_QNXNTO 1
|
||||
#endif
|
||||
#if defined(riscos) || defined(__riscos) || defined(__riscos__)
|
||||
#undef __RISCOS__
|
||||
#define __RISCOS__ 1
|
||||
#define SDL_PLATFORM_RISCOS 1
|
||||
#endif
|
||||
#if defined(__sun) && defined(__SVR4)
|
||||
#undef __SOLARIS__
|
||||
#define __SOLARIS__ 1
|
||||
#define SDL_PLATFORM_SOLARIS 1
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
#if defined(__CYGWIN__)
|
||||
#define SDL_PLATFORM_CYGWIN 1
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN)
|
||||
#define SDL_PLATFORM_WINDOWS 1 /* Win32 api and Windows-based OSs */
|
||||
|
||||
/* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */
|
||||
#if defined(_MSC_VER) && defined(__has_include)
|
||||
#if __has_include(<winapifamily.h>)
|
||||
@ -173,47 +167,36 @@
|
||||
#endif
|
||||
|
||||
#if WINAPI_FAMILY_WINRT
|
||||
#undef __WINRT__
|
||||
#define __WINRT__ 1
|
||||
#define SDL_PLATFORM_WINRT 1
|
||||
#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */
|
||||
#undef __WINGDK__
|
||||
#define __WINGDK__ 1
|
||||
#define SDL_PLATFORM_WINGDK 1
|
||||
#elif defined(_GAMING_XBOX_XBOXONE)
|
||||
#undef __XBOXONE__
|
||||
#define __XBOXONE__ 1
|
||||
#define SDL_PLATFORM_XBOXONE 1
|
||||
#elif defined(_GAMING_XBOX_SCARLETT)
|
||||
#undef __XBOXSERIES__
|
||||
#define __XBOXSERIES__ 1
|
||||
#define SDL_PLATFORM_XBOXSERIES 1
|
||||
#else
|
||||
#undef __WINDOWS__
|
||||
#define __WINDOWS__ 1
|
||||
#define SDL_PLATFORM_WIN32 1
|
||||
#endif
|
||||
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
|
||||
#endif /* defined(WIN32) || defined(_WIN32) || defined(SDL_PLATFORM_CYGWIN) */
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#undef __WIN32__
|
||||
#define __WIN32__ 1
|
||||
#endif
|
||||
/* This is to support generic "any GDK" separate from a platform-specific GDK */
|
||||
#if defined(__WINGDK__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
#undef __GDK__
|
||||
#define __GDK__ 1
|
||||
#if defined(SDL_PLATFORM_WINGDK) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
|
||||
#define SDL_PLATFORM_GDK 1
|
||||
#endif
|
||||
#ifdef __PSP__
|
||||
#undef __PSP__
|
||||
#define __PSP__ 1
|
||||
#if defined(__PSP__) || defined(__psp__)
|
||||
#define SDL_PLATFORM_PSP 1
|
||||
#endif
|
||||
#ifdef PS2
|
||||
#define __PS2__ 1
|
||||
#if defined(__PS2__) || defined(PS2)
|
||||
#define SDL_PLATFORM_PS2 1
|
||||
#endif
|
||||
|
||||
#ifdef __vita__
|
||||
#define __VITA__ 1
|
||||
#if defined(__vita__) || defined(__psp2__)
|
||||
#define SDL_PLATFORM_VITA 1
|
||||
#endif
|
||||
|
||||
#ifdef __3DS__
|
||||
#undef __3DS__
|
||||
#define __3DS__ 1
|
||||
#define SDL_PLATFORM_3DS 1
|
||||
#endif
|
||||
|
||||
#endif /* SDL_platform_defines_h_ */
|
||||
|
@ -28,6 +28,8 @@
|
||||
#ifndef SDL_properties_h_
|
||||
#define SDL_properties_h_
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
@ -81,6 +83,25 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
|
||||
|
||||
/**
|
||||
* Copy a set of properties
|
||||
*
|
||||
* Copy all the properties from one set of properties to another, with the
|
||||
* exception of properties requiring cleanup (set using
|
||||
* SDL_SetPropertyWithCleanup()), which will not be copied. Any property that
|
||||
* already exists on `dst` will be overwritten.
|
||||
*
|
||||
* \param src the properties to copy
|
||||
* \param dst the destination properties
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
|
||||
|
||||
/**
|
||||
* Lock a set of properties
|
||||
*
|
||||
@ -122,6 +143,9 @@ extern DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
|
||||
* Set a property on a set of properties with a cleanup function that is
|
||||
* called when the property is deleted
|
||||
*
|
||||
* The cleanup function is also called if setting the property fails for any
|
||||
* reason.
|
||||
*
|
||||
* \param props the properties to modify
|
||||
* \param name the name of the property to modify
|
||||
* \param value the new value of the property, or NULL to delete the property
|
||||
@ -154,13 +178,21 @@ extern DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, c
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetProperty
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetBooleanProperty
|
||||
* \sa SDL_SetFloatProperty
|
||||
* \sa SDL_SetNumberProperty
|
||||
* \sa SDL_SetPropertyWithCleanup
|
||||
* \sa SDL_SetStringProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value);
|
||||
|
||||
/**
|
||||
* Set a string property on a set of properties
|
||||
*
|
||||
* This function makes a copy of the string; the caller does not have to
|
||||
* preserve the data after this call completes.
|
||||
*
|
||||
* \param props the properties to modify
|
||||
* \param name the name of the property to modify
|
||||
* \param value the new value of the property, or NULL to delete the property
|
||||
@ -226,6 +258,21 @@ extern DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const c
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value);
|
||||
|
||||
/**
|
||||
* Return whether a property exists in a set of properties.
|
||||
*
|
||||
* \param props the properties to query
|
||||
* \param name the name of the property to query
|
||||
* \returns SDL_TRUE if the property exists, or SDL_FALSE if it doesn't.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name);
|
||||
|
||||
/**
|
||||
* Get the type of a property on a set of properties
|
||||
*
|
||||
@ -237,6 +284,8 @@ extern DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_HasProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID props, const char *name);
|
||||
|
||||
@ -262,7 +311,12 @@ extern DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID pr
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetBooleanProperty
|
||||
* \sa SDL_GetFloatProperty
|
||||
* \sa SDL_GetNumberProperty
|
||||
* \sa SDL_GetPropertyType
|
||||
* \sa SDL_GetStringProperty
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetProperty
|
||||
*/
|
||||
extern DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value);
|
||||
@ -281,6 +335,7 @@ extern DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetStringProperty
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value);
|
||||
@ -302,6 +357,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetNumberProperty
|
||||
*/
|
||||
extern DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 default_value);
|
||||
@ -323,6 +379,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, con
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetFloatProperty
|
||||
*/
|
||||
extern DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float default_value);
|
||||
@ -344,6 +401,7 @@ extern DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetPropertyType
|
||||
* \sa SDL_HasProperty
|
||||
* \sa SDL_SetBooleanProperty
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value);
|
||||
@ -359,8 +417,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props,
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetProperty
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name);
|
||||
|
||||
|
@ -30,8 +30,6 @@
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_pixels.h>
|
||||
#include <SDL3/SDL_rwops.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -33,6 +33,9 @@
|
||||
/**
|
||||
* The SDL keyboard scancode representation.
|
||||
*
|
||||
* An SDL scancode is the physical representation of a key on the keyboard,
|
||||
* independent of language and keyboard mapping.
|
||||
*
|
||||
* Values of this type are used to represent keyboard keys, among other places
|
||||
* in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
|
||||
* SDL_Event structure.
|
||||
|
@ -35,13 +35,14 @@
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#ifndef SDL_DISABLE_ALLOCA
|
||||
# ifndef alloca
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# elif defined(__NETBSD__)
|
||||
# elif defined(SDL_PLATFORM_NETBSD)
|
||||
# if defined(__STRICT_ANSI__)
|
||||
# define SDL_DISABLE_ALLOCA
|
||||
# else
|
||||
@ -58,7 +59,7 @@
|
||||
# include <malloc.h>
|
||||
# elif defined(__DMC__)
|
||||
# include <stdlib.h>
|
||||
# elif defined(__AIX__)
|
||||
# elif defined(SDL_PLATFORM_AIX)
|
||||
# pragma alloca
|
||||
# elif defined(__MRC__)
|
||||
void *alloca(unsigned);
|
||||
@ -185,6 +186,16 @@ typedef int64_t Sint64;
|
||||
#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
|
||||
typedef uint64_t Uint64;
|
||||
|
||||
/**
|
||||
* SDL times are signed, 64-bit integers representing nanoseconds since the Unix epoch (Jan 1, 1970)
|
||||
*
|
||||
* They can be converted between POSIX time_t values with SDL_NS_TO_SECONDS() and SDL_SECONDS_TO_NS(),
|
||||
* and between Windows FILETIME values with SDL_TimeToWindows() and SDL_TimeFromWindows().
|
||||
*/
|
||||
#define SDL_MAX_TIME SDL_MAX_SINT64
|
||||
#define SDL_MIN_TIME SDL_MIN_SINT64
|
||||
typedef Sint64 SDL_Time;
|
||||
|
||||
/* @} *//* Basic data types */
|
||||
|
||||
/**
|
||||
@ -206,9 +217,9 @@ typedef uint64_t Uint64;
|
||||
#ifndef SDL_PRIs64
|
||||
#ifdef PRIs64
|
||||
#define SDL_PRIs64 PRIs64
|
||||
#elif defined(__WIN32__) || defined(__GDK__)
|
||||
#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#define SDL_PRIs64 "I64d"
|
||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
||||
#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE)
|
||||
#define SDL_PRIs64 "ld"
|
||||
#else
|
||||
#define SDL_PRIs64 "lld"
|
||||
@ -217,9 +228,9 @@ typedef uint64_t Uint64;
|
||||
#ifndef SDL_PRIu64
|
||||
#ifdef PRIu64
|
||||
#define SDL_PRIu64 PRIu64
|
||||
#elif defined(__WIN32__) || defined(__GDK__)
|
||||
#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#define SDL_PRIu64 "I64u"
|
||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
||||
#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE)
|
||||
#define SDL_PRIu64 "lu"
|
||||
#else
|
||||
#define SDL_PRIu64 "llu"
|
||||
@ -228,9 +239,9 @@ typedef uint64_t Uint64;
|
||||
#ifndef SDL_PRIx64
|
||||
#ifdef PRIx64
|
||||
#define SDL_PRIx64 PRIx64
|
||||
#elif defined(__WIN32__) || defined(__GDK__)
|
||||
#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#define SDL_PRIx64 "I64x"
|
||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
||||
#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE)
|
||||
#define SDL_PRIx64 "lx"
|
||||
#else
|
||||
#define SDL_PRIx64 "llx"
|
||||
@ -239,9 +250,9 @@ typedef uint64_t Uint64;
|
||||
#ifndef SDL_PRIX64
|
||||
#ifdef PRIX64
|
||||
#define SDL_PRIX64 PRIX64
|
||||
#elif defined(__WIN32__) || defined(__GDK__)
|
||||
#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
#define SDL_PRIX64 "I64X"
|
||||
#elif defined(__LP64__) && !defined(__APPLE__)
|
||||
#elif defined(__LP64__) && !defined(SDL_PLATFORM_APPLE)
|
||||
#define SDL_PRIX64 "lX"
|
||||
#else
|
||||
#define SDL_PRIX64 "llX"
|
||||
@ -369,7 +380,7 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
||||
|
||||
/** \cond */
|
||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||
#if !defined(__ANDROID__) && !defined(__VITA__) && !defined(__3DS__)
|
||||
#if !defined(SDL_PLATFORM_ANDROID) && !defined(SDL_PLATFORM_VITA) && !defined(SDL_PLATFORM_3DS)
|
||||
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
||||
typedef enum
|
||||
{
|
||||
@ -497,6 +508,9 @@ extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int
|
||||
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 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 DECLSPEC int SDLCALL SDL_abs(int x);
|
||||
|
||||
/* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */
|
||||
@ -522,22 +536,45 @@ extern 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 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
|
||||
#ifdef SDL_memcpy
|
||||
#undef SDL_memcpy
|
||||
#endif
|
||||
#define SDL_memcpy memcpy
|
||||
#endif
|
||||
|
||||
#define SDL_copyp(dst, src) \
|
||||
{ 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);
|
||||
|
||||
/* Take advantage of compiler optimizations for memmove */
|
||||
#ifndef SDL_SLOW_MEMMOVE
|
||||
#ifdef SDL_memmove
|
||||
#undef SDL_memmove
|
||||
#endif
|
||||
#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);
|
||||
|
||||
/* Take advantage of compiler optimizations for memset */
|
||||
#ifndef SDL_SLOW_MEMSET
|
||||
#ifdef SDL_memset
|
||||
#undef SDL_memset
|
||||
#endif
|
||||
#define SDL_memset memset
|
||||
#endif
|
||||
|
||||
#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
|
||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
||||
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
||||
|
||||
#define SDL_copyp(dst, src) \
|
||||
{ SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \
|
||||
SDL_memcpy((dst), (src), sizeof (*(src)))
|
||||
|
||||
|
||||
|
||||
extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
||||
|
||||
extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
|
||||
extern 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);
|
||||
@ -703,36 +740,41 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
|
||||
#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
|
||||
|
||||
/* The analyzer knows about strlcpy even when the system doesn't provide it */
|
||||
#ifndef HAVE_STRLCPY
|
||||
#if !defined(HAVE_STRLCPY) && !defined(strlcpy)
|
||||
size_t strlcpy(char* dst, const char* src, size_t size);
|
||||
#endif
|
||||
|
||||
/* The analyzer knows about strlcat even when the system doesn't provide it */
|
||||
#ifndef HAVE_STRLCAT
|
||||
#if !defined(HAVE_STRLCAT) && !defined(strlcat)
|
||||
size_t strlcat(char* dst, const char* src, size_t size);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WCSLCPY
|
||||
#if !defined(HAVE_WCSLCPY) && !defined(wcslcpy)
|
||||
size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WCSLCAT
|
||||
#if !defined(HAVE_WCSLCAT) && !defined(wcslcat)
|
||||
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
||||
#endif
|
||||
|
||||
/* Starting LLVM 16, the analyser errors out if these functions do not have
|
||||
their prototype defined (clang-diagnostic-implicit-function-declaration) */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define SDL_malloc malloc
|
||||
#define SDL_calloc calloc
|
||||
#define SDL_realloc realloc
|
||||
#define SDL_free free
|
||||
#define SDL_memset memset
|
||||
#ifndef SDL_memcpy
|
||||
#define SDL_memcpy memcpy
|
||||
#endif
|
||||
#ifndef SDL_memmove
|
||||
#define SDL_memmove memmove
|
||||
#endif
|
||||
#ifndef SDL_memset
|
||||
#define SDL_memset memset
|
||||
#endif
|
||||
#define SDL_memcmp memcmp
|
||||
#define SDL_strlcpy strlcpy
|
||||
#define SDL_strlcat strlcat
|
||||
@ -759,11 +801,6 @@ size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
||||
#define SDL_vsnprintf vsnprintf
|
||||
#endif
|
||||
|
||||
SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords)
|
||||
{
|
||||
return SDL_memcpy(dst, src, dwords * 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* If a * b would overflow, return -1. Otherwise store a * b via ret
|
||||
* and return 0.
|
||||
|
350
include/SDL3/SDL_storage.h
Normal file
350
include/SDL3/SDL_storage.h
Normal file
@ -0,0 +1,350 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_storage.h
|
||||
*
|
||||
* Include file for storage container SDL API functions
|
||||
*/
|
||||
|
||||
#ifndef SDL_storage_h_
|
||||
#define SDL_storage_h_
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_filesystem.h>
|
||||
#include <SDL3/SDL_properties.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* !!! FIXME: Don't let this ship without async R/W support!!! */
|
||||
|
||||
typedef struct SDL_StorageInterface
|
||||
{
|
||||
/* Called when the storage is closed */
|
||||
int (SDLCALL *close)(void *userdata);
|
||||
|
||||
/* Optional, returns whether the storage is currently ready for access */
|
||||
SDL_bool (SDLCALL *ready)(void *userdata);
|
||||
|
||||
/* Enumerate a directory, optional for write-only storage */
|
||||
int (SDLCALL *enumerate)(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata);
|
||||
|
||||
/* Get path information, optional for write-only storage */
|
||||
int (SDLCALL *info)(void *userdata, const char *path, SDL_PathInfo *info);
|
||||
|
||||
/* Read a file from storage, optional for write-only storage */
|
||||
int (SDLCALL *read_file)(void *userdata, const char *path, void *destination, Uint64 length);
|
||||
|
||||
/* Write a file to storage, optional for read-only storage */
|
||||
int (SDLCALL *write_file)(void *userdata, const char *path, const void *source, Uint64 length);
|
||||
|
||||
/* Create a directory, optional for read-only storage */
|
||||
int (SDLCALL *mkdir)(void *userdata, const char *path);
|
||||
|
||||
/* Remove a file or empty directory, optional for read-only storage */
|
||||
int (SDLCALL *remove)(void *userdata, const char *path);
|
||||
|
||||
/* Rename a path, optional for read-only storage */
|
||||
int (SDLCALL *rename)(void *userdata, const char *oldpath, const char *newpath);
|
||||
|
||||
/* Get the space remaining, optional for read-only storage */
|
||||
Uint64 (SDLCALL *space_remaining)(void *userdata);
|
||||
|
||||
} SDL_StorageInterface;
|
||||
|
||||
typedef struct SDL_Storage SDL_Storage;
|
||||
|
||||
/**
|
||||
* Opens up a read-only container for the application's filesystem.
|
||||
*
|
||||
* \param override a path to override the backend's default title root
|
||||
* \param props a property list that may contain backend-specific information
|
||||
* \returns a title storage container on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseStorage
|
||||
* \sa SDL_GetStorageFileSize
|
||||
* \sa SDL_OpenUserStorage
|
||||
* \sa SDL_ReadStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override, SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Opens up a container for a user's unique read/write filesystem.
|
||||
*
|
||||
* While title storage can generally be kept open throughout runtime, user
|
||||
* storage should only be opened when the client is ready to read/write files.
|
||||
* This allows the backend to properly batch file operations and flush them
|
||||
* when the container has been closed; ensuring safe and optimal save I/O.
|
||||
*
|
||||
* \param org the name of your organization
|
||||
* \param app the name of your application
|
||||
* \param props a property list that may contain backend-specific information
|
||||
* \returns a user storage container on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseStorage
|
||||
* \sa SDL_GetStorageFileSize
|
||||
* \sa SDL_GetStorageSpaceRemaining
|
||||
* \sa SDL_OpenTitleStorage
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props);
|
||||
|
||||
/**
|
||||
* Opens up a container for local filesystem storage.
|
||||
*
|
||||
* This is provided for development and tools. Portable applications should
|
||||
* use SDL_OpenTitleStorage() for access to game data and
|
||||
* SDL_OpenUserStorage() for access to user data.
|
||||
*
|
||||
* \param path the base path prepended to all storage paths, or NULL for no
|
||||
* base path
|
||||
* \returns a filesystem storage container on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseStorage
|
||||
* \sa SDL_GetStorageFileSize
|
||||
* \sa SDL_GetStorageSpaceRemaining
|
||||
* \sa SDL_OpenTitleStorage
|
||||
* \sa SDL_OpenUserStorage
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path);
|
||||
|
||||
/**
|
||||
* Opens up a container using a client-provided storage interface.
|
||||
*
|
||||
* Applications do not need to use this function unless they are providing
|
||||
* their own SDL_Storage implementation. If you just need an SDL_Storage, you
|
||||
* should use the built-in implementations in SDL, like SDL_OpenTitleStorage()
|
||||
* or SDL_OpenUserStorage().
|
||||
*
|
||||
* \param iface the function table to be used by this container
|
||||
* \param userdata the pointer that will be passed to the store interface
|
||||
* \returns a storage container on success or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CloseStorage
|
||||
* \sa SDL_GetStorageFileSize
|
||||
* \sa SDL_GetStorageSpaceRemaining
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata);
|
||||
|
||||
/**
|
||||
* Closes and frees a storage container.
|
||||
*
|
||||
* \param storage a storage container to close
|
||||
* \returns 0 if the container was freed with no errors, a negative value
|
||||
* otherwise; call SDL_GetError() for more information. Even if the
|
||||
* function returns an error, the container data will be freed; the
|
||||
* error is only for informational purposes.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenFileStorage
|
||||
* \sa SDL_OpenStorage
|
||||
* \sa SDL_OpenTitleStorage
|
||||
* \sa SDL_OpenUserStorage
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CloseStorage(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Checks if the storage container is ready to use.
|
||||
*
|
||||
* This function should be called in regular intervals until it returns
|
||||
* SDL_TRUE - however, it is not recommended to spinwait on this call, as the
|
||||
* backend may depend on a synchronous message loop.
|
||||
*
|
||||
* \param storage a storage container to query
|
||||
* \returns SDL_TRUE if the container is ready, SDL_FALSE otherwise
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage);
|
||||
|
||||
/**
|
||||
* Query the size of a file within a storage container.
|
||||
*
|
||||
* \param storage a storage container to query
|
||||
* \param path the relative path of the file to query
|
||||
* \param length a pointer to be filled with the file's length
|
||||
* \returns 0 if the file could be queried, a negative value otherwise; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern 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
|
||||
* buffer.
|
||||
*
|
||||
* \param storage a storage container to read from
|
||||
* \param path the relative path of the file to read
|
||||
* \param destination a client-provided buffer to read the file into
|
||||
* \param length the length of the destination buffer
|
||||
* \returns 0 if the file was read, a negative value otherwise; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetStorageFileSize
|
||||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern 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.
|
||||
*
|
||||
* \param storage a storage container to write to
|
||||
* \param path the relative path of the file to write
|
||||
* \param source a client-provided buffer to write from
|
||||
* \param length the length of the source buffer
|
||||
* \returns 0 if the file was written, a negative value otherwise; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetStorageSpaceRemaining
|
||||
* \sa SDL_ReadStorageFile
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length);
|
||||
|
||||
/**
|
||||
* Create a directory in a writable storage container.
|
||||
*
|
||||
* \param storage a storage container
|
||||
* \param path the path of the directory to create
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path);
|
||||
|
||||
/**
|
||||
* Enumerate a directory in a storage container.
|
||||
*
|
||||
* \param storage a storage container
|
||||
* \param path the path of the directory to enumerate
|
||||
* \param callback a function that is called for each entry in the directory
|
||||
* \param userdata a pointer that is passed to `callback`
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern 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.
|
||||
*
|
||||
* \param storage a storage container
|
||||
* \param path the path of the directory to enumerate
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RemoveStoragePath(SDL_Storage *storage, const char *path);
|
||||
|
||||
/**
|
||||
* Rename a file or directory in a writable storage container.
|
||||
*
|
||||
* \param storage a storage container
|
||||
* \param oldpath the old path
|
||||
* \param newpath the new path
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath);
|
||||
|
||||
/**
|
||||
* Get information about a filesystem path in a storage container.
|
||||
*
|
||||
* \param storage a storage container
|
||||
* \param path the path to query
|
||||
* \param info a pointer filled in with information about the path, or NULL to
|
||||
* check for the existence of a file
|
||||
* \returns 0 on success or a negative error code if the file doesn't exist,
|
||||
* or another failure; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info);
|
||||
|
||||
/**
|
||||
* Queries the remaining space in a storage container.
|
||||
*
|
||||
* \param storage a storage container to query
|
||||
* \returns the amount of remaining space, in bytes
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_StorageReady
|
||||
* \sa SDL_WriteStorageFile
|
||||
*/
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *storage);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif /* SDL_storage_h_ */
|
@ -33,7 +33,7 @@
|
||||
#include <SDL3/SDL_pixels.h>
|
||||
#include <SDL3/SDL_properties.h>
|
||||
#include <SDL3/SDL_rect.h>
|
||||
#include <SDL3/SDL_rwops.h>
|
||||
#include <SDL3/SDL_iostream.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
@ -75,6 +75,15 @@ typedef enum
|
||||
SDL_SCALEMODE_BEST /**< anisotropic filtering */
|
||||
} SDL_ScaleMode;
|
||||
|
||||
/**
|
||||
* The flip mode
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_FLIP_NONE, /**< Do not flip */
|
||||
SDL_FLIP_HORIZONTAL, /**< flip horizontally */
|
||||
SDL_FLIP_VERTICAL /**< flip vertically */
|
||||
} SDL_FlipMode;
|
||||
|
||||
/**
|
||||
* A collection of pixels used in software blitting.
|
||||
@ -94,7 +103,6 @@ typedef enum
|
||||
*
|
||||
* \note This structure should be treated as read-only, except for \c pixels,
|
||||
* which, if not NULL, contains the raw pixel data for the surface.
|
||||
* \sa SDL_CreateSurfaceFrom
|
||||
*/
|
||||
typedef struct SDL_Surface
|
||||
{
|
||||
@ -128,16 +136,6 @@ typedef struct SDL_Surface
|
||||
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface *src, const SDL_Rect *srcrect,
|
||||
struct SDL_Surface *dst, const SDL_Rect *dstrect);
|
||||
|
||||
/**
|
||||
* The formula used for converting between YUV and RGB
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
|
||||
SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
|
||||
SDL_YUV_CONVERSION_BT709, /**< BT.709 */
|
||||
SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
|
||||
} SDL_YUV_CONVERSION_MODE;
|
||||
|
||||
/**
|
||||
* Allocate a new RGB surface with a specific pixel format.
|
||||
@ -153,8 +151,7 @@ typedef enum
|
||||
* \sa SDL_CreateSurfaceFrom
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface
|
||||
(int width, int height, Uint32 format);
|
||||
extern 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
|
||||
@ -172,7 +169,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface
|
||||
* \param pixels a pointer to existing pixel data
|
||||
* \param width the width of the surface
|
||||
* \param height the height of the surface
|
||||
* \param pitch the pitch of the surface in bytes
|
||||
* \param pitch the number of bytes between each row, including padding
|
||||
* \param format the SDL_PixelFormatEnum for the new surface's pixel format.
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
@ -182,8 +179,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface
|
||||
* \sa SDL_CreateSurface
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom
|
||||
(void *pixels, int width, int height, int pitch, Uint32 format);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, SDL_PixelFormatEnum format);
|
||||
|
||||
/**
|
||||
* Free an RGB surface.
|
||||
@ -196,14 +192,34 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom
|
||||
*
|
||||
* \sa SDL_CreateSurface
|
||||
* \sa SDL_CreateSurfaceFrom
|
||||
* \sa SDL_LoadBMP
|
||||
* \sa SDL_LoadBMP_RW
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
|
||||
|
||||
/**
|
||||
* Get the properties associated with a surface.
|
||||
*
|
||||
* The following properties are understood by SDL:
|
||||
*
|
||||
* - `SDL_PROP_SURFACE_COLORSPACE_NUMBER`: an SDL_ColorSpace value describing
|
||||
* the surface colorspace, defaults to SDL_COLORSPACE_SRGB_LINEAR for
|
||||
* floating point formats, SDL_COLORSPACE_HDR10 for 10-bit formats,
|
||||
* SDL_COLORSPACE_SRGB for other RGB surfaces and SDL_COLORSPACE_BT709_FULL
|
||||
* for YUV surfaces.
|
||||
* - `SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT`: for HDR10 and floating point
|
||||
* surfaces, this defines the value of 100% diffuse white, with higher
|
||||
* values being displayed in the High Dynamic Range headroom. This defaults
|
||||
* to 203 for HDR10 surfaces and 1.0 for floating point surfaces.
|
||||
* - `SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT`: for HDR10 and floating point
|
||||
* surfaces, this defines the maximum dynamic range used by the content, in
|
||||
* terms of the SDR white point. This defaults to 0.0, which disables tone
|
||||
* mapping.
|
||||
* - `SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING`: the tone mapping operator
|
||||
* used when compressing from a surface with high dynamic range to another
|
||||
* with lower dynamic range. Currently this supports "chrome", which uses
|
||||
* the same tone mapping that Chrome uses for HDR content, the form "*=N",
|
||||
* where N is a floating point scale factor applied in linear space, and
|
||||
* "none", which disables tone mapping. This defaults to "chrome".
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
@ -215,6 +231,43 @@ extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
|
||||
*/
|
||||
extern 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"
|
||||
#define SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT "SDL.surface.HDR_headroom"
|
||||
#define SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING "SDL.surface.tonemap"
|
||||
|
||||
/**
|
||||
* Set the colorspace used by a surface.
|
||||
*
|
||||
* Setting the colorspace doesn't change the pixels, only how they are
|
||||
* interpreted in color operations.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to update
|
||||
* \param colorspace an SDL_ColorSpace value describing the surface colorspace
|
||||
* \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_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace);
|
||||
|
||||
/**
|
||||
* Get the colorspace used by a surface.
|
||||
*
|
||||
* The colorspace defaults to SDL_COLORSPACE_SRGB_LINEAR for floating point
|
||||
* formats, SDL_COLORSPACE_HDR10 for 10-bit formats, SDL_COLORSPACE_SRGB for
|
||||
* other RGB surfaces and SDL_COLORSPACE_BT709_FULL for YUV textures.
|
||||
*
|
||||
* \param surface the SDL_Surface structure to query
|
||||
* \param colorspace a pointer filled in with an SDL_ColorSpace value
|
||||
* describing the surface colorspace
|
||||
* \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_GetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace *colorspace);
|
||||
|
||||
/**
|
||||
* Set the palette used by a surface.
|
||||
*
|
||||
@ -227,8 +280,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_SetSurfacePalette(SDL_Surface *surface,
|
||||
SDL_Palette *palette);
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette);
|
||||
|
||||
/**
|
||||
* Set up a surface for directly accessing the pixels.
|
||||
@ -271,7 +323,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
||||
* will result in a memory leak.
|
||||
*
|
||||
* \param src the data stream for the surface
|
||||
* \param freesrc if SDL_TRUE, calls SDL_RWclose() on `src` before returning,
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning,
|
||||
* even in the case of an error
|
||||
* \returns a pointer to a new SDL_Surface structure or NULL if there was an
|
||||
* error; call SDL_GetError() for more information.
|
||||
@ -280,9 +332,9 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
|
||||
*
|
||||
* \sa SDL_DestroySurface
|
||||
* \sa SDL_LoadBMP
|
||||
* \sa SDL_SaveBMP_RW
|
||||
* \sa SDL_SaveBMP_IO
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, SDL_bool freesrc);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Load a BMP image from a file.
|
||||
@ -297,7 +349,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, SDL_bool fre
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_DestroySurface
|
||||
* \sa SDL_LoadBMP_RW
|
||||
* \sa SDL_LoadBMP_IO
|
||||
* \sa SDL_SaveBMP
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
||||
@ -313,17 +365,17 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
|
||||
*
|
||||
* \param surface the SDL_Surface structure containing the image to be saved
|
||||
* \param dst a data stream to save to
|
||||
* \param freedst if SDL_TRUE, calls SDL_RWclose() on `dst` before returning,
|
||||
* \param closeio if SDL_TRUE, calls SDL_CloseIO() on `dst` before returning,
|
||||
* even in the case of an error
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_LoadBMP_RW
|
||||
* \sa SDL_LoadBMP_IO
|
||||
* \sa SDL_SaveBMP
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, SDL_bool freedst);
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio);
|
||||
|
||||
/**
|
||||
* Save a surface to a file.
|
||||
@ -342,7 +394,7 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst,
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_LoadBMP
|
||||
* \sa SDL_SaveBMP_RW
|
||||
* \sa SDL_SaveBMP_IO
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
|
||||
|
||||
@ -363,8 +415,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 DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag);
|
||||
|
||||
/**
|
||||
* Returns whether the surface is RLE enabled
|
||||
@ -401,11 +452,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BlitSurface
|
||||
* \sa SDL_GetSurfaceColorKey
|
||||
* \sa SDL_SurfaceHasColorKey
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface,
|
||||
int flag, Uint32 key);
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key);
|
||||
|
||||
/**
|
||||
* Returns whether the surface has a color key
|
||||
@ -437,11 +487,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BlitSurface
|
||||
* \sa SDL_SetSurfaceColorKey
|
||||
* \sa SDL_SurfaceHasColorKey
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface,
|
||||
Uint32 *key);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key);
|
||||
|
||||
/**
|
||||
* Set an additional color value multiplied into blit operations.
|
||||
@ -464,8 +513,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface,
|
||||
* \sa SDL_GetSurfaceColorMod
|
||||
* \sa SDL_SetSurfaceAlphaMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface,
|
||||
Uint8 r, Uint8 g, Uint8 b);
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
|
||||
/**
|
||||
@ -483,9 +531,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface,
|
||||
* \sa SDL_GetSurfaceAlphaMod
|
||||
* \sa SDL_SetSurfaceColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface,
|
||||
Uint8 *r, Uint8 *g,
|
||||
Uint8 *b);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b);
|
||||
|
||||
/**
|
||||
* Set an additional alpha value used in blit operations.
|
||||
@ -505,8 +551,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface,
|
||||
* \sa SDL_GetSurfaceAlphaMod
|
||||
* \sa SDL_SetSurfaceColorMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface,
|
||||
Uint8 alpha);
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha);
|
||||
|
||||
/**
|
||||
* Get the additional alpha value used in blit operations.
|
||||
@ -521,8 +566,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface,
|
||||
* \sa SDL_GetSurfaceColorMod
|
||||
* \sa SDL_SetSurfaceAlphaMod
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface,
|
||||
Uint8 *alpha);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha);
|
||||
|
||||
/**
|
||||
* Set the blend mode used for blit operations.
|
||||
@ -540,8 +584,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface,
|
||||
*
|
||||
* \sa SDL_GetSurfaceBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface,
|
||||
SDL_BlendMode blendMode);
|
||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode);
|
||||
|
||||
/**
|
||||
* Get the blend mode used for blit operations.
|
||||
@ -555,8 +598,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface,
|
||||
*
|
||||
* \sa SDL_SetSurfaceBlendMode
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface,
|
||||
SDL_BlendMode *blendMode);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode);
|
||||
|
||||
/**
|
||||
* Set the clipping rectangle for a surface.
|
||||
@ -575,11 +617,9 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BlitSurface
|
||||
* \sa SDL_GetSurfaceClipRect
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface,
|
||||
const SDL_Rect *rect);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect);
|
||||
|
||||
/**
|
||||
* Get the clipping rectangle for a surface.
|
||||
@ -596,11 +636,21 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_BlitSurface
|
||||
* \sa SDL_SetSurfaceClipRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface,
|
||||
SDL_Rect *rect);
|
||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
|
||||
|
||||
/*
|
||||
* Flip a surface vertically or horizontally.
|
||||
*
|
||||
* \param surface the surface to flip
|
||||
* \param flip the direction to flip
|
||||
* \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_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
|
||||
|
||||
/*
|
||||
* Creates a new surface identical to the existing surface.
|
||||
@ -612,6 +662,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface,
|
||||
* more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
|
||||
|
||||
@ -631,15 +683,15 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreatePixelFormat
|
||||
* \sa SDL_ConvertSurfaceFormat
|
||||
* \sa SDL_CreateSurface
|
||||
* \sa SDL_ConvertSurfaceFormatAndColorspace
|
||||
* \sa SDL_CreatePixelFormat
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface,
|
||||
const SDL_PixelFormat *format);
|
||||
extern 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 enum.
|
||||
* Copy an existing surface to a new surface of the specified format.
|
||||
*
|
||||
* This function operates just like SDL_ConvertSurface(), but accepts an
|
||||
* SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such,
|
||||
@ -647,19 +699,40 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface,
|
||||
* information for the destination surface, in case that would be important.
|
||||
*
|
||||
* \param surface the existing SDL_Surface structure to convert
|
||||
* \param pixel_format the SDL_PixelFormatEnum that the new surface is
|
||||
* optimized for
|
||||
* \param pixel_format the new pixel format
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreatePixelFormat
|
||||
* \sa SDL_ConvertSurface
|
||||
* \sa SDL_CreateSurface
|
||||
* \sa SDL_ConvertSurfaceFormatAndColorspace
|
||||
* \sa SDL_DestroySurface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surface,
|
||||
Uint32 pixel_format);
|
||||
extern 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
|
||||
* colorspace.
|
||||
*
|
||||
* This function converts an existing surface to a new format and colorspace
|
||||
* and returns the new surface. This will perform any pixel format and
|
||||
* colorspace conversion needed.
|
||||
*
|
||||
* \param surface the existing SDL_Surface structure to convert
|
||||
* \param pixel_format the new pixel format
|
||||
* \param colorspace the new colorspace
|
||||
* \param props an SDL_PropertiesID with additional color properties, or 0
|
||||
* \returns the new SDL_Surface structure that is created or NULL if it fails;
|
||||
* call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ConvertSurface
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* Copy a block of pixels of one format to another format.
|
||||
@ -676,12 +749,39 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surfa
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ConvertPixelsAndColorspace
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
||||
Uint32 src_format,
|
||||
const void *src, int src_pitch,
|
||||
Uint32 dst_format,
|
||||
void *dst, int dst_pitch);
|
||||
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);
|
||||
|
||||
/**
|
||||
* Copy a block of pixels of one format and colorspace to another format and
|
||||
* colorspace.
|
||||
*
|
||||
* \param width the width of the block to copy, in pixels
|
||||
* \param height the height of the block to copy, in pixels
|
||||
* \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
|
||||
* \param src_colorspace an SDL_ColorSpace value describing the colorspace of
|
||||
* the `src` pixels
|
||||
* \param src_properties an SDL_PropertiesID with additional source color
|
||||
* properties, or 0
|
||||
* \param src a pointer to the source pixels
|
||||
* \param src_pitch the pitch of the source pixels, in bytes
|
||||
* \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
|
||||
* \param dst_colorspace an SDL_ColorSpace value describing the colorspace of
|
||||
* the `dst` pixels
|
||||
* \param dst_properties an SDL_PropertiesID with additional destination color
|
||||
* properties, or 0
|
||||
* \param dst a pointer to be filled in with new pixel data
|
||||
* \param dst_pitch the pitch of the destination pixels, in bytes
|
||||
* \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.
|
||||
*
|
||||
* \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);
|
||||
|
||||
/**
|
||||
* Premultiply the alpha on a block of pixels.
|
||||
@ -703,11 +803,7 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
|
||||
Uint32 src_format,
|
||||
const void *src, int src_pitch,
|
||||
Uint32 dst_format,
|
||||
void *dst, int dst_pitch);
|
||||
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);
|
||||
|
||||
/**
|
||||
* Perform a fast fill of a rectangle with a specific color.
|
||||
@ -732,8 +828,7 @@ extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
|
||||
*
|
||||
* \sa SDL_FillSurfaceRects
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillSurfaceRect
|
||||
(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
|
||||
extern 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.
|
||||
@ -758,8 +853,7 @@ extern DECLSPEC int SDLCALL SDL_FillSurfaceRect
|
||||
*
|
||||
* \sa SDL_FillSurfaceRect
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_FillSurfaceRects
|
||||
(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
|
||||
extern 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.
|
||||
@ -829,9 +923,7 @@ extern DECLSPEC int SDLCALL SDL_FillSurfaceRects
|
||||
*
|
||||
* \sa SDL_BlitSurfaceScaled
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurface
|
||||
(SDL_Surface *src, const SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
|
||||
|
||||
/**
|
||||
* Perform low-level surface blitting only.
|
||||
@ -852,9 +944,7 @@ extern DECLSPEC int SDLCALL SDL_BlitSurface
|
||||
*
|
||||
* \sa SDL_BlitSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked
|
||||
(SDL_Surface *src, const SDL_Rect *srcrect,
|
||||
SDL_Surface *dst, const SDL_Rect *dstrect);
|
||||
extern 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.
|
||||
@ -876,14 +966,11 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked
|
||||
*
|
||||
* \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 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 surface copy to a destination surface.
|
||||
* Perform a scaled blit to a destination surface, which may be of a different
|
||||
* format.
|
||||
*
|
||||
* \param src the SDL_Surface structure to be copied from
|
||||
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
||||
@ -900,11 +987,7 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src,
|
||||
*
|
||||
* \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 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.
|
||||
@ -926,41 +1009,34 @@ extern DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src,
|
||||
*
|
||||
* \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 DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
|
||||
|
||||
/**
|
||||
* Set the YUV conversion mode
|
||||
* Retrieves a single pixel from a surface.
|
||||
*
|
||||
* \param mode YUV conversion mode
|
||||
* This function prioritizes correctness over speed: it is suitable for unit
|
||||
* tests, but is not intended for use in a game engine.
|
||||
*
|
||||
* Like SDL_GetRGBA, this uses the entire 0..255 range when converting color
|
||||
* components from pixel formats with less than 8 bits per RGB component.
|
||||
*
|
||||
* \param surface the surface to read
|
||||
* \param x the horizontal coordinate, 0 <= x < width
|
||||
* \param y the vertical coordinate, 0 <= y < height
|
||||
* \param r a pointer filled in with the red channel, 0-255, or NULL to ignore
|
||||
* this channel
|
||||
* \param g a pointer filled in with the green channel, 0-255, or NULL to
|
||||
* ignore this channel
|
||||
* \param b a pointer filled in with the blue channel, 0-255, or NULL to
|
||||
* ignore this channel
|
||||
* \param a a pointer filled in with the alpha channel, 0-255, or NULL to
|
||||
* ignore this channel
|
||||
* \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 void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
|
||||
|
||||
/**
|
||||
* Get the YUV conversion mode
|
||||
*
|
||||
* \returns YUV conversion mode
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
|
||||
|
||||
/**
|
||||
* Get the YUV conversion mode, returning the correct mode for the resolution
|
||||
* when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
|
||||
*
|
||||
* \param width width
|
||||
* \param height height
|
||||
* \returns YUV conversion mode
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
|
||||
extern 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
|
||||
|
@ -43,7 +43,7 @@ extern "C" {
|
||||
/*
|
||||
* Platform specific functions for Windows
|
||||
*/
|
||||
#if defined(__WIN32__) || defined(__GDK__)
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)
|
||||
|
||||
typedef struct tagMSG MSG;
|
||||
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
||||
@ -62,9 +62,9 @@ typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
||||
|
||||
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) */
|
||||
|
||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
||||
|
||||
/**
|
||||
* Get the D3D9 adapter index that matches the specified display.
|
||||
@ -80,9 +80,9 @@ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook ca
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
|
||||
|
||||
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
||||
|
||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
|
||||
|
||||
/**
|
||||
* Get the DXGI Adapter and Output indices for the specified display.
|
||||
@ -101,7 +101,7 @@ extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
|
||||
|
||||
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
||||
#endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */
|
||||
|
||||
/*
|
||||
* Platform specific functions for UNIX
|
||||
@ -127,7 +127,7 @@ extern DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void
|
||||
/*
|
||||
* Platform specific functions for Linux
|
||||
*/
|
||||
#ifdef __LINUX__
|
||||
#ifdef SDL_PLATFORM_LINUX
|
||||
|
||||
/**
|
||||
* Sets the UNIX nice value for a thread.
|
||||
@ -158,12 +158,12 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
|
||||
#endif /* __LINUX__ */
|
||||
#endif /* SDL_PLATFORM_LINUX */
|
||||
|
||||
/*
|
||||
* Platform specific functions for iOS
|
||||
*/
|
||||
#ifdef __IOS__
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
|
||||
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
||||
|
||||
@ -219,13 +219,13 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window,
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
||||
|
||||
#endif /* __IOS__ */
|
||||
#endif /* SDL_PLATFORM_IOS */
|
||||
|
||||
|
||||
/*
|
||||
* Platform specific functions for Android
|
||||
*/
|
||||
#ifdef __ANDROID__
|
||||
#ifdef SDL_PLATFORM_ANDROID
|
||||
|
||||
/**
|
||||
* Get the Android Java Native Interface Environment of the current thread.
|
||||
@ -399,17 +399,38 @@ extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
|
||||
|
||||
|
||||
typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted);
|
||||
|
||||
/**
|
||||
* Request permissions at runtime.
|
||||
* Request permissions at runtime, asynchronously.
|
||||
*
|
||||
* This blocks the calling thread until the permission is granted or denied.
|
||||
* You do not need to call this for built-in functionality of SDL; recording
|
||||
* from a microphone or reading images from a camera, using standard SDL APIs,
|
||||
* will manage permission requests for you.
|
||||
*
|
||||
* This function never blocks. Instead, the app-supplied callback will be
|
||||
* called when a decision has been made. This callback may happen on a
|
||||
* different thread, and possibly much later, as it might wait on a user to
|
||||
* respond to a system dialog. If permission has already been granted for a
|
||||
* specific entitlement, the callback will still fire, probably on the current
|
||||
* thread and before this function returns.
|
||||
*
|
||||
* If the request submission fails, this function returns -1 and the callback
|
||||
* will NOT be called, but this should only happen in catastrophic conditions,
|
||||
* like memory running out. Normally there will be a yes or no to the request
|
||||
* through the callback.
|
||||
*
|
||||
* \param permission The permission to request.
|
||||
* \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
|
||||
* \param cb The callback to trigger when the request has a response.
|
||||
* \param userdata An app-controlled pointer that is passed to the callback.
|
||||
* \returns zero if the request was submitted, -1 if there was an error
|
||||
* submitting. The result of the request is only ever reported
|
||||
* through the callback, not this return value.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata);
|
||||
|
||||
/**
|
||||
* Shows an Android toast notification.
|
||||
@ -451,12 +472,12 @@ extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int durati
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
#endif /* SDL_PLATFORM_ANDROID */
|
||||
|
||||
/*
|
||||
* Platform specific functions for WinRT
|
||||
*/
|
||||
#ifdef __WINRT__
|
||||
#ifdef SDL_PLATFORM_WINRT
|
||||
|
||||
/**
|
||||
* WinRT / Windows Phone path types
|
||||
@ -556,7 +577,7 @@ extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathT
|
||||
*/
|
||||
extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
|
||||
|
||||
#endif /* __WINRT__ */
|
||||
#endif /* SDL_PLATFORM_WINRT */
|
||||
|
||||
/**
|
||||
* Query if the current device is a tablet.
|
||||
@ -610,7 +631,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
||||
|
||||
#ifdef __IOS__
|
||||
#ifdef SDL_PLATFORM_IOS
|
||||
/*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
@ -620,7 +641,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void
|
||||
/*
|
||||
* Functions used only by GDK
|
||||
*/
|
||||
#ifdef __GDK__
|
||||
#ifdef SDL_PLATFORM_GDK
|
||||
typedef struct XTaskQueueObject *XTaskQueueHandle;
|
||||
typedef struct XUser *XUserHandle;
|
||||
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#ifdef __PSP__
|
||||
#ifdef SDL_PLATFORM_PSP
|
||||
#define DEFAULT_WINDOW_WIDTH 480
|
||||
#define DEFAULT_WINDOW_HEIGHT 272
|
||||
#elif defined(__VITA__)
|
||||
#elif defined(SDL_PLATFORM_VITA)
|
||||
#define DEFAULT_WINDOW_WIDTH 960
|
||||
#define DEFAULT_WINDOW_HEIGHT 544
|
||||
#else
|
||||
@ -65,7 +65,7 @@ typedef struct
|
||||
SDL_DisplayID displayID;
|
||||
const char *window_title;
|
||||
const char *window_icon;
|
||||
Uint32 window_flags;
|
||||
SDL_WindowFlags window_flags;
|
||||
SDL_bool flash_on_focus_loss;
|
||||
int window_x;
|
||||
int window_y;
|
||||
|
@ -44,27 +44,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Retrieves a single pixel from a surface.
|
||||
*
|
||||
* This function prioritizes correctness over speed: it is suitable for
|
||||
* unit tests, but is not intended for use in a game engine.
|
||||
*
|
||||
* Like SDL_GetRGBA, this uses the entire 0..255 range when converting
|
||||
* color components from pixel formats with less than 8 bits per RGB
|
||||
* component.
|
||||
*
|
||||
* \param surface The surface
|
||||
* \param x Horizontal coordinate, 0 <= x < width
|
||||
* \param y Vertical coordinate, 0 <= y < height
|
||||
* \param r Pointer to location to store red channel, 0-255
|
||||
* \param g Pointer to location to store green channel, 0-255
|
||||
* \param b Pointer to location to store blue channel, 0-255
|
||||
* \param a Pointer to location to store alpha channel, 0-255
|
||||
* \returns 0 if the surface is valid and the coordinates are in-bounds
|
||||
*/
|
||||
int SDLTest_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
|
||||
|
||||
/**
|
||||
* Compares a surface and with reference image data for equality
|
||||
*
|
||||
|
@ -63,7 +63,7 @@ extern "C" {
|
||||
/**
|
||||
* Data structure for CRC32 (checksum) computation
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct SDLTest_Crc32Context {
|
||||
CrcUint32 crc32_table[256]; /* CRC table */
|
||||
} SDLTest_Crc32Context;
|
||||
|
||||
|
@ -68,7 +68,7 @@ extern "C" {
|
||||
typedef Uint32 MD5UINT4;
|
||||
|
||||
/* Data structure for MD5 (Message-Digest) computation */
|
||||
typedef struct {
|
||||
typedef struct SDLTest_Md5Context {
|
||||
MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
|
||||
MD5UINT4 buf[4]; /* scratch buffer */
|
||||
unsigned char in[64]; /* input buffer */
|
||||
|
@ -56,7 +56,7 @@ extern "C" {
|
||||
/*
|
||||
* Context structure for the random number generator state.
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct SDLTest_RandomContext {
|
||||
unsigned int a;
|
||||
unsigned int x;
|
||||
unsigned int c;
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <SDL3/SDL_atomic.h>
|
||||
#include <SDL3/SDL_mutex.h>
|
||||
|
||||
#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
|
||||
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(SDL_PLATFORM_WINRT)
|
||||
#include <process.h> /* _beginthreadex() and _endthreadex() */
|
||||
#endif
|
||||
|
||||
@ -50,10 +50,10 @@ struct SDL_Thread;
|
||||
typedef struct SDL_Thread SDL_Thread;
|
||||
|
||||
/* The SDL thread ID */
|
||||
typedef unsigned long SDL_threadID;
|
||||
typedef Uint64 SDL_ThreadID;
|
||||
|
||||
/* Thread local storage ID, 0 is the invalid ID */
|
||||
typedef unsigned int SDL_TLSID;
|
||||
typedef Uint32 SDL_TLSID;
|
||||
|
||||
/**
|
||||
* The SDL thread priority.
|
||||
@ -81,7 +81,7 @@ typedef enum {
|
||||
typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
|
||||
|
||||
|
||||
#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__)
|
||||
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(SDL_PLATFORM_WINRT)
|
||||
/**
|
||||
* \file SDL_thread.h
|
||||
*
|
||||
@ -190,8 +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 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
||||
|
||||
/**
|
||||
* Create a new thread with a specific stack size.
|
||||
@ -220,10 +219,6 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
||||
* multiple of the system's page size (in many cases, this is 4 kilobytes, but
|
||||
* check your system documentation).
|
||||
*
|
||||
* In SDL 2.1, stack size will be folded into the original SDL_CreateThread
|
||||
* function, but for backwards compatibility, this is currently a separate
|
||||
* function.
|
||||
*
|
||||
* \param fn the SDL_ThreadFunction function to call in the new thread
|
||||
* \param name the name of the thread
|
||||
* \param stacksize the size, in bytes, to allocate for the new thread stack.
|
||||
@ -234,10 +229,10 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \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 DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
|
||||
|
||||
#endif
|
||||
|
||||
@ -252,8 +247,6 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
|
||||
* NULL if it doesn't have a name.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateThread
|
||||
*/
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
||||
|
||||
@ -273,7 +266,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
|
||||
*
|
||||
* \sa SDL_GetThreadID
|
||||
*/
|
||||
extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
||||
extern DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void);
|
||||
|
||||
/**
|
||||
* Get the thread identifier for the specified thread.
|
||||
@ -288,9 +281,9 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_ThreadID
|
||||
* \sa SDL_GetCurrentThreadID
|
||||
*/
|
||||
extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
||||
extern DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
|
||||
|
||||
/**
|
||||
* Set the priority for the current thread.
|
||||
@ -402,7 +395,6 @@ extern DECLSPEC SDL_TLSID SDLCALL SDL_CreateTLS(void);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateTLS
|
||||
* \sa SDL_SetTLS
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID id);
|
||||
@ -427,7 +419,6 @@ extern DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID id);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateTLS
|
||||
* \sa SDL_GetTLS
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
|
||||
|
208
include/SDL3/SDL_time.h
Normal file
208
include/SDL3/SDL_time.h
Normal file
@ -0,0 +1,208 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef SDL_time_h_
|
||||
#define SDL_time_h_
|
||||
|
||||
/**
|
||||
* \file SDL_time.h
|
||||
*
|
||||
* Header for the SDL realtime clock and date/time routines.
|
||||
*/
|
||||
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A structure holding a calendar date and time broken down into its components.
|
||||
*/
|
||||
typedef struct SDL_DateTime
|
||||
{
|
||||
int year; /**< Year */
|
||||
int month; /**< Month [01-12] */
|
||||
int day; /**< Day of the month [01-31] */
|
||||
int hour; /**< Hour [0-23] */
|
||||
int minute; /**< Minute [0-59] */
|
||||
int second; /**< Seconds [0-60] */
|
||||
int nanosecond; /**< Nanoseconds [0-999999999] */
|
||||
int day_of_week; /**< Day of the week [0-6] (0 being Sunday) */
|
||||
int utc_offset; /**< Seconds east of UTC */
|
||||
} SDL_DateTime;
|
||||
|
||||
/**
|
||||
* The preferred date format of the current system locale.
|
||||
*
|
||||
* \sa SDL_PROP_GLOBAL_SYSTEM_DATE_FORMAT_NUMBER
|
||||
*/
|
||||
typedef enum SDL_DATE_FORMAT
|
||||
{
|
||||
SDL_DATE_FORMAT_YYYYMMDD = 0, /**< Year/Month/Day */
|
||||
SDL_DATE_FORMAT_DDMMYYYY = 1, /**< Day/Month/Year */
|
||||
SDL_DATE_FORMAT_MMDDYYYY = 2, /**< Month/Day/Year */
|
||||
} SDL_DATE_FORMAT;
|
||||
|
||||
/**
|
||||
* The preferred time format of the current system locale.
|
||||
*
|
||||
* \sa SDL_PROP_GLOBAL_SYSTEM_TIME_FORMAT_NUMBER
|
||||
*/
|
||||
typedef enum SDL_TIME_FORMAT
|
||||
{
|
||||
SDL_TIME_FORMAT_24HR = 0, /**< 24 hour time */
|
||||
SDL_TIME_FORMAT_12HR = 1, /**< 12 hour time */
|
||||
} SDL_TIME_FORMAT;
|
||||
|
||||
/**
|
||||
* Global date/time properties
|
||||
*
|
||||
* - `SDL_PROP_GLOBAL_SYSTEM_DATE_FORMAT_NUMBER`: the SDL_DATE_FORMAT to use as the preferred date display format
|
||||
* for the current system locale.
|
||||
* - `SDL_PROP_GLOBAL_SYSTEM_TIME_FORMAT_NUMBER`: the SDL_TIME_FORMAT to use as the preferred time display format
|
||||
* for the current system locale.
|
||||
*/
|
||||
#define SDL_PROP_GLOBAL_SYSTEM_DATE_FORMAT_NUMBER "SDL.time.date_format"
|
||||
#define SDL_PROP_GLOBAL_SYSTEM_TIME_FORMAT_NUMBER "SDL.time.time_format"
|
||||
|
||||
/**
|
||||
* Gets the current value of the system realtime clock in nanoseconds since
|
||||
* Jan 1, 1970 in Universal Coordinated Time (UTC).
|
||||
*
|
||||
* \param ticks the SDL_Time to hold the returned tick count
|
||||
* \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_GetCurrentTime(SDL_Time *ticks);
|
||||
|
||||
/**
|
||||
* Converts an SDL_Time in nanoseconds since the epoch to a calendar time in
|
||||
* the SDL_DateTime format.
|
||||
*
|
||||
* \param ticks the SDL_Time to be converted
|
||||
* \param dt the resulting SDL_DateTime
|
||||
* \param localTime the resulting SDL_DateTime will be expressed in local time
|
||||
* if true, otherwise it will be in Universal Coordinated
|
||||
* Time (UTC)
|
||||
* \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_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime);
|
||||
|
||||
/**
|
||||
* Converts a calendar time to an SDL_Time in nanoseconds since the epoch.
|
||||
*
|
||||
* This function ignores the day_of_week member of the SDL_DateTime struct, so
|
||||
* it may remain unset.
|
||||
*
|
||||
* \param dt the source SDL_DateTime
|
||||
* \param ticks the resulting SDL_Time
|
||||
* \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_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks);
|
||||
|
||||
/**
|
||||
* Converts an SDL time into a Windows FILETIME (100-nanosecond intervals
|
||||
* since January 1, 1601).
|
||||
*
|
||||
* This function fills in the two 32-bit values of the FILETIME structure.
|
||||
*
|
||||
* \param ticks the time to convert
|
||||
* \param dwLowDateTime a pointer filled in with the low portion of the
|
||||
* Windows FILETIME value
|
||||
* \param dwHighDateTime a pointer filled in with the high portion of the
|
||||
* Windows FILETIME value
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_TimeToWindows(SDL_Time ticks, Uint32 *dwLowDateTime, Uint32 *dwHighDateTime);
|
||||
|
||||
/**
|
||||
* Converts a Windows FILETIME (100-nanosecond intervals since January 1,
|
||||
* 1601) to an SDL time
|
||||
*
|
||||
* This function takes the two 32-bit values of the FILETIME structure as
|
||||
* parameters.
|
||||
*
|
||||
* \param dwLowDateTime the low portion of the Windows FILETIME value
|
||||
* \param dwHighDateTime the high portion of the Windows FILETIME value
|
||||
* \returns the converted SDL time
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, Uint32 dwHighDateTime);
|
||||
|
||||
/**
|
||||
* Get the number of days in a month for a given year.
|
||||
*
|
||||
* \param year the year
|
||||
* \param month the month [1-12]
|
||||
* \returns the number of days in the requested month, otherwise -1; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month);
|
||||
|
||||
/**
|
||||
* Get the day of year for a calendar date.
|
||||
*
|
||||
* \param year the year component of the date
|
||||
* \param month the month component of the date
|
||||
* \param day the day component of the date
|
||||
* \returns the day of year [0-365] if the date is valid, otherwise -1; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day);
|
||||
|
||||
/**
|
||||
* Get the day of week for a calendar date.
|
||||
*
|
||||
* \param year the year component of the date
|
||||
* \param month the month component of the date
|
||||
* \param day the day component of the date
|
||||
* \returns a value between 0 and 6 (0 being Sunday) if the date is valid,
|
||||
* otherwise -1; call SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetDayOfWeek(int year, int month, int day);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif /* SDL_time_h_ */
|
@ -45,10 +45,12 @@ extern "C" {
|
||||
#define SDL_NS_PER_SECOND 1000000000LL
|
||||
#define SDL_NS_PER_MS 1000000
|
||||
#define SDL_NS_PER_US 1000
|
||||
#define SDL_MS_TO_NS(MS) (((Uint64)(MS)) * SDL_NS_PER_MS)
|
||||
#define SDL_NS_TO_MS(NS) ((NS) / SDL_NS_PER_MS)
|
||||
#define SDL_US_TO_NS(US) (((Uint64)(US)) * SDL_NS_PER_US)
|
||||
#define SDL_NS_TO_US(NS) ((NS) / SDL_NS_PER_US)
|
||||
#define SDL_SECONDS_TO_NS(S) (((Uint64)(S)) * SDL_NS_PER_SECOND)
|
||||
#define SDL_NS_TO_SECONDS(NS) ((NS) / SDL_NS_PER_SECOND)
|
||||
#define SDL_MS_TO_NS(MS) (((Uint64)(MS)) * SDL_NS_PER_MS)
|
||||
#define SDL_NS_TO_MS(NS) ((NS) / SDL_NS_PER_MS)
|
||||
#define SDL_US_TO_NS(US) (((Uint64)(US)) * SDL_NS_PER_US)
|
||||
#define SDL_NS_TO_US(NS) ((NS) / SDL_NS_PER_US)
|
||||
|
||||
/**
|
||||
* Get the number of milliseconds since SDL library initialization.
|
||||
@ -137,7 +139,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval, void *param);
|
||||
/**
|
||||
* Definition of the timer ID type.
|
||||
*/
|
||||
typedef int SDL_TimerID;
|
||||
typedef Uint32 SDL_TimerID;
|
||||
|
||||
/**
|
||||
* Call a callback function at a future time.
|
||||
|
@ -38,8 +38,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef Sint64 SDL_TouchID;
|
||||
typedef Sint64 SDL_FingerID;
|
||||
typedef Uint64 SDL_TouchID;
|
||||
typedef Uint64 SDL_FingerID;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@ -58,10 +58,10 @@ typedef struct SDL_Finger
|
||||
} SDL_Finger;
|
||||
|
||||
/* Used as the device ID for mouse events simulated with touch input */
|
||||
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
|
||||
#define SDL_TOUCH_MOUSEID ((SDL_MouseID)-1)
|
||||
|
||||
/* Used as the SDL_TouchID for touch events simulated with mouse input */
|
||||
#define SDL_MOUSE_TOUCHID ((Sint64)-1)
|
||||
#define SDL_MOUSE_TOUCHID ((SDL_TouchID)-1)
|
||||
|
||||
|
||||
/**
|
||||
@ -131,6 +131,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
|
||||
* given ID and index could be found.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetNumTouchFingers
|
||||
*/
|
||||
extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
|
||||
|
||||
|
@ -48,32 +48,32 @@ extern "C" {
|
||||
* \sa SDL_VERSION
|
||||
* \sa SDL_GetVersion
|
||||
*/
|
||||
typedef struct SDL_version
|
||||
typedef struct SDL_Version
|
||||
{
|
||||
Uint8 major; /**< major version */
|
||||
Uint8 minor; /**< minor version */
|
||||
Uint8 patch; /**< update version */
|
||||
} SDL_version;
|
||||
} SDL_Version;
|
||||
|
||||
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
||||
*/
|
||||
#define SDL_MAJOR_VERSION 3
|
||||
#define SDL_MINOR_VERSION 0
|
||||
#define SDL_MINOR_VERSION 1
|
||||
#define SDL_PATCHLEVEL 0
|
||||
|
||||
/**
|
||||
* Macro to determine SDL version program was compiled against.
|
||||
*
|
||||
* This macro fills in a SDL_version structure with the version of the
|
||||
* 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 a SDL_version struct to initialize.
|
||||
* \param x A pointer to an SDL_Version struct to initialize.
|
||||
*
|
||||
* \sa SDL_version
|
||||
* \sa SDL_Version
|
||||
* \sa SDL_GetVersion
|
||||
*/
|
||||
#define SDL_VERSION(x) \
|
||||
@ -114,7 +114,7 @@ typedef struct SDL_version
|
||||
*
|
||||
* This function may be called safely at any time, even before SDL_Init().
|
||||
*
|
||||
* \param ver the SDL_version structure that contains the version information
|
||||
* \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.
|
||||
*
|
||||
@ -122,7 +122,7 @@ typedef struct SDL_version
|
||||
*
|
||||
* \sa SDL_GetRevision
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_version * ver);
|
||||
extern DECLSPEC int SDLCALL SDL_GetVersion(SDL_Version * ver);
|
||||
|
||||
/**
|
||||
* Get the code revision of SDL that is linked against your program.
|
||||
|
@ -47,7 +47,7 @@ typedef Uint32 SDL_WindowID;
|
||||
/**
|
||||
* Global video properties
|
||||
*
|
||||
* - `SDL_PROPERTY_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER`: the pointer to
|
||||
* - `SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER`: the pointer to
|
||||
* the global `wl_display` object used by the Wayland video backend. Can be
|
||||
* set before the video subsystem is initialized to import an external
|
||||
* `wl_display` object from an application or toolkit for use in SDL, or
|
||||
@ -58,7 +58,7 @@ typedef Uint32 SDL_WindowID;
|
||||
* if one was set prior to initialization, or NULL. See
|
||||
* docs/README-wayland.md for more information.
|
||||
*/
|
||||
#define SDL_PROPERTY_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER "video.wayland.wl_display"
|
||||
#define SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER "SDL.video.wayland.wl_display"
|
||||
|
||||
/**
|
||||
* System theme
|
||||
@ -82,7 +82,7 @@ typedef enum
|
||||
typedef struct
|
||||
{
|
||||
SDL_DisplayID displayID; /**< the display this mode is associated with */
|
||||
Uint32 format; /**< pixel format */
|
||||
SDL_PixelFormatEnum format; /**< pixel format */
|
||||
int w; /**< width */
|
||||
int h; /**< height */
|
||||
float pixel_density; /**< scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) */
|
||||
@ -104,35 +104,6 @@ typedef enum
|
||||
|
||||
/**
|
||||
* The type used to identify a window
|
||||
*
|
||||
* \sa SDL_CreateWindow
|
||||
* \sa SDL_CreateWindowWithProperties
|
||||
* \sa SDL_DestroyWindow
|
||||
* \sa SDL_FlashWindow
|
||||
* \sa SDL_GetWindowFlags
|
||||
* \sa SDL_GetWindowGrab
|
||||
* \sa SDL_GetWindowKeyboardGrab
|
||||
* \sa SDL_GetWindowMouseGrab
|
||||
* \sa SDL_GetWindowPosition
|
||||
* \sa SDL_GetWindowSize
|
||||
* \sa SDL_GetWindowTitle
|
||||
* \sa SDL_HideWindow
|
||||
* \sa SDL_MaximizeWindow
|
||||
* \sa SDL_MinimizeWindow
|
||||
* \sa SDL_RaiseWindow
|
||||
* \sa SDL_RestoreWindow
|
||||
* \sa SDL_SetWindowFullscreen
|
||||
* \sa SDL_SetWindowGrab
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
* \sa SDL_SetWindowMouseGrab
|
||||
* \sa SDL_SetWindowIcon
|
||||
* \sa SDL_SetWindowPosition
|
||||
* \sa SDL_SetWindowSize
|
||||
* \sa SDL_SetWindowBordered
|
||||
* \sa SDL_SetWindowResizable
|
||||
* \sa SDL_SetWindowTitle
|
||||
* \sa SDL_ShowWindow
|
||||
* \sa SDL_ShowWindowSystemMenu
|
||||
*/
|
||||
typedef struct SDL_Window SDL_Window;
|
||||
|
||||
@ -141,6 +112,8 @@ typedef struct SDL_Window SDL_Window;
|
||||
*
|
||||
* \sa SDL_GetWindowFlags
|
||||
*/
|
||||
typedef Uint32 SDL_WindowFlags;
|
||||
|
||||
#define SDL_WINDOW_FULLSCREEN 0x00000001U /**< window is in fullscreen mode */
|
||||
#define SDL_WINDOW_OPENGL 0x00000002U /**< window usable with OpenGL context */
|
||||
#define SDL_WINDOW_OCCLUDED 0x00000004U /**< window is occluded */
|
||||
@ -353,6 +326,21 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
||||
/**
|
||||
* Get the properties associated with a display.
|
||||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN`: true if the display has HDR
|
||||
* headroom above the SDR white point. This property can change dynamically
|
||||
* when SDL_EVENT_DISPLAY_HDR_STATE_CHANGED is sent.
|
||||
* - `SDL_PROP_DISPLAY_SDR_WHITE_POINT_FLOAT`: the value of SDR white in the
|
||||
* SDL_COLORSPACE_SRGB_LINEAR colorspace. On Windows this corresponds to the
|
||||
* SDR white level in scRGB colorspace, and on Apple platforms this is
|
||||
* always 1.0 for EDR content. This property can change dynamically when
|
||||
* SDL_EVENT_DISPLAY_HDR_STATE_CHANGED is sent.
|
||||
* - `SDL_PROP_DISPLAY_HDR_HEADROOM_FLOAT`: the additional high dynamic range
|
||||
* that can be displayed, in terms of the SDR white point. When HDR is not
|
||||
* enabled, this will be 1.0. This property can change dynamically when
|
||||
* SDL_EVENT_DISPLAY_HDR_STATE_CHANGED is sent.
|
||||
*
|
||||
* \param displayID the instance ID of the display to query
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
@ -364,6 +352,10 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
||||
*/
|
||||
extern 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"
|
||||
#define SDL_PROP_DISPLAY_HDR_HEADROOM_FLOAT "SDL.display.HDR_headroom"
|
||||
|
||||
/**
|
||||
* Get the name of a display in UTF-8 encoding.
|
||||
*
|
||||
@ -654,8 +646,9 @@ extern DECLSPEC float SDLCALL SDL_GetWindowDisplayScale(SDL_Window *window);
|
||||
*
|
||||
* \param window the window to affect
|
||||
* \param mode a pointer to the display mode to use, which can be NULL for
|
||||
* desktop mode, or one of the fullscreen modes returned by
|
||||
* SDL_GetFullscreenDisplayModes().
|
||||
* borderless fullscreen desktop mode, or one of the fullscreen
|
||||
* modes returned by SDL_GetFullscreenDisplayModes() to set an
|
||||
* exclusive fullscreen mode.
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
@ -671,7 +664,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, cons
|
||||
* Query the display mode to use when a window is visible at fullscreen.
|
||||
*
|
||||
* \param window the window to query
|
||||
* \returns a pointer to the fullscreen mode to use or NULL for desktop mode
|
||||
* \returns a pointer to the exclusive fullscreen mode to use or NULL for
|
||||
* borderless fullscreen desktop mode
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
@ -763,7 +757,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, Uint32 flags);
|
||||
extern 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.
|
||||
@ -818,93 +812,104 @@ 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, Uint32 flags);
|
||||
extern 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.
|
||||
*
|
||||
* These are the supported properties:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN`: true if the window
|
||||
* should be always on top
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_BORDERLESS_BOOLEAN`: true if the window has
|
||||
* no window decoration
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_FOCUSABLE_BOOLEAN`: true if the window should
|
||||
* - `SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN`: true if the window should
|
||||
* be always on top
|
||||
* - `SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN`: true if the window has no
|
||||
* window decoration
|
||||
* - `SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN`: true if the
|
||||
* window will be used with an externally managed graphics context.
|
||||
* - `SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN`: true if the window should
|
||||
* accept keyboard input (defaults true)
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_FULLSCREEN_BOOLEAN`: true if the window
|
||||
* should start in fullscreen mode at desktop resolution
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_HEIGHT_NUMBER`: the height of the window
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_HIDDEN_BOOLEAN`: true if the window should
|
||||
* start hidden
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN`: true if the
|
||||
* window uses a high pixel density buffer if possible
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_MAXIMIZED_BOOLEAN`: true if the window should
|
||||
* - `SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN`: true if the window should
|
||||
* start in fullscreen mode at desktop resolution
|
||||
* - `SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER`: the height of the window
|
||||
* - `SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN`: true if the window should start
|
||||
* hidden
|
||||
* - `SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN`: true if the window
|
||||
* uses a high pixel density buffer if possible
|
||||
* - `SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN`: true if the window should
|
||||
* start maximized
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_MENU_BOOLEAN`: true if the window is a popup
|
||||
* menu
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_METAL_BOOLEAN`: true if the window will be
|
||||
* used with Metal rendering
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_MINIMIZED_BOOLEAN`: true if the window should
|
||||
* - `SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN`: true if the window is a popup menu
|
||||
* - `SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN`: true if the window will be used
|
||||
* with Metal rendering
|
||||
* - `SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN`: true if the window should
|
||||
* start minimized
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN`: true if the window
|
||||
* starts with grabbed mouse focus
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_OPENGL_BOOLEAN`: true if the window will be
|
||||
* used with OpenGL rendering
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_PARENT_POINTER`: an SDL_Window that will be
|
||||
* the parent of this window, required for windows with the "toolip" and
|
||||
* "menu" properties
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_RESIZABLE_BOOLEAN`: true if the window should
|
||||
* be resizable
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_TITLE_STRING`: the title of the window, in
|
||||
* UTF-8 encoding
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_TRANSPARENT_BOOLEAN`: true if the window show
|
||||
* - `SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN`: true if the window starts
|
||||
* with grabbed mouse focus
|
||||
* - `SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN`: true if the window will be used
|
||||
* with OpenGL rendering
|
||||
* - `SDL_PROP_WINDOW_CREATE_PARENT_POINTER`: an SDL_Window that will be the
|
||||
* parent of this window, required for windows with the "toolip" and "menu"
|
||||
* properties
|
||||
* - `SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN`: true if the window should be
|
||||
* resizable
|
||||
* - `SDL_PROP_WINDOW_CREATE_TITLE_STRING`: the title of the window, in UTF-8
|
||||
* encoding
|
||||
* - `SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN`: true if the window show
|
||||
* transparent in the areas with alpha of 0
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_TOOLTIP_BOOLEAN`: true if the window is a
|
||||
* tooltip
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_UTILITY_BOOLEAN`: true if the window is a
|
||||
* utility window, not showing in the task bar and window list
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_VULKAN_BOOLEAN`: true if the window will be
|
||||
* used with Vulkan rendering
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_WIDTH_NUMBER`: the width of the window
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_X_NUMBER`: the x position of the window, or
|
||||
* - `SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN`: true if the window is a tooltip
|
||||
* - `SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN`: true if the window is a utility
|
||||
* window, not showing in the task bar and window list
|
||||
* - `SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN`: true if the window will be used
|
||||
* with Vulkan rendering
|
||||
* - `SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER`: the width of the window
|
||||
* - `SDL_PROP_WINDOW_CREATE_X_NUMBER`: the x position of the window, or
|
||||
* `SDL_WINDOWPOS_CENTERED`, defaults to `SDL_WINDOWPOS_UNDEFINED`. This is
|
||||
* relative to the parent for windows with the "parent" property set.
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_Y_NUMBER`: the y position of the window, or
|
||||
* - `SDL_PROP_WINDOW_CREATE_Y_NUMBER`: the y position of the window, or
|
||||
* `SDL_WINDOWPOS_CENTERED`, defaults to `SDL_WINDOWPOS_UNDEFINED`. This is
|
||||
* relative to the parent for windows with the "parent" property set.
|
||||
*
|
||||
* These are additional supported properties on macOS:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_COCOA_WINDOW_POINTER`: the
|
||||
* - `SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER`: the
|
||||
* `(__unsafe_unretained)` NSWindow associated with the window, if you want
|
||||
* to wrap an existing window.
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_COCOA_VIEW_POINTER`: the
|
||||
* `(__unsafe_unretained)` NSView associated with the window, defaults to
|
||||
* `[window contentView]`
|
||||
* - `SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER`: the `(__unsafe_unretained)`
|
||||
* NSView associated with the window, defaults to `[window contentView]`
|
||||
*
|
||||
* These are additional supported properties on Wayland:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN` - true
|
||||
* if the application wants to use the Wayland surface for a custom role and
|
||||
* - `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
|
||||
* docs/README-wayland.md for more information on using custom surfaces.
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN - true if
|
||||
* the application wants an associated `wl_egl_window` object to be created,
|
||||
* - `SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN - true if the
|
||||
* application wants an associated `wl_egl_window` object to be created,
|
||||
* even if the window does not have the OpenGL property or flag set.
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER` - the wl_surface
|
||||
* - `SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER` - the wl_surface
|
||||
* associated with the window, if you want to wrap an existing window. See
|
||||
* docs/README-wayland.md for more information.
|
||||
*
|
||||
* These are additional supported properties on Windows:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_WIN32_HWND_POINTER`: the HWND associated with
|
||||
* the window, if you want to wrap an existing window.
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER`: optional,
|
||||
* - `SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER`: the HWND associated with the
|
||||
* window, if you want to wrap an existing window.
|
||||
* - `SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER`: optional,
|
||||
* another window to share pixel format with, useful for OpenGL windows
|
||||
*
|
||||
* These are additional supported properties with X11:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_CREATE_X11_WINDOW_NUMBER`: the X11 Window associated
|
||||
* - `SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER`: the X11 Window associated
|
||||
* with the window, if you want to wrap an existing window.
|
||||
*
|
||||
* The window is implicitly shown if the "hidden" property is not set.
|
||||
@ -918,42 +923,45 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, in
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_CreateProperties
|
||||
* \sa SDL_CreateWindow
|
||||
* \sa SDL_DestroyWindow
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props);
|
||||
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always-on-top"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_HEIGHT_NUMBER "height"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high-pixel-density"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_MENU_BOOLEAN "menu"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_METAL_BOOLEAN "metal"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse-grabbed"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_OPENGL_BOOLEAN "opengl"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_PARENT_POINTER "parent"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_TITLE_STRING "title"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_UTILITY_BOOLEAN "utility"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_WIDTH_NUMBER "width"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_X_NUMBER "x"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_Y_NUMBER "y"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_COCOA_WINDOW_POINTER "cocoa.window"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_COCOA_VIEW_POINTER "cocoa.view"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN "wayland.surface_role_custom"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN "wayland.create_egl_window"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER "wayland.wl_surface"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd"
|
||||
#define SDL_PROPERTY_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window"
|
||||
#define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top"
|
||||
#define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless"
|
||||
#define SDL_PROP_WINDOW_CREATE_FOCUSABLE_BOOLEAN "focusable"
|
||||
#define SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN "external_graphics_context"
|
||||
#define SDL_PROP_WINDOW_CREATE_FULLSCREEN_BOOLEAN "fullscreen"
|
||||
#define SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER "height"
|
||||
#define SDL_PROP_WINDOW_CREATE_HIDDEN_BOOLEAN "hidden"
|
||||
#define SDL_PROP_WINDOW_CREATE_HIGH_PIXEL_DENSITY_BOOLEAN "high_pixel_density"
|
||||
#define SDL_PROP_WINDOW_CREATE_MAXIMIZED_BOOLEAN "maximized"
|
||||
#define SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN "menu"
|
||||
#define SDL_PROP_WINDOW_CREATE_METAL_BOOLEAN "metal"
|
||||
#define SDL_PROP_WINDOW_CREATE_MINIMIZED_BOOLEAN "minimized"
|
||||
#define SDL_PROP_WINDOW_CREATE_MOUSE_GRABBED_BOOLEAN "mouse_grabbed"
|
||||
#define SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN "opengl"
|
||||
#define SDL_PROP_WINDOW_CREATE_PARENT_POINTER "parent"
|
||||
#define SDL_PROP_WINDOW_CREATE_RESIZABLE_BOOLEAN "resizable"
|
||||
#define SDL_PROP_WINDOW_CREATE_TITLE_STRING "title"
|
||||
#define SDL_PROP_WINDOW_CREATE_TRANSPARENT_BOOLEAN "transparent"
|
||||
#define SDL_PROP_WINDOW_CREATE_TOOLTIP_BOOLEAN "tooltip"
|
||||
#define SDL_PROP_WINDOW_CREATE_UTILITY_BOOLEAN "utility"
|
||||
#define SDL_PROP_WINDOW_CREATE_VULKAN_BOOLEAN "vulkan"
|
||||
#define SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER "width"
|
||||
#define SDL_PROP_WINDOW_CREATE_X_NUMBER "x"
|
||||
#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"
|
||||
#define SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER "win32.hwnd"
|
||||
#define SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER "win32.pixel_format_hwnd"
|
||||
#define SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER "x11.window"
|
||||
|
||||
/**
|
||||
* Get the numeric ID of a window.
|
||||
@ -1005,58 +1013,59 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
||||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_WINDOW_SHAPE_POINTER`: the surface associated with a shaped
|
||||
* window
|
||||
*
|
||||
* On Android:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_ANDROID_WINDOW_POINTER`: the ANativeWindow
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_ANDROID_SURFACE_POINTER`: the EGLSurface associated
|
||||
* - `SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER`: the ANativeWindow associated
|
||||
* with the window
|
||||
* - `SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER`: the EGLSurface associated with
|
||||
* the window
|
||||
*
|
||||
* On iOS:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_UIKIT_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
||||
* - `SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
||||
* UIWindow associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
||||
* - `SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
||||
* assocated with metal views on the window
|
||||
*
|
||||
* On KMS/DRM:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER`: the device index
|
||||
* associated with the window (e.g. the X in /dev/dri/cardX)
|
||||
* - `SDL_PROPERTY_WINDOW_KMSDRM_DRM_FD_NUMBER`: the DRM FD associated with
|
||||
* the window
|
||||
* - `SDL_PROPERTY_WINDOW_KMSDRM_GBM_DEVICE_POINTER`: the GBM device
|
||||
* associated with the window
|
||||
* - `SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER`: the device index associated
|
||||
* with the window (e.g. the X in /dev/dri/cardX)
|
||||
* - `SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER`: the DRM FD associated with the
|
||||
* window
|
||||
* - `SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER`: the GBM device associated
|
||||
* with the window
|
||||
*
|
||||
* On macOS:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_COCOA_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
||||
* - `SDL_PROP_WINDOW_COCOA_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
||||
* NSWindow associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
||||
* - `SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
||||
* assocated with metal views on the window
|
||||
*
|
||||
* On Vivante:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_VIVANTE_DISPLAY_POINTER`: the EGLNativeDisplayType
|
||||
* - `SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER`: the EGLNativeDisplayType
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_VIVANTE_WINDOW_POINTER`: the EGLNativeWindowType
|
||||
* - `SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER`: the EGLNativeWindowType
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_VIVANTE_SURFACE_POINTER`: the EGLSurface associated
|
||||
* with the window
|
||||
* - `SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER`: the EGLSurface associated with
|
||||
* the window
|
||||
*
|
||||
* On UWP:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_WINRT_WINDOW_POINTER`: the IInspectable CoreWindow
|
||||
* - `SDL_PROP_WINDOW_WINRT_WINDOW_POINTER`: the IInspectable CoreWindow
|
||||
* associated with the window
|
||||
*
|
||||
* On Windows:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_WIN32_HWND_POINTER`: the HWND associated with the
|
||||
* window
|
||||
* - `SDL_PROPERTY_WINDOW_WIN32_HDC_POINTER`: the HDC associated with the
|
||||
* window
|
||||
* - `SDL_PROPERTY_WINDOW_WIN32_INSTANCE_POINTER`: the HINSTANCE associated
|
||||
* with the window
|
||||
* - `SDL_PROP_WINDOW_WIN32_HWND_POINTER`: the HWND associated with the window
|
||||
* - `SDL_PROP_WINDOW_WIN32_HDC_POINTER`: the HDC associated with the window
|
||||
* - `SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER`: the HINSTANCE associated with
|
||||
* the window
|
||||
*
|
||||
* On Wayland:
|
||||
*
|
||||
@ -1064,29 +1073,31 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
||||
* show/hide calls. They will be null if the window is hidden and must be
|
||||
* queried each time it is shown.
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_DISPLAY_POINTER`: the wl_display associated
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER`: the wl_display associated with
|
||||
* the window
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER`: the wl_surface associated with
|
||||
* the window
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER`: the wl_egl_window
|
||||
* associated with the window
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER`: the xdg_surface associated
|
||||
* with the window
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_SURFACE_POINTER`: the wl_surface associated
|
||||
* with the window
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_EGL_WINDOW_POINTER`: the wl_egl_window
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER`: the xdg_toplevel role
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_XDG_SURFACE_POINTER`: the xdg_surface
|
||||
* - 'SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING': the export
|
||||
* handle associated with the window
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER`: the xdg_popup role
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER`: the xdg_toplevel role
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_XDG_POPUP_POINTER`: the xdg_popup role
|
||||
* associated with the window
|
||||
* - `SDL_PROPERTY_WINDOW_WAYLAND_XDG_POSITIONER_POINTER`: the xdg_positioner
|
||||
* - `SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER`: the xdg_positioner
|
||||
* associated with the window, in popup mode
|
||||
*
|
||||
* On X11:
|
||||
*
|
||||
* - `SDL_PROPERTY_WINDOW_X11_DISPLAY_POINTER`: the X11 Display associated
|
||||
* with the window
|
||||
* - `SDL_PROPERTY_WINDOW_X11_SCREEN_NUMBER`: the screen number associated
|
||||
* with the window
|
||||
* - `SDL_PROPERTY_WINDOW_X11_WINDOW_NUMBER`: the X11 Window associated with
|
||||
* - `SDL_PROP_WINDOW_X11_DISPLAY_POINTER`: the X11 Display associated with
|
||||
* the window
|
||||
* - `SDL_PROP_WINDOW_X11_SCREEN_NUMBER`: the screen number associated with
|
||||
* the window
|
||||
* - `SDL_PROP_WINDOW_X11_WINDOW_NUMBER`: the X11 Window associated with the
|
||||
* window
|
||||
*
|
||||
* \param window the window to query
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
@ -1099,32 +1110,34 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
||||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *window);
|
||||
|
||||
#define SDL_PROPERTY_WINDOW_ANDROID_WINDOW_POINTER "SDL.window.android.window"
|
||||
#define SDL_PROPERTY_WINDOW_ANDROID_SURFACE_POINTER "SDL.window.android.surface"
|
||||
#define SDL_PROPERTY_WINDOW_UIKIT_WINDOW_POINTER "SDL.window.uikit.window"
|
||||
#define SDL_PROPERTY_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER "SDL.window.uikit.metal_view_tag"
|
||||
#define SDL_PROPERTY_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER "SDL.window.kmsdrm.dev_index"
|
||||
#define SDL_PROPERTY_WINDOW_KMSDRM_DRM_FD_NUMBER "SDL.window.kmsdrm.drm_fd"
|
||||
#define SDL_PROPERTY_WINDOW_KMSDRM_GBM_DEVICE_POINTER "SDL.window.kmsdrm.gbm_dev"
|
||||
#define SDL_PROPERTY_WINDOW_COCOA_WINDOW_POINTER "SDL.window.cocoa.window"
|
||||
#define SDL_PROPERTY_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER "SDL.window.cocoa.metal_view_tag"
|
||||
#define SDL_PROPERTY_WINDOW_VIVANTE_DISPLAY_POINTER "SDL.window.vivante.display"
|
||||
#define SDL_PROPERTY_WINDOW_VIVANTE_WINDOW_POINTER "SDL.window.vivante.window"
|
||||
#define SDL_PROPERTY_WINDOW_VIVANTE_SURFACE_POINTER "SDL.window.vivante.surface"
|
||||
#define SDL_PROPERTY_WINDOW_WINRT_WINDOW_POINTER "SDL.window.winrt.window"
|
||||
#define SDL_PROPERTY_WINDOW_WIN32_HWND_POINTER "SDL.window.win32.hwnd"
|
||||
#define SDL_PROPERTY_WINDOW_WIN32_HDC_POINTER "SDL.window.win32.hdc"
|
||||
#define SDL_PROPERTY_WINDOW_WIN32_INSTANCE_POINTER "SDL.window.win32.instance"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_DISPLAY_POINTER "SDL.window.wayland.display"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_SURFACE_POINTER "SDL.window.wayland.surface"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_EGL_WINDOW_POINTER "SDL.window.wayland.egl_window"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_XDG_SURFACE_POINTER "SDL.window.wayland.xdg_surface"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER "SDL.window.wayland.xdg_toplevel"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_XDG_POPUP_POINTER "SDL.window.wayland.xdg_popup"
|
||||
#define SDL_PROPERTY_WINDOW_WAYLAND_XDG_POSITIONER_POINTER "SDL.window.wayland.xdg_positioner"
|
||||
#define SDL_PROPERTY_WINDOW_X11_DISPLAY_POINTER "SDL.window.x11.display"
|
||||
#define SDL_PROPERTY_WINDOW_X11_SCREEN_NUMBER "SDL.window.x11.screen"
|
||||
#define SDL_PROPERTY_WINDOW_X11_WINDOW_NUMBER "SDL.window.x11.window"
|
||||
#define SDL_PROP_WINDOW_SHAPE_POINTER "SDL.window.shape"
|
||||
#define SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER "SDL.window.android.window"
|
||||
#define SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER "SDL.window.android.surface"
|
||||
#define SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER "SDL.window.uikit.window"
|
||||
#define SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER "SDL.window.uikit.metal_view_tag"
|
||||
#define SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER "SDL.window.kmsdrm.dev_index"
|
||||
#define SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER "SDL.window.kmsdrm.drm_fd"
|
||||
#define SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER "SDL.window.kmsdrm.gbm_dev"
|
||||
#define SDL_PROP_WINDOW_COCOA_WINDOW_POINTER "SDL.window.cocoa.window"
|
||||
#define SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER "SDL.window.cocoa.metal_view_tag"
|
||||
#define SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER "SDL.window.vivante.display"
|
||||
#define SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER "SDL.window.vivante.window"
|
||||
#define SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER "SDL.window.vivante.surface"
|
||||
#define SDL_PROP_WINDOW_WINRT_WINDOW_POINTER "SDL.window.winrt.window"
|
||||
#define SDL_PROP_WINDOW_WIN32_HWND_POINTER "SDL.window.win32.hwnd"
|
||||
#define SDL_PROP_WINDOW_WIN32_HDC_POINTER "SDL.window.win32.hdc"
|
||||
#define SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER "SDL.window.win32.instance"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER "SDL.window.wayland.display"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER "SDL.window.wayland.surface"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER "SDL.window.wayland.egl_window"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER "SDL.window.wayland.xdg_surface"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER "SDL.window.wayland.xdg_toplevel"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING "SDL.window.wayland.xdg_toplevel_export_handle"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER "SDL.window.wayland.xdg_popup"
|
||||
#define SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER "SDL.window.wayland.xdg_positioner"
|
||||
#define SDL_PROP_WINDOW_X11_DISPLAY_POINTER "SDL.window.x11.display"
|
||||
#define SDL_PROP_WINDOW_X11_SCREEN_NUMBER "SDL.window.x11.screen"
|
||||
#define SDL_PROP_WINDOW_X11_WINDOW_NUMBER "SDL.window.x11.window"
|
||||
|
||||
/**
|
||||
* Get the window flags.
|
||||
@ -1139,10 +1152,10 @@ extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *win
|
||||
* \sa SDL_MaximizeWindow
|
||||
* \sa SDL_MinimizeWindow
|
||||
* \sa SDL_SetWindowFullscreen
|
||||
* \sa SDL_SetWindowGrab
|
||||
* \sa SDL_SetWindowMouseGrab
|
||||
* \sa SDL_ShowWindow
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window *window);
|
||||
extern DECLSPEC SDL_WindowFlags SDLCALL SDL_GetWindowFlags(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set the title of a window.
|
||||
@ -1608,8 +1621,9 @@ extern DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
|
||||
/**
|
||||
* Request that the window's fullscreen state be changed.
|
||||
*
|
||||
* By default a window in fullscreen state uses fullscreen desktop mode, but a
|
||||
* specific display mode can be set using SDL_SetWindowFullscreenMode().
|
||||
* By default a window in fullscreen state uses borderless fullscreen desktop
|
||||
* mode, but a specific exclusive display mode can be set using
|
||||
* SDL_SetWindowFullscreenMode().
|
||||
*
|
||||
* On some windowing systems this request is asynchronous and the new
|
||||
* fullscreen state may not have have been applied immediately upon the return
|
||||
@ -1673,7 +1687,7 @@ extern DECLSPEC int SDLCALL SDL_SyncWindow(SDL_Window *window);
|
||||
*
|
||||
* \sa SDL_GetWindowSurface
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasWindowSurface(SDL_Window *window);
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_WindowHasSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get the SDL surface associated with the window.
|
||||
@ -1696,7 +1710,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasWindowSurface(SDL_Window *window);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_DestroyWindowSurface
|
||||
* \sa SDL_HasWindowSurface
|
||||
* \sa SDL_WindowHasSurface
|
||||
* \sa SDL_UpdateWindowSurface
|
||||
* \sa SDL_UpdateWindowSurfaceRects
|
||||
*/
|
||||
@ -1758,32 +1772,10 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, con
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetWindowSurface
|
||||
* \sa SDL_HasWindowSurface
|
||||
* \sa SDL_WindowHasSurface
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Set a window's input grab mode.
|
||||
*
|
||||
* When input is grabbed, the mouse is confined to the window. This function
|
||||
* will also grab the keyboard if `SDL_HINT_GRAB_KEYBOARD` is set. To grab the
|
||||
* keyboard without also grabbing the mouse, use SDL_SetWindowKeyboardGrab().
|
||||
*
|
||||
* If the caller enables a grab while another window is currently grabbed, the
|
||||
* other window loses its grab in favor of the caller's window.
|
||||
*
|
||||
* \param window the window for which the input grab mode should be set
|
||||
* \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_GetGrabbedWindow
|
||||
* \sa SDL_GetWindowGrab
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
|
||||
/**
|
||||
* Set a window's keyboard grab mode.
|
||||
*
|
||||
@ -1812,7 +1804,6 @@ extern DECLSPEC int SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabb
|
||||
*
|
||||
* \sa SDL_GetWindowKeyboardGrab
|
||||
* \sa SDL_SetWindowMouseGrab
|
||||
* \sa SDL_SetWindowGrab
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
|
||||
@ -1830,22 +1821,9 @@ extern DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bo
|
||||
*
|
||||
* \sa SDL_GetWindowMouseGrab
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
* \sa SDL_SetWindowGrab
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);
|
||||
|
||||
/**
|
||||
* Get a window's input grab mode.
|
||||
*
|
||||
* \param window the window to query
|
||||
* \returns SDL_TRUE if input is grabbed, SDL_FALSE otherwise.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetWindowGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Get a window's keyboard grab mode.
|
||||
*
|
||||
@ -1855,7 +1833,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window *window);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
* \sa SDL_GetWindowGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window);
|
||||
|
||||
@ -1868,7 +1845,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window *window);
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
* \sa SDL_GetWindowGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window);
|
||||
|
||||
@ -1879,8 +1855,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetWindowGrab
|
||||
* \sa SDL_SetWindowGrab
|
||||
* \sa SDL_SetWindowMouseGrab
|
||||
* \sa SDL_SetWindowKeyboardGrab
|
||||
*/
|
||||
extern DECLSPEC SDL_Window *SDLCALL SDL_GetGrabbedWindow(void);
|
||||
|
||||
@ -2097,6 +2073,30 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data);
|
||||
|
||||
/**
|
||||
* Set the shape of a transparent window.
|
||||
*
|
||||
* This sets the alpha channel of a transparent window and any fully
|
||||
* transparent areas are also transparent to mouse clicks. If you are using
|
||||
* something besides the SDL render API, then you are responsible for setting
|
||||
* the alpha channel of the window yourself.
|
||||
*
|
||||
* The shape is copied inside this function, so you can free it afterwards. If
|
||||
* your shape surface changes, you should call SDL_SetWindowShape() again to
|
||||
* update the window.
|
||||
*
|
||||
* The window must have been created with the SDL_WINDOW_TRANSPARENT flag.
|
||||
*
|
||||
* \param window the window
|
||||
* \param shape the surface representing the shape of the window, or NULL to
|
||||
* remove any current shape
|
||||
* \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_SetWindowShape(SDL_Window *window, SDL_Surface *shape);
|
||||
|
||||
/**
|
||||
* Request a window to demand attention from the user.
|
||||
*
|
||||
@ -2112,6 +2112,9 @@ extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperati
|
||||
/**
|
||||
* Destroy a window.
|
||||
*
|
||||
* If the window has an associated SDL_Renderer, it will be implicitly
|
||||
* destroyed as well.
|
||||
*
|
||||
* If `window` is NULL, this function will return immediately after setting
|
||||
* the SDL error message to "Invalid window". See SDL_GetError().
|
||||
*
|
||||
|
@ -1,377 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_video_capture.h
|
||||
*
|
||||
* Video Capture for the SDL library.
|
||||
*/
|
||||
|
||||
#ifndef SDL_video_capture_h_
|
||||
#define SDL_video_capture_h_
|
||||
|
||||
#include "SDL3/SDL_video.h"
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is a unique ID for a video capture device for the time it is connected to the system,
|
||||
* and is never reused for the lifetime of the application. If the device is
|
||||
* disconnected and reconnected, it will get a new ID.
|
||||
*
|
||||
* The ID value starts at 1 and increments from there. The value 0 is an invalid ID.
|
||||
*
|
||||
* \sa SDL_GetVideoCaptureDevices
|
||||
*/
|
||||
typedef Uint32 SDL_VideoCaptureDeviceID;
|
||||
|
||||
|
||||
/**
|
||||
* The structure used to identify an SDL video capture device
|
||||
*/
|
||||
struct SDL_VideoCaptureDevice;
|
||||
typedef struct SDL_VideoCaptureDevice SDL_VideoCaptureDevice;
|
||||
|
||||
#define SDL_VIDEO_CAPTURE_ALLOW_ANY_CHANGE 1
|
||||
|
||||
/**
|
||||
* SDL_VideoCaptureSpec structure
|
||||
*
|
||||
* Only those field can be 'desired' when configuring the device:
|
||||
* - format
|
||||
* - width
|
||||
* - height
|
||||
*
|
||||
* \sa SDL_GetVideoCaptureFormat
|
||||
* \sa SDL_GetVideoCaptureFrameSize
|
||||
*
|
||||
*/
|
||||
typedef struct SDL_VideoCaptureSpec
|
||||
{
|
||||
Uint32 format; /**< Frame SDL_PixelFormatEnum format */
|
||||
int width; /**< Frame width */
|
||||
int height; /**< Frame height */
|
||||
} SDL_VideoCaptureSpec;
|
||||
|
||||
/**
|
||||
* SDL Video Capture Status
|
||||
*
|
||||
* Change states but calling the function in this order:
|
||||
*
|
||||
* SDL_OpenVideoCapture()
|
||||
* SDL_SetVideoCaptureSpec() -> Init
|
||||
* SDL_StartVideoCapture() -> Playing
|
||||
* SDL_StopVideoCapture() -> Stopped
|
||||
* SDL_CloseVideoCapture()
|
||||
*
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_VIDEO_CAPTURE_FAIL = -1, /**< Failed */
|
||||
SDL_VIDEO_CAPTURE_INIT = 0, /**< Init, spec hasn't been set */
|
||||
SDL_VIDEO_CAPTURE_STOPPED, /**< Stopped */
|
||||
SDL_VIDEO_CAPTURE_PLAYING /**< Playing */
|
||||
} SDL_VideoCaptureStatus;
|
||||
|
||||
/**
|
||||
* SDL Video Capture Status
|
||||
*/
|
||||
typedef struct SDL_VideoCaptureFrame
|
||||
{
|
||||
Uint64 timestampNS; /**< Frame timestamp in nanoseconds when read from the driver */
|
||||
int num_planes; /**< Number of planes */
|
||||
Uint8 *data[3]; /**< Pointer to data of i-th plane */
|
||||
int pitch[3]; /**< Pitch of i-th plane */
|
||||
void *internal; /**< Private field */
|
||||
} SDL_VideoCaptureFrame;
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of currently connected video capture devices.
|
||||
*
|
||||
* \param count a pointer filled in with the number of video capture devices
|
||||
* \returns a 0 terminated array of video capture instance IDs which should be
|
||||
* freed with SDL_free(), or NULL on error; call SDL_GetError() for
|
||||
* more details.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenVideoCapture
|
||||
*/
|
||||
extern DECLSPEC SDL_VideoCaptureDeviceID *SDLCALL SDL_GetVideoCaptureDevices(int *count);
|
||||
|
||||
/**
|
||||
* Open a Video Capture device
|
||||
*
|
||||
* \param instance_id the video capture device instance ID
|
||||
* \returns device, or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetVideoCaptureDeviceName
|
||||
* \sa SDL_GetVideoCaptureDevices
|
||||
* \sa SDL_OpenVideoCaptureWithSpec
|
||||
*/
|
||||
extern DECLSPEC SDL_VideoCaptureDevice *SDLCALL SDL_OpenVideoCapture(SDL_VideoCaptureDeviceID instance_id);
|
||||
|
||||
/**
|
||||
* Set specification
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param desired desired video capture spec
|
||||
* \param obtained obtained video capture spec
|
||||
* \param allowed_changes allow changes or not
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_OpenVideoCapture
|
||||
* \sa SDL_OpenVideoCaptureWithSpec
|
||||
* \sa SDL_GetVideoCaptureSpec
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetVideoCaptureSpec(SDL_VideoCaptureDevice *device,
|
||||
const SDL_VideoCaptureSpec *desired,
|
||||
SDL_VideoCaptureSpec *obtained,
|
||||
int allowed_changes);
|
||||
|
||||
/**
|
||||
* Open a Video Capture device and set specification
|
||||
*
|
||||
* \param instance_id the video capture device instance ID
|
||||
* \param desired desired video capture spec
|
||||
* \param obtained obtained video capture spec
|
||||
* \param allowed_changes allow changes or not
|
||||
* \returns device, or NULL on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenVideoCapture
|
||||
* \sa SDL_SetVideoCaptureSpec
|
||||
* \sa SDL_GetVideoCaptureSpec
|
||||
*/
|
||||
extern DECLSPEC SDL_VideoCaptureDevice *SDLCALL SDL_OpenVideoCaptureWithSpec(SDL_VideoCaptureDeviceID instance_id,
|
||||
const SDL_VideoCaptureSpec *desired,
|
||||
SDL_VideoCaptureSpec *obtained,
|
||||
int allowed_changes);
|
||||
|
||||
/**
|
||||
* Get device name
|
||||
*
|
||||
* \param instance_id the video capture device instance ID
|
||||
* \returns device name, shouldn't be freed
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetVideoCaptureDevices
|
||||
*/
|
||||
extern DECLSPEC const char * SDLCALL SDL_GetVideoCaptureDeviceName(SDL_VideoCaptureDeviceID instance_id);
|
||||
|
||||
/**
|
||||
* Get the obtained video capture spec
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param spec The SDL_VideoCaptureSpec to be initialized by this function.
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_SetVideoCaptureSpec
|
||||
* \sa SDL_OpenVideoCaptureWithSpec
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetVideoCaptureSpec(SDL_VideoCaptureDevice *device, SDL_VideoCaptureSpec *spec);
|
||||
|
||||
|
||||
/**
|
||||
* Get frame format of video capture device.
|
||||
*
|
||||
* The value can be used to fill SDL_VideoCaptureSpec structure.
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param index format between 0 and num -1
|
||||
* \param format pointer output format (SDL_PixelFormatEnum)
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_GetNumVideoCaptureFormats
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetVideoCaptureFormat(SDL_VideoCaptureDevice *device,
|
||||
int index,
|
||||
Uint32 *format);
|
||||
|
||||
/**
|
||||
* Number of available formats for the device
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \returns number of formats or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetVideoCaptureFormat
|
||||
* \sa SDL_SetVideoCaptureSpec
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumVideoCaptureFormats(SDL_VideoCaptureDevice *device);
|
||||
|
||||
/**
|
||||
* Get frame sizes of the device and the specified input format.
|
||||
*
|
||||
* The value can be used to fill SDL_VideoCaptureSpec structure.
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param format a format that can be used by the device (SDL_PixelFormatEnum)
|
||||
* \param index framesize between 0 and num -1
|
||||
* \param width output width
|
||||
* \param height output height
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_GetNumVideoCaptureFrameSizes
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetVideoCaptureFrameSize(SDL_VideoCaptureDevice *device, Uint32 format, int index, int *width, int *height);
|
||||
|
||||
/**
|
||||
* Number of different framesizes available for the device and pixel format.
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param format frame pixel format (SDL_PixelFormatEnum)
|
||||
* \returns number of framesizes or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_GetVideoCaptureFrameSize
|
||||
* \sa SDL_SetVideoCaptureSpec
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumVideoCaptureFrameSizes(SDL_VideoCaptureDevice *device, Uint32 format);
|
||||
|
||||
|
||||
/**
|
||||
* Get video capture status
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_VideoCaptureStatus
|
||||
*/
|
||||
extern DECLSPEC SDL_VideoCaptureStatus SDLCALL SDL_GetVideoCaptureStatus(SDL_VideoCaptureDevice *device);
|
||||
|
||||
/**
|
||||
* Start video capture
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_StopVideoCapture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_StartVideoCapture(SDL_VideoCaptureDevice *device);
|
||||
|
||||
/**
|
||||
* Acquire a frame.
|
||||
*
|
||||
* The frame is a memory pointer to the image data, whose size and format are
|
||||
* given by the the obtained spec.
|
||||
*
|
||||
* Non blocking API. If there is a frame available, frame->num_planes is non
|
||||
* 0. If frame->num_planes is 0 and returned code is 0, there is no frame at
|
||||
* that time.
|
||||
*
|
||||
* After used, the frame should be released with SDL_ReleaseVideoCaptureFrame
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param frame pointer to get the frame
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_ReleaseVideoCaptureFrame
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_AcquireVideoCaptureFrame(SDL_VideoCaptureDevice *device, SDL_VideoCaptureFrame *frame);
|
||||
|
||||
/**
|
||||
* Release a frame.
|
||||
*
|
||||
* Let the back-end re-use the internal buffer for video capture.
|
||||
*
|
||||
* All acquired frames should be released before closing the device.
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \param frame frame pointer.
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_AcquireVideoCaptureFrame
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReleaseVideoCaptureFrame(SDL_VideoCaptureDevice *device, SDL_VideoCaptureFrame *frame);
|
||||
|
||||
/**
|
||||
* Stop Video Capture
|
||||
*
|
||||
* \param device opened video capture device
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_StartVideoCapture
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_StopVideoCapture(SDL_VideoCaptureDevice *device);
|
||||
|
||||
/**
|
||||
* Use this function to shut down video_capture processing and close the
|
||||
* video_capture device.
|
||||
*
|
||||
* \param device opened video capture device
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_OpenVideoCaptureWithSpec
|
||||
* \sa SDL_OpenVideoCapture
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CloseVideoCapture(SDL_VideoCaptureDevice *device);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif /* SDL_video_capture_h_ */
|
@ -141,7 +141,7 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
||||
* This should be called after either calling SDL_Vulkan_LoadLibrary() or
|
||||
* creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag.
|
||||
*
|
||||
* On return, the variable pointed to by `pCount` will be set to the number of
|
||||
* On return, the variable pointed to by `count` will be set to the number of
|
||||
* elements returned, suitable for using with
|
||||
* VkInstanceCreateInfo::enabledExtensionCount, and the returned array can be
|
||||
* used with VkInstanceCreateInfo::ppEnabledExtensionNames, for calling
|
||||
@ -149,15 +149,14 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
|
||||
*
|
||||
* You should not free the returned array; it is owned by SDL.
|
||||
*
|
||||
* \param pCount A pointer to Uint32 that will be filled with the number of
|
||||
* extensions returned.
|
||||
* \param count a pointer filled in with the number of extensions returned.
|
||||
* \returns An array of extension name strings on success, NULL on error.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*
|
||||
* \sa SDL_Vulkan_CreateSurface
|
||||
*/
|
||||
extern DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint32 *pCount);
|
||||
extern DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint32 *count);
|
||||
|
||||
/**
|
||||
* Create a Vulkan rendering surface for a window.
|
||||
|
Reference in New Issue
Block a user