Compare commits

..

332 Commits

Author SHA1 Message Date
Dan Balasescu 3767eb2ab9
Merge pull request #266 from Susko3/fix-SDL_mixer-friendly-overloads
Fix SDL_mixer friendly overloads not generating
2025-12-13 13:28:34 +09:00
Dan Balasescu 4988d55819
Merge pull request #265 from Susko3/cleanup-error
Add tests for `SDL_error.cs` and ensure u8 constants are explicitly null-terminated
2025-12-13 13:26:29 +09:00
Susko3 3c21f68505 Hard-code string-returning functions in SDL_mixer 2025-12-13 03:11:02 +01:00
Susko3 2c185bf63b Fix SDL_mixer function prefix 2025-12-13 03:09:51 +01:00
Susko3 508573fe62 Add failing tests for SDL_mixer
They don't compile because of missing friendly overloads.
2025-12-13 03:09:01 +01:00
Susko3 2b556b39ce Ensure that format strings are null-terminated
u8 constants are implicitly null-terminated, but it's not really documented.
2025-12-13 02:29:00 +01:00
Susko3 40707381f6 Add tests for SDL_error.cs 2025-12-13 02:17:34 +01:00
Susko3 64a12c444b
Merge pull request #263 from MrLimeick/master
Adding missing values ​​to SDL_WindowFlags
2025-12-08 21:06:49 +01:00
MrLimeick 6e700651b2 Adding missing values ​​to SDL_WindowFlags 2025-12-08 18:57:20 +03:00
Dan Balasescu 32a04fb36a
Merge pull request #261 from ppy/update-native-binaries
Update native binaries
2025-12-05 22:06:42 +09:00
smoogipoo 227d48fe68 Update native binaries 2025-12-05 13:04:32 +00:00
Susko3 b20de5fa9c
Merge pull request #260 from hwsmm/update
Update SDL bindings
2025-12-05 13:47:03 +01:00
hwsmm ddf8f1f478 Update SDL bindings 2025-12-05 20:54:03 +09:00
Dan Balasescu 4022f0aa04
Merge pull request #259 from ppy/update-native-binaries
Update native binaries
2025-11-18 14:01:29 +09:00
smoogipoo 3cda196b20 Update native binaries 2025-11-18 03:08:55 +00:00
Dan Balasescu 3427250b38
Merge pull request #258 from Susko3/update-sdl
Update SDL bindings
2025-11-18 11:50:02 +09:00
Susko3 a27547bece Update SDL bindings 2025-11-17 18:23:31 +01:00
Susko3 c0765ca155
Merge pull request #257 from ppy/update-native-binaries
Update native binaries
2025-11-15 11:14:34 +01:00
smoogipoo 8838d6792e Update native binaries 2025-11-15 08:06:45 +00:00
Dan Balasescu 9d79ba7ade
Merge pull request #256 from Susko3/update-sdl
Update SDL bindings, with two input fixes and one feature
2025-11-15 16:54:56 +09:00
Susko3 95165b55ea Update SDL bindings 2025-11-15 01:05:22 +01:00
Dan Balasescu b71f522dfe
Merge pull request #254 from ppy/update-native-binaries
Update native binaries
2025-09-20 09:02:44 +09:00
smoogipoo 9601d75096 Update native binaries 2025-09-19 23:59:51 +00:00
Dan Balasescu 83d7db12b8
Merge pull request #253 from Susko3/fix-ANDROID_PLATFORM
Target API 21 in Android builds to fix them not working on older versions
2025-09-20 08:48:41 +09:00
Dan Balasescu dbbd262631
Merge pull request #252 from Susko3/fix-win-x86
Fix libflac build by using windows-2022 for x86
2025-09-20 08:44:02 +09:00
Susko3 d942aece9e Add explanatory comment about the android API 24 change to SDL_mixer 2025-09-19 16:32:52 +02:00
Susko3 240d008900 Only build SDL_mixer for API 24 2025-09-19 16:10:55 +02:00
Susko3 9f1c305ab2 Fix libflac build by using windows-2022 2025-09-19 15:56:49 +02:00
Susko3 fb36b24faf Target API 24 to fix 32-bit Android builds
32-bit (x86, arm) builds are failing because libFLAC and opusfile are using
fseeko, ftello, etc. which were added in API 24.
Why 64-bit builds are not failing is beyond me.
2025-09-19 15:37:46 +02:00
Susko3 5096d33d1b Always build SDL3 libs with Android 5.0 (API 21) min version 2025-09-19 14:40:08 +02:00
Dean Herbert 2fe9cb8ed5
Merge pull request #251 from smoogipoo/sdl-mixer-flac
Update bindings + re-enable libFLAC support in SDL_mixer
2025-09-11 13:50:00 +09:00
Dan Balasescu 4f817f6bce
Re-enable libFLAC 2025-09-11 09:32:47 +09:00
Dan Balasescu 2d7d0ddecc
Regenerate bindings 2025-09-11 09:13:38 +09:00
Dan Balasescu 565ba9fe41
Update submodules 2025-09-11 09:13:08 +09:00
Dan Balasescu fdd9cef146
Merge pull request #249 from Susko3/add-ci-build-workflow
Add CI build workflow
2025-08-31 08:02:59 +09:00
Susko3 95010b0846 Add envvar CI_DONT_TARGET_ANDROID=1 to fix CI build without android workload 2025-08-30 23:14:43 +02:00
Susko3 db3993e71b Fix build failing if SDL is not cloned 2025-08-30 23:14:43 +02:00
Susko3 c42876e0ee Add simple CI workflow that builds all platforms 2025-08-30 23:14:37 +02:00
Dan Balasescu 16c954ebc2
Merge pull request #248 from Susko3/fix-bindings
Fix bindings not compiling
2025-08-28 21:09:42 +09:00
Susko3 a4781c9b58 Fix bindings not compiling 2025-08-28 14:07:13 +02:00
Susko3 e2ead20a3d
Merge pull request #247 from ppy/update-native-binaries
Update native binaries
2025-08-28 14:04:50 +02:00
smoogipoo e7bbd4461d Update native binaries 2025-08-28 11:57:01 +00:00
Dan Balasescu ecd3c1d004
Merge pull request #246 from Susko3/update-bindings
Update bindings with fix for startup crash on Android
2025-08-28 20:43:21 +09:00
Susko3 b59358dbf5 Update bindings 2025-08-28 13:37:09 +02:00
Dan Balasescu ab2f57804c
Merge pull request #245 from smoogipoo/add-package-tags
Add package tags
2025-08-26 08:50:04 +09:00
Dan Balasescu 579cf8b380
Add package tags 2025-08-26 08:49:04 +09:00
Dan Balasescu d230747cd1
Merge pull request #244 from ppy/update-native-binaries
Update native binaries
2025-08-26 08:41:00 +09:00
smoogipoo e865ccc395 Update native binaries 2025-08-25 23:37:49 +00:00
Dan Balasescu 4f19a14331
Merge pull request #243 from smoogipoo/update-bindings
Update bindings
2025-08-26 08:25:50 +09:00
Dan Balasescu e8a54c5506
Attempt to fix iOS build
Similar sort of fix applied to all of our other repositories.
2025-08-26 08:14:01 +09:00
Dan Balasescu 742ac35cbc
Update bindings 2025-08-26 07:57:26 +09:00
Susko3 f57452fd77
Merge pull request #241 from smoogipoo/improve-builds
Improve local builds
2025-08-17 16:57:17 +02:00
Dan Balasescu 98a962deef
Merge pull request #240 from smoogipoo/upgrade-ndk
Upgrade NDK to r28c
2025-08-17 23:33:44 +09:00
Dan Balasescu 7078b56bcc
Improve lib resolving for desktop project 2025-08-17 19:58:28 +09:00
Dan Balasescu a9ec26bcbd
Add SDL3_mixer to Desktop .slnf 2025-08-17 19:28:52 +09:00
Dan Balasescu 6fc5f872ed
Fix runtime crash due to missing AOT module 2025-08-17 19:27:36 +09:00
Dan Balasescu 11604347e1
Add other libraries to iOS build 2025-08-17 19:19:56 +09:00
Dan Balasescu 12d3f7a37f
Add SDL3_mixer to iOS .slnf 2025-08-17 17:57:52 +09:00
Dan Balasescu 9165d3b077
Shortcase Android library includes 2025-08-17 17:56:33 +09:00
Dan Balasescu 76b0b15d97
Add SDL3_mixer to Android .slnf 2025-08-17 17:56:22 +09:00
Dan Balasescu dab8abd1da
Upgrade NDK to r28c 2025-08-17 16:41:48 +09:00
Dan Balasescu 8afca73432
Merge pull request #239 from ppy/update-native-binaries
Update native binaries
2025-08-16 15:01:06 +09:00
Susko3 7258fc2aaf Update native binaries 2025-08-15 19:58:20 +00:00
Susko3 2e68c991fc
Merge pull request #238 from smoogipoo/fix-build
Fix build by disabling mpg123 and libflac
2025-08-15 21:42:32 +02:00
Susko3 9a9cc1576e Fix missing info in comment 2025-08-15 21:37:16 +02:00
Dan Balasescu 01def28739
Fix build by disabling mpg123 and libflac 2025-08-14 02:43:33 +09:00
Dan Balasescu 5a16446ded
Regenerate bindings 2025-08-14 02:28:02 +09:00
Dan Balasescu 454e23e98f
Update submodules 2025-08-14 02:28:02 +09:00
Susko3 c483a94aea
Merge pull request #236 from smoogipoo/update-bindings
Update bindings
2025-08-03 12:10:43 +02:00
Susko3 523649fd77 Write SDL_MIXER_VERSION_ATLEAST macro 2025-08-03 12:09:27 +02:00
Dan Balasescu f51f432541
Fix prefix 2025-08-03 00:14:47 +09:00
Dan Balasescu 6d367145ed
Update bindings 2025-08-03 00:03:07 +09:00
Dan Balasescu 8a9ec08e66
Merge pull request #234 from ppy/update-native-binaries
Update native binaries
2025-07-03 13:58:38 +09:00
Dan Balasescu 68b514a2bb
Fix iOS package paths 2025-07-03 13:50:39 +09:00
smoogipoo d94b725f97 Update native binaries 2025-07-03 04:23:29 +00:00
Dan Balasescu 76dcb21019
Fill in iOS support in README 2025-07-03 13:10:16 +09:00
Dan Balasescu 2fdd152592
Package SDL3 extension libs for iOS 2025-07-03 13:08:50 +09:00
Dan Balasescu 73b855b9ba
Merge pull request #233 from jairov4/build_libs_ios
Build the libraries SDL_image, SDL_ttf, SDL_mixer for iOS in CI
2025-07-03 13:06:40 +09:00
Dan Balasescu 18df50890a
Fix line endings 2025-07-03 13:04:26 +09:00
Dan Balasescu 2a51be187b
Merge pull request #232 from hwsmm/build-refactor
Build Android satellite libraries and refactor build script
2025-07-03 13:00:03 +09:00
hwsmm bde92020d7
Add SDL3_mixer in Android test library list 2025-06-29 22:03:21 +09:00
MINI\jairo 91b98d57a1 Remove a line not needed 2025-06-29 08:00:59 -05:00
hwsmm 4813f8dc59 Add satellite libraries to test, and simply test availability 2025-06-29 19:51:18 +09:00
hwsmm 1f60742d1b Add Android target for satellite libraries and include Android native libraries 2025-06-29 19:49:48 +09:00
hwsmm 71611c90ab Refactor build script and build satellite libraries for Android 2025-06-29 19:48:22 +09:00
Dan Balasescu d920afefe2
Merge pull request #231 from ppy/update-native-binaries
Update native binaries
2025-06-29 15:06:01 +09:00
smoogipoo 91e05b56fe Update native binaries 2025-06-29 06:03:19 +00:00
Dan Balasescu d76c671a48
Add `SDL_mixer` to readme 2025-06-29 14:57:12 +09:00
Dan Balasescu 4ced795244
Merge pull request #229 from jairov4/feature/sdl_mixer
Introduce SDL_mixer build
2025-06-29 14:43:40 +09:00
jairov4 d12cbe2dec Update native binaries
Build other libs for iOS

Build other libs for iOS

Build other libs for iOS

Fix typo in build for iOS

Use recursive for iOS build

Enable back other jobs

Enable back other jobs

Revert "Update native binaries"

This reverts commit 1c4b14cced6ec2cfd185fdc9996feb6746afde59.
2025-06-28 23:05:19 -05:00
MINI\jairo c7b853e9ce Handle Mix_ methods 2025-06-28 22:37:36 -05:00
MINI\jairo c202ba42ea Add CS generated files for SDL_mixer 2025-06-28 08:12:51 -05:00
MINI\jairo bb74b2cf57 Fix 32-bit versions for ARM and x86 2025-06-26 20:10:16 -05:00
MINI\jairo 8c63fd801f Fix 32-bit versions for ARM and x86 2025-06-26 20:03:11 -05:00
MINI\jairo a02671332d Fix 32-bit versions for ARM and x86 2025-06-26 19:12:36 -05:00
MINI\jairo 33023e7db5 Fix 32-bit versions for ARM and x86 2025-06-26 19:07:55 -05:00
MINI\jairo d68ff4dcdf Fix 32-bit versions for ARM and x86 2025-06-26 18:39:40 -05:00
MINI\jairo 742dec521a Fix doubious ownership error 2025-06-26 18:14:24 -05:00
MINI\jairo 7d094dc1c0 Introduce SDL_mixer build 2025-06-26 18:00:19 -05:00
Dean Herbert cdf3dc8f51
Merge pull request #227 from smoogipoo/private-jetbrains-annotatinos
Mark `JetBrains.Annotations` as private package
2025-06-25 15:46:31 +09:00
Dan Balasescu beecade72f
Mark `JetBrains.Annotations` as private package 2025-06-25 12:40:26 +09:00
Dan Balasescu 5bf8143c4a
Merge pull request #226 from Susko3/let-sdl-version-generate
Let SDL*_VERSION constants autogenerate
2025-06-24 18:37:15 +09:00
Susko3 7ad887b2a6 Let SDL*_VERSION autogenerate 2025-06-24 11:25:18 +02:00
Dan Balasescu a984a31341
Merge pull request #225 from Susko3/fix-unsafe-sdl-ttf
Fix `Unsafe_` method generation in SDL_ttf
2025-06-24 18:16:17 +09:00
Susko3 88efab5deb Fix `Unsafe_` method generation in SDL_ttf 2025-06-24 11:00:53 +02:00
Dan Balasescu bfa753159c
Merge pull request #224 from ppy/update-native-binaries
Update native binaries
2025-06-24 17:29:15 +09:00
smoogipoo bba374d541 Update native binaries 2025-06-24 08:19:56 +00:00
Dan Balasescu 17a6a1b74c
Merge pull request #223 from Susko3/update-bindings
Update bindings of all SDL3 libraries
2025-06-24 17:13:07 +09:00
Dan Balasescu 424a42fcff
Merge pull request #221 from Susko3/add-missing-enum-macro
Add missing enum typedefs and macros
2025-06-24 17:10:55 +09:00
Dean Herbert dc1e1a10af
Merge pull request #222 from Susko3/fix-line-endings-in-g.cs
Fix checked out line endings in `*.g.cs` files
2025-06-24 16:58:03 +09:00
Susko3 1c1dbaa8cd Fix SDL_image tests not compiling 2025-06-23 23:13:18 +02:00
Susko3 9b834790d4 Update bindings of SDL3 libraries
This brings SDL_image and SDL_ttf up-to-date.
2025-06-23 23:07:46 +02:00
Susko3 f9345ed38a Fix checkout line endings in .g.cs files
ClangSharp will always generate files with LF, but the --headerFile is copied as-is.
This resulted in files with CR LF and LF line endings, confusing git which would always
report changes in line endings.

This is fixed by checking out *.g.cs and the license headers fed into ClangSharp with LF.

The files have always beeen normalised to LF endings on commit, so this change is not visible in git.
2025-06-23 22:41:40 +02:00
Susko3 d93df5517f Add missing macros for version checks 2025-06-23 22:15:01 +02:00
Susko3 0d8e49ef64 Add missing enum typedef in SDL_ttf 2025-06-23 22:15:01 +02:00
Susko3 b7ca494978 Fix underlying enum types 2025-06-23 22:15:01 +02:00
Dan Balasescu dddb17d34d
Merge pull request #217 from Susko3/rework-sdl-interface
Rework SDL_INIT_INTERFACE and add missing interfaces
2025-06-23 22:27:15 +09:00
Dan Balasescu 90ce8877df
Merge pull request #219 from Susko3/add-simple-image-ttf-tests
Add simple tests for SDL_image and SDL_ttf
2025-06-23 22:12:29 +09:00
Dan Balasescu 5d7ad9a1b8
Init SDL too 2025-06-23 22:10:36 +09:00
Susko3 28951012e3 Add simple tests for SDL_image and SDL_ttf 2025-06-22 14:30:20 +02:00
Susko3 bb247fa952 Rework SDL_INIT_INTERFACE and add missing interfaces 2025-06-22 01:39:15 +02:00
Dan Balasescu 9dd8657b8f
Merge pull request #216 from ppy/update-native-binaries
Update native binaries
2025-06-21 01:01:55 +09:00
smoogipoo 24c8b21804 Update native binaries 2025-06-20 15:54:55 +00:00
Dan Balasescu e7f0df7e8b
Merge pull request #215 from hwsmm/static-deps
Build SDL_image/ttf dependencies statically
2025-06-21 00:47:45 +09:00
Dean Herbert f632aa0fdd
Merge pull request #214 from smoogipoo/improve-readme
Add packages + platforms to README, general rewordings & improvements
2025-06-20 19:42:43 +09:00
hwsmm 7878370bab No longer packs dependencies of SDL_image 2025-06-20 18:45:56 +09:00
hwsmm 63e3724920 Remove unneeded binaries 2025-06-20 18:45:40 +09:00
hwsmm 3a3633b96d Fix typo 2025-06-20 18:21:10 +09:00
hwsmm 1d059287f5 Try building dependencies statically 2025-06-20 18:10:19 +09:00
Dan Balasescu 9c587389c2
Add condensed readme to package 2025-06-20 03:33:57 +09:00
Dan Balasescu efe88bd6c0
Remove package name from badges 2025-06-20 03:25:42 +09:00
Dan Balasescu 8172ba94e1
Add CLI usage string 2025-06-20 03:20:01 +09:00
Dan Balasescu 5e4097b1fe
Add packages + platforms to README, general improvements 2025-06-20 03:11:24 +09:00
Dan Balasescu 66fc81f489
Pack individual projects to remove workload requirement
Can't really install iOS workload on Linux, iirc.
2025-06-20 01:19:26 +09:00
Dan Balasescu 59a1369175
Merge pull request #211 from ppy/update-native-binaries
Update native binaries
2025-06-20 01:09:25 +09:00
smoogipoo c92afe97ac Update native binaries 2025-06-19 16:07:49 +00:00
Dan Balasescu ac2e352e81
Merge pull request #179 from WizzardMaker/feature/sdl-libs
Adds support for sdl_image and sdl_ttf (also other libs)
2025-06-20 01:01:30 +09:00
Dan Balasescu 225ae22e6b
Merge remote-tracking branch 'jairov4/feature/sdl-libs' into feature/sdl-libs 2025-06-20 00:46:52 +09:00
Dan Balasescu 32b5f88a5e
Adjust deploy script to build all packages 2025-06-20 00:45:54 +09:00
Dan Balasescu c563ecc3be
Mark test projects as non-packable 2025-06-20 00:38:43 +09:00
Dan Balasescu b0260c0d31
Exclude iOS/Android libs from package 2025-06-20 00:32:12 +09:00
MINI\jairo 63df878dec Fix build for macos intel 2025-06-19 09:30:43 -05:00
MINI\jairo 477bd7da13 Fix dubious ownership in repository when running in container 2025-06-19 08:27:07 -05:00
MINI\jairo 3471b34007 Fix dubious ownership in repository when running in container 2025-06-19 08:15:50 -05:00
MINI\jairo b8f0998d8c Fix path for CMAKE_PREFIX_PATH in different archs 2025-06-19 07:46:22 -05:00
MINI\jairo 06fdeb01b3 Fix path for CMAKE_PREFIX_PATH in different archs 2025-06-19 07:42:09 -05:00
MINI\jairo 5b535590d5 Fix path for CMAKE_PREFIX_PATH in different archs 2025-06-19 07:37:52 -05:00
MINI\jairo f5dcc15710 Fix path for CMAKE_PREFIX_PATH in different archs 2025-06-19 07:29:52 -05:00
MINI\jairo 49da8cf519 Fix path for copying DLLs of SDL3_ttf 2025-06-19 07:18:45 -05:00
MINI\jairo 318c2d8527 Fix path for copying DLLs of SDL3_ttf 2025-06-19 07:18:20 -05:00
MINI\jairo 1616f6056c Fix fetch submodule recursively for libtiff 2025-06-19 07:08:49 -05:00
Dan Balasescu e34ff3f25a
Merge pull request #210 from ppy/update-native-binaries
Update native binaries
2025-06-08 19:07:43 +09:00
smoogipoo 693fcf308b Update native binaries 2025-06-08 09:56:16 +00:00
Dan Balasescu bb19215b54
Merge pull request #209 from smoogipoo/update-bindings
Update bindings to 7dd5e765df239986f78c9b0016e3f3023d885084
2025-06-08 18:51:19 +09:00
Susko3 89fa65f30c Add comment about the chosen buffer size 2025-06-06 18:56:04 +02:00
Susko3 7f8ddcd477 Add SDL_GetEventDescription to tests 2025-06-06 18:53:31 +02:00
Susko3 53bedf11e3 Add new SDL_haptic typedefs and enums
While SDL_HapticEffectType has flag-like values, it's publicly not a [Flags] enum
as the possible values are exclusive.
See for example https://wiki.libsdl.org/SDL3/SDL_HapticPeriodic.
2025-06-06 18:47:40 +02:00
Susko3 29c7e9c126 Add SDL_GetEventDescription helper 2025-06-06 18:23:59 +02:00
Dan Balasescu 831d80fc10
Update bindings to 7dd5e765df239986f78c9b0016e3f3023d885084 2025-06-06 20:17:45 +09:00
Dan Balasescu 23a162db1e
Merge pull request #208 from SaxxonPike/Enumerable-SdlArrays
Allow `foreach` enumeration over `SDLArray`
2025-06-06 20:03:05 +09:00
Anthony Konzel 080b1e571e Allow `foreach` enumeration over SDLArray 2025-06-05 12:57:08 -05:00
Dan Balasescu c61b11ee5d
Merge pull request #207 from SaxxonPike/Utf8String-Allocations
Allocate string memory only once in Utf8String when input lacks null terminator
2025-06-05 13:38:25 +09:00
Susko3 e4a0124bfc Clean up code 2025-06-05 02:16:48 +02:00
Anthony Konzel e18e833799 Reduce the number of string allocations in Utf8String when input strings do not contain a null terminator 2025-06-04 16:40:37 -05:00
Dan Balasescu 7124e530e1
Merge branch 'master' into feature/sdl-libs 2025-05-20 15:20:06 +09:00
Bartłomiej Dach 7155c09e71
Merge pull request #203 from hwsmm/add-pw
Update dependencies for Ubuntu 22.04
2025-02-25 08:50:41 +01:00
hwsmm 0b4f2d1e85 Use distro libdecor instead 2025-02-20 21:53:36 +09:00
Bartłomiej Dach 4cc974e2bc
Merge pull request #202 from ppy/update-native-binaries
Update native binaries
2025-02-20 13:31:22 +01:00
hwsmm c4d3ee27e8 Add PipeWire dependency 2025-02-20 21:25:51 +09:00
bdach 507c28c23c Update native binaries 2025-02-20 12:25:31 +00:00
Bartłomiej Dach 40d5663603
Merge pull request #201 from hwsmm/update
Update bindings
2025-02-20 13:20:40 +01:00
hwsmm c747f1dcdd Update bindings 2025-02-20 20:49:58 +09:00
Bartłomiej Dach 6cbfbf8aad
Bump ubuntu images & runners to 22.04
While this may mean the binaries produced will no longer be compatible
with some unix installations with older glibc versions present,
GitHub are pulling support for the `ubuntu-20.04` runner on April 1,
so we don't really have much of a say in this matter.

The docker image tags could possibly stay for a while longer, but the
whole reason why GitHub are pulling the 20.04 runners is that the LTS
period for Ubuntu 20.04 *also* ends on April 1, so maybe best to just
get it out of the way all across the board.
2025-02-12 15:18:01 +01:00
Susko3 710d4787a6
Merge pull request #200 from ppy/update-native-binaries
Update native binaries
2025-01-25 18:06:08 +00:00
Susko3 490ffdcaa4 Update native binaries 2025-01-25 18:00:42 +00:00
Susko3 d5ae94981e
Merge pull request #199 from hwsmm/ubuntu-arm-ver
Use ARM runners and Ubuntu 20.04 ARM
2025-01-25 17:56:22 +00:00
hwsmm 5f4ba18c0d
Apply suggestion
Co-authored-by: Susko3 <Susko3@protonmail.com>
2025-01-26 02:50:00 +09:00
hwsmm 10972ff222 Try ARM runners 2025-01-26 02:33:08 +09:00
Susko3 96486c7a02
Merge pull request #198 from Susko3/fix-sdl_pen-constants
Fix SDL_Pen constants
2025-01-25 17:23:27 +00:00
Susko3 87b6598855 Fix SDL_Pen constants 2025-01-25 17:19:15 +00:00
hwsmm 4ac4588e18 Use Ubuntu 20.04 ARM and make apt noninteractive 2025-01-26 02:09:44 +09:00
Susko3 e1fb215d12
Merge pull request #197 from Susko3/update-bindings
Update SDL3 bindings for Windows Ink support
2025-01-25 15:47:19 +00:00
Susko3 e9be289b30 Add new enum members 2025-01-25 15:33:05 +00:00
Susko3 b00293457a Update SDL3 bindings for Windows Ink support 2025-01-25 15:00:58 +00:00
Dan Balasescu ab7c7f5a9c
Merge pull request #196 from Susko3/add-SDL_GetTrayEntries-helper
Implement helper for `SDL_GetTrayEntries()`
2025-01-05 17:24:19 +09:00
Susko3 f988cb2d0b Implement helper for SDL_GetTrayEntries()
The returned array should not be SDL_free'd as it's a `const` pointer.
2025-01-05 04:33:11 +00:00
Susko3 3681588414
Merge pull request #195 from ppy/update-native-binaries
Update native binaries
2025-01-03 20:12:36 +01:00
smoogipoo 31ee86e59e Update native binaries 2025-01-02 06:30:45 +00:00
Dan Balasescu 07db29ef06
Merge pull request #194 from hwsmm/fix-build
Fix Windows builds
2025-01-02 15:00:33 +09:00
hwsmm 2f7c96d5bd Ignore git reset error 2025-01-02 14:08:46 +09:00
hwsmm 23a3b77bcd Fix build.sh formatting 2025-01-02 13:46:35 +09:00
hwsmm 9daf986190 Don't suppress pushd/popd output to make output clear 2025-01-02 13:31:46 +09:00
hwsmm 3c24492891 Use sed instead of a patch 2025-01-02 13:23:25 +09:00
Susko3 c86db6c2fd Revert "Clearly signal that sudo is not available on windows"
Breaks linux-arm and linux-arm64 build for some reason.
This reverts commit d836630eab.
2025-01-02 00:05:23 +01:00
Susko3 d836630eab Clearly signal that sudo is not available on windows 2025-01-01 23:44:59 +01:00
hwsmm c3dee83d20 Make bash quit on a command error 2025-01-02 00:52:41 +09:00
hwsmm d2e30d2167 Patch SDL to not include gameinput.h 2025-01-02 00:51:58 +09:00
Dan Balasescu 20e10af7aa
Merge pull request #190 from Susko3/SDL_tray-tests
Add simple `SDL_tray` test
2025-01-01 21:02:38 +09:00
Dan Balasescu 365fe5c594
Merge pull request #189 from hwsmm/update
Update bindings
2025-01-01 20:59:49 +09:00
Susko3 4ee7f7e617 Mark interactive test with `[Explicit]` 2024-12-31 02:57:20 +01:00
Susko3 3a0f3844b7 Add simple SDL_tray test
Just to get a feel for the API and to see how it works/behaves across operating systems.
2024-12-31 02:56:57 +01:00
Susko3 e017626460 Add SDL_tray 2024-12-31 01:06:32 +01:00
hwsmm d393ea3354 Update bindings 2024-12-29 20:12:05 +09:00
Susko3 061ef9ebfb
Merge pull request #187 from smoogipoo/fix-dockerfile-android
Fix Dockerfile not working with multi-targeted project
2024-12-18 14:18:02 +01:00
Dan Balasescu 7137484799
Merge pull request #184 from Susko3/update-bindings
Update SDL bindings
2024-12-18 15:13:35 +09:00
Dan Balasescu 3d92f36990
Fix Dockerfile not working with multi-targeted project 2024-12-18 15:06:42 +09:00
Dan Balasescu 09cd92181a
Merge pull request #185 from Susko3/fix-SDL_GetWindows-managed-helper
Fix `SDL_GetWindows()` managed helper
2024-12-18 12:35:34 +09:00
Dan Balasescu b89c25b60e
Merge pull request #186 from Susko3/publish-jetbrains-annotations
Publish JetBrains annotations
2024-12-18 12:17:08 +09:00
Susko3 8932ea3b6c Publish JetBrains annotations
Mandatory for making `[MustDisposeResource]` useful
2024-12-17 17:26:18 +01:00
Susko3 be946eb23c Add `SDLOpaquePointerArray` and use it for SDL_GetWindows()
`SDLPointerArray` is inadequate as it does `*(SDL_Window*)ptr` which doesn't make sense
as SDL_Window* is an opaque pointer type
2024-12-17 17:20:45 +01:00
Susko3 d5287637ef Add a simple usage test for SDL_GetWindows() 2024-12-17 17:20:39 +01:00
Susko3 d86ca88246 Update SDL bindings 2024-12-17 15:49:42 +01:00
Dean Herbert 5a7b49ca74
Merge pull request #182 from frenzibyte/ios-codesign
Specify default codesign key for iOS test project
2024-12-10 05:45:16 -08:00
Salman Alshamrani aac627922e Specify default codesign key for iOS test project 2024-12-10 04:25:48 -05:00
Dan Balasescu b3dec6b80c
Refactor source generator a bit 2024-12-09 10:51:26 +09:00
Dan Balasescu 53a87f4a74
Fix SDL3-CS iOS native include 2024-12-09 10:42:27 +09:00
Dan Balasescu 491a9bceae
Adjust SDL3-CS references 2024-12-09 10:38:11 +09:00
Dan Balasescu 8e928a4f2e
Fix filtered solutions 2024-12-09 10:31:25 +09:00
Susko3 882a88219e
Merge pull request #181 from smoogipoo/merge-android
Merge Android into the main project + NuGet package
2024-12-04 18:20:11 +00:00
Dan Balasescu 2cc61ee837
Remove IDEA workspaces 2024-12-04 14:56:41 +09:00
Dan Balasescu be06fff363
Update GHA workflows 2024-12-04 14:56:41 +09:00
Dan Balasescu cc37b8245b
Merge SDL3-CS.Android into main project 2024-12-04 14:14:07 +09:00
WizzardMaker 06fabcf8b0 added enums to ttf and image 2024-12-03 15:44:40 +01:00
WizzardMaker 957e29d137 updated SDL build script to build ttf and image 2024-12-03 15:44:40 +01:00
WizzardMaker 52c2c1b31e split up sdl libraries into separate projects 2024-12-03 15:44:40 +01:00
WizzardMaker af476b4cc4 added sister projects to visible internals in SDL3-CS 2024-12-03 15:44:40 +01:00
WizzardMaker 1e78619716 updated c# source generator to also take other SDL methods into account 2024-12-03 15:44:40 +01:00
WizzardMaker 5b0abdca7c added sdl_image and sdl_ttf 2024-12-03 15:44:40 +01:00
Susko3 7803512144
Merge pull request #180 from smoogipoo/add-docker-readme
Document binding generation in README
2024-12-03 11:37:08 +00:00
Dan Balasescu 50c10fc39e
Document binding generation in README 2024-12-03 17:40:10 +09:00
Dan Balasescu f4001dad7d
Merge pull request #178 from frenzibyte/save-android
Work around Android CI workflow errors
2024-11-28 17:35:58 +09:00
Salman Alshamrani 7d0d0d7569 Fix android workflow not installing .NET 8 version 2024-11-27 23:44:32 -05:00
Dan Balasescu fa446c3285
Merge pull request #176 from ppy/update-native-binaries
Update native binaries
2024-11-18 11:18:16 +09:00
smoogipoo e41affe943 Update native binaries 2024-11-18 01:35:45 +00:00
Dan Balasescu 7eb48f25ec
Merge pull request #174 from Susko3/update-bindings
Update bindings, including manual macro update
2024-11-18 10:05:21 +09:00
Susko3 2590a7205e Update SDL_ISPIXELFORMAT_ALPHA
e027b85cc4
2024-11-17 21:51:08 +00:00
Susko3 1bbb7292b3 Update SDL and generate bindings 2024-11-17 21:34:24 +00:00
hwsmm f5875c5ea8
Merge pull request #173 from Susko3/remove-sed-hack
Specify Android ABIs as command line params to SDL `androidbuildlibs.sh`
2024-10-30 09:42:17 +09:00
Susko3 609a319551 Specify Android ABIs as command line params 2024-10-29 21:49:02 +00:00
Susko3 0ef3dbab09
Merge pull request #169 from smoogipoo/dockerfile
Add dockerfile + generation wrapper script
2024-10-28 13:23:18 +00:00
Dan Balasescu 22c6c79701
Fix up caching + remove python3 symlink 2024-10-28 21:47:48 +09:00
Dan Balasescu 81e5c4cb7f
Remove unused script 2024-10-28 20:34:10 +09:00
Dan Balasescu f46a595008
Improve Dockerfile 2024-10-28 20:31:11 +09:00
Susko3 a7f3fe450d Generate bindings on Linux
This will be the canonical representation going forward.
2024-10-24 12:04:00 +01:00
Dan Balasescu dcea5f47c3
Hack around missing process.h on Unix systems
Co-authored-by: Susko3 <Susko3@protonmail.com>
2024-10-24 19:34:51 +09:00
Dan Balasescu 04c71afe67
Remove now unnecessary undefines 2024-10-24 19:19:00 +09:00
Susko3 69c7e23842 Fix 64-bit integers on `x86_64-linux-gnu`
The __LP64__ macros work fine on aarch64, but they don't seem to do much on x86_64
2024-10-24 10:44:19 +01:00
Dan Balasescu 520ae0ebc7
Remove duplicate definition 2024-10-24 16:26:44 +09:00
Dan Balasescu e7c8dec375
Merge branch 'master' into dockerfile 2024-10-24 16:18:48 +09:00
Dan Balasescu 36c251aed2
Merge pull request #172 from Susko3/remove-some-platform-specific-defines
Update bindings and remove some platform/windows specific symbols
2024-10-24 15:45:24 +09:00
Susko3 11228b67aa Ensure consistent representation of 64-bit integer constants
by providing custom definitions of `SDL_{S,U}INT64_C`.
Made possible by https://github.com/libsdl-org/SDL/pull/11315
2024-10-24 01:18:39 +01:00
Susko3 4831863919 Update SDL and bindings 2024-10-24 01:18:31 +01:00
Susko3 ec696f7bab Remove `[NativeTypeName("unsigned int")]`
This would appear a lot when bindgen is run on Linux (underlying enum type is unsigned int).
2024-10-24 00:52:29 +01:00
Susko3 fa61d32dfc Exclude symbols that don't work cross-platform
As seen when trying to build on Linux in #169.
Removes:
- Windows-specific begin/end thread symbols that don't do anything
- Things that statically depend on `size_t`
- 64-bit printf specifiers that depend on int64_t definition
  (long vs long long)
2024-10-24 00:48:29 +01:00
Dan Balasescu ed43193103
Force `int` as base type 2024-10-23 17:03:25 +09:00
Dan Balasescu 140e73678d
Fix va_list for another platform 2024-10-23 17:03:09 +09:00
Dan Balasescu c991b5bd06
Forward args to python script
Co-authored-by: Susko3 <Susko3@protonmail.com>
2024-10-22 19:42:16 +09:00
Dan Balasescu a64cdd9e4f
Fix SDL_thread generation 2024-10-22 18:16:41 +09:00
Dan Balasescu 904f50cb99
Merge pull request #170 from ppy/update-native-binaries
Update native binaries
2024-10-22 18:15:42 +09:00
smoogipoo 46e1411e24 Update native binaries 2024-10-22 09:13:18 +00:00
Dan Balasescu 5227b62690
Add dockerfile + generation wrapper script 2024-10-22 17:52:46 +09:00
Dan Balasescu ee98235385
Merge pull request #168 from Susko3/update-bindings
Update bindings and fix bindgen script
2024-10-22 17:42:51 +09:00
Susko3 5ab6d58b9e Update comment 2024-10-22 09:27:28 +01:00
Susko3 e5a7980b9e Exclude `enum`s from platform-specific bindgen 2024-10-22 09:20:55 +01:00
Susko3 c7fdd26674 Update bindings (to illustrate problem)
Duplicate `SDL_Sandbox` definitions prevent compiling.
2024-10-22 09:11:15 +01:00
Dean Herbert bfa2ad06c4
Merge pull request #167 from bdach/android-enter-fix
Update SDL to pull in android enter key fix
2024-10-22 16:55:45 +09:00
Bartłomiej Dach 53dff157d5
Fix linux-arm build failures due to docker changes
`linux-arm(64)` builds started failing with

    latest: Pulling from arm64v8/ubuntu
    docker: no matching manifest for linux/amd64 in the manifest list entries.

(https://github.com/bdach/SDL3-CS/actions/runs/11440882162/job/31827702325)

Upon closer inspection, new `arm32v7/ubuntu` and `arm64v8/ubuntu` images
were pushed on Oct 19, 2024, which seemed related.

While pinning the images to the last known working digest worked,
it's obviously suboptimal. Looking closer at previous passing build
logs, warnings are noticeable:

    WARNING: The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested

    WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested

therefore I decided to try specifying the platform explicitly to see if
it fixes the issue, and it does.
2024-10-22 08:59:45 +02:00
Bartłomiej Dach 84c8d4240f
Update SDL submodule
Pulls in https://github.com/libsdl-org/SDL/pull/11256 to fix
https://github.com/ppy/osu/issues/28966.
2024-10-21 15:08:17 +02:00
Dan Balasescu 55d3514908
Merge pull request #166 from ppy/update-native-binaries
Update native binaries
2024-10-15 13:54:20 +09:00
smoogipoo 6fa75e75a6 Update native binaries 2024-10-15 04:49:34 +00:00
Dan Balasescu 012a3dc1f2
Merge pull request #165 from hwsmm/update
Update bindings
2024-10-15 13:19:01 +09:00
hwsmm c51cad1aa7 Update bindings to 1cc85c912bb3352a121b1fdc181c6ab6546157df 2024-10-14 14:15:39 +09:00
Dan Balasescu 209d102b32
Merge pull request #164 from Susko3/bump-java-action-version
Bump actions/setup-java to v4
2024-10-03 01:36:30 +09:00
Susko3 f9533a8fa5 Bump actions/setup-java to v4 2024-10-02 16:52:20 +01:00
Susko3 c1a2631133
Merge pull request #163 from ppy/update-native-binaries
Update native binaries
2024-10-02 16:49:35 +01:00
smoogipoo ec5015b788 Update native binaries 2024-10-02 02:59:13 +00:00
Dan Balasescu 2738571117
Merge pull request #162 from Susko3/update-bindings
Update bindings
2024-10-02 11:05:19 +09:00
Susko3 05c7ec057c Add some missing macros 2024-10-02 02:13:12 +01:00
Susko3 98930ae886 Update bindings 2024-10-02 00:51:01 +01:00
Susko3 bccaf2fa75
Merge pull request #161 from smoogipoo/single-pr
Submit binary file updates as a single PR
2024-10-01 19:25:07 +01:00
Dan Balasescu 682da0bfe1
Apply review suggestions 2024-09-26 18:21:25 +09:00
Dan Balasescu 788afa6ab1
Create single PR for binary updates 2024-09-23 00:59:31 +09:00
Dan Balasescu 5abea9c105
Merge pull request #160 from Susko3/run-bindgen-on-specific-headers
Add way to run `generate_bindings.py` on a subset of headers
2024-09-22 23:50:32 +09:00
Susko3 b968192607 Add way to run bindgen on a subset of headers
Useful for testing changes that affect specific headers.
2024-09-22 14:28:44 +01:00
Susko3 1059f343e0
Merge pull request #159 from hwsmm/endian
Fix endianness in SDL_pixel
2024-09-22 13:34:35 +01:00
hwsmm df84a111c7 Fix endianness in SDL_pixel 2024-09-22 13:43:13 +09:00
Dan Balasescu d4bb6809ac
Merge pull request #147 from Susko3/update-SDL-bool
Update SDL bindings (removal of SDL_bool, replaced with C# SDLBool)
2024-09-22 13:18:19 +09:00
Susko3 4f32e5fb4e Add SDLBool with implicit bool conversions 2024-09-22 02:03:16 +01:00
Susko3 fa7121a2c4 Update SDL bindings
This brings in the removal of SDL_bool, making it C# `byte`
2024-09-22 01:15:09 +01:00
Susko3 fb08ccb2ce Remove SDL_bool define patche
This doesn't compile as true/false can't be converted to `enum SDL_bool`
2024-09-22 00:51:50 +01:00
Susko3 5fbda17ae9 Fix python formatting 2024-09-22 00:44:50 +01:00
Dean Herbert 75c49e289e
Merge pull request #142 from smoogipoo/add-submodule
Add SDL submodule
2024-09-20 13:21:58 +09:00
Dan Balasescu c4e81478e0
Merge pull request #145 from stanoddly/patch-1
Updated README.md
2024-09-19 20:28:07 +09:00
Dan Balasescu a035dd9f99
Reset git tree before generate/build 2024-09-18 17:55:45 +09:00
Stan b76615c8b2
SDL 3 - > SDL3
Co-authored-by: hwsmm <9151706+hwsmm@users.noreply.github.com>
2024-09-18 08:52:40 +02:00
Stan dc759a5853
Updated README.md 2024-09-18 08:09:07 +02:00
Dan Balasescu e207e72b6a
Move + update build scripts to use submodule 2024-09-18 13:42:08 +09:00
Dan Balasescu 2369173847
Bring in SDL submodule
Checked out to 93bf53426840fd052da2aeb6d5a5a6f380f4c21a.
2024-09-18 13:35:48 +09:00
Dan Balasescu 7a6b799cc5
Merge remote-tracking branch 'upstream/update-android-binaries' 2024-09-16 00:13:48 +09:00
Dan Balasescu 30751744bb
Merge remote-tracking branch 'upstream/update-ios-binaries' 2024-09-16 00:13:47 +09:00
Dan Balasescu 84c944c19c
Merge remote-tracking branch 'upstream/update-linux-arm-binaries' 2024-09-16 00:13:46 +09:00
Dan Balasescu d73c8964dc
Merge remote-tracking branch 'upstream/update-linux-arm64-binaries' 2024-09-16 00:13:46 +09:00
Dan Balasescu dc1a797d4d
Merge remote-tracking branch 'upstream/update-linux-x64-binaries' 2024-09-16 00:13:45 +09:00
Dan Balasescu 61365c84f7
Merge remote-tracking branch 'upstream/update-linux-x86-binaries' 2024-09-16 00:13:44 +09:00
Dan Balasescu c0be2a238e
Merge remote-tracking branch 'upstream/update-osx-arm64-binaries' 2024-09-16 00:13:43 +09:00
Dan Balasescu c50f542dd8
Merge remote-tracking branch 'upstream/update-osx-x64-binaries' 2024-09-16 00:13:42 +09:00
Dan Balasescu 7a96e75492
Merge remote-tracking branch 'upstream/update-win-arm64-binaries' 2024-09-16 00:13:42 +09:00
Dan Balasescu a85443c42c
Merge remote-tracking branch 'upstream/update-win-x64-binaries' 2024-09-16 00:13:41 +09:00
smoogipoo 461ae94bc5 Update linux-arm64 SDL binaries 2024-09-15 15:12:34 +00:00
smoogipoo fdd4753c64 Update linux-arm SDL binaries 2024-09-15 14:59:30 +00:00
smoogipoo 7e04509e6a Update iOS SDL binaries 2024-09-15 14:41:33 +00:00
smoogipoo 333adaa435 Update Android SDL binaries 2024-09-15 14:41:01 +00:00
smoogipoo 8202eba9f4 Update linux-x86 SDL binaries 2024-09-15 14:40:49 +00:00
smoogipoo dd4f866860 Update win-x64 SDL binaries 2024-09-15 14:40:23 +00:00
smoogipoo f8f2698ff7 Update win-arm64 SDL binaries 2024-09-15 14:40:12 +00:00
smoogipoo 3194051a5d Update win-x86 SDL binaries 2024-09-15 14:40:10 +00:00
smoogipoo 94f87bc6d3 Update linux-x64 SDL binaries 2024-09-15 14:39:17 +00:00
smoogipoo 349f312d8b Update osx-x64 SDL binaries 2024-09-15 14:38:52 +00:00
smoogipoo 623ae0bb4d Update osx-arm64 SDL binaries 2024-09-15 14:38:38 +00:00
Susko3 833814cf25
Merge pull request #129 from hwsmm/update
Update bindings 3 (no merging needed)
2024-09-15 03:18:33 +01:00
hwsmm 4792b4667b Add a new SDL_Process bindings 2024-09-15 11:06:03 +09:00
Susko3 d04f71cdfa Rider migrations 2024-09-15 01:52:11 +01:00
Susko3 312410a279 Add missing Win32 and GDK functions
For now, SDL_GDKSuspendGPU and SDL_GDKResumeGPU from SDL_gpu.h are missing
from auto-generated bindings. We can add them manually if needed.

These missing funtions cause warnings to be logged when running `generate_bindings.py`.
2024-09-15 01:48:46 +01:00
Susko3 edb9a6b69d Update bindings to 93bf53426840fd052da2aeb6d5a5a6f380f4c21a
Importantly, this brings in a fix for SDL's gendynapi.py throwing an error.
2024-09-15 01:37:32 +01:00
hwsmm 03f3773985 Update bindings to b15fab0207004282aaf0ab0643fd08579121c88a 2024-09-12 12:32:58 +09:00
hwsmm 00c2991885 Update bindings to 73898a0a6493c43943dc675ad1eccd03e16ba0d7 2024-09-03 21:25:00 +09:00
hwsmm a7cb45ee1b Update bindings to df501040fd646a1f4eab92aa5b698b35a36013ed 2024-09-03 21:25:00 +09:00
Susko3 03cb53dd11 Add tests for binary representation of SDL_bool 2024-09-02 18:58:32 +02:00
hwsmm 9f75280505 Fix tests 2024-08-28 22:46:24 +09:00
hwsmm 15e2c5442d Update bindings to ace6920d4433599e99083892fc12495239ee3d61 2024-08-28 22:04:50 +09:00
hwsmm 5235b75dd3 Update bindings to 9eac3a434e328bd6f7470eb59076dcf7dae237be 2024-08-22 22:21:40 +09:00
hwsmm dbff763b5c Update bindings to f93920a4f16c4d16f6cd3797191e7894542dac4b 2024-08-11 14:06:24 +09:00
223 changed files with 8533 additions and 1667 deletions

6
.gitattributes vendored
View File

@ -22,4 +22,8 @@ App.config text eol=crlf
.gitignore text eol=lf
.gitattributes text eol=lf
*.md text eol=lf
.travis.yml text eol=lf
.travis.yml text eol=lf
# Use lf for files used by ClangSharpPInvokeGenerator
*-license-header.txt text eol=lf
*.g.cs text eol=lf

View File

@ -1,16 +1,12 @@
name: Build Native
on:
workflow_dispatch:
inputs:
sdl_ref:
description: SDL3 commit/branch/tag to build
required: true
default: main
type: string
# schedule:
# - cron: '0 0 * * *'
env:
BUILD_TYPE: Release
NDK_VER: 28.2.13676358
PLATFORM_VER: 35
jobs:
build:
@ -20,29 +16,41 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: win-x64, os: windows-latest, flags: -A x64 }
- { name: win-x86, os: windows-latest, flags: -A Win32 }
- { name: win-arm64, os: windows-latest, flags: -A ARM64 }
- { name: linux-x64, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":amd64"}
- { name: linux-x86, os: ubuntu-20.04, flags: -GNinja -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32", target_apt_arch: ":i386" }
- { name: linux-arm64, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":arm64", container: arm64v8/ubuntu }
- { name: linux-arm, os: ubuntu-20.04, flags: -GNinja, target_apt_arch: ":armhf", container: arm32v7/ubuntu }
- { name: osx-x64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 }
- { name: win-x64, os: windows-latest, flags: -A x64 }
- { name: win-x86, os: windows-2022, flags: -A Win32 }
- { name: win-arm64, os: windows-latest, flags: -A ARM64 }
- { name: linux-x64, os: ubuntu-22.04, flags: -GNinja, target_apt_arch: ":amd64" }
- { name: linux-x86, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DWAVPACK_ENABLE_ASM=OFF, target_apt_arch: ":i386" }
- { name: linux-arm64, os: ubuntu-22.04-arm, flags: -GNinja, target_apt_arch: ":arm64", container: "arm64v8/ubuntu:22.04" }
- { name: linux-arm, os: ubuntu-22.04-arm, flags: -GNinja -DCMAKE_C_FLAGS=-mfpu=neon -DCMAKE_CXX_FLAGS=-mfpu=neon, target_apt_arch: ":armhf", container: "arm32v7/ubuntu:22.04" }
- { name: osx-x64, os: macos-13, flags: -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 }
# NOTE: macOS 11.0 is the first released supported by Apple Silicon.
- { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 }
- { name: osx-arm64, os: macos-latest, flags: -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 }
- { name: android-arm64, os: ubuntu-22.04, flags: -GNinja, abi: arm64-v8a }
- { name: android-arm, os: ubuntu-22.04, flags: -GNinja, abi: armeabi-v7a }
- { name: android-x64, os: ubuntu-22.04, flags: -GNinja, abi: x86_64 }
- { name: android-x86, os: ubuntu-22.04, flags: -GNinja, abi: x86 }
steps:
- uses: actions/checkout@v4
with:
repository: 'libsdl-org/SDL'
ref: ${{ inputs.sdl_ref }}
submodules: recursive
- uses: actions/checkout@v4
- name: Setup JDK
if: contains(matrix.platform.name, 'android')
uses: actions/setup-java@v4
with:
path: 'SDL3-CS'
distribution: microsoft
java-version: 17
- name: Set up QEMU
if: contains(matrix.platform.container, 'arm')
uses: docker/setup-qemu-action@v3
- name: Install Android SDK Manager
if: contains(matrix.platform.name, 'android')
uses: android-actions/setup-android@v3
- name: Install Android SDK
if: contains(matrix.platform.name, 'android')
run: |
sdkmanager --install "platforms;android-$PLATFORM_VER"
sdkmanager --install "ndk;$NDK_VER"
- name: Build (Linux ARM)
if: contains(matrix.platform.container, 'arm')
@ -54,11 +62,10 @@ jobs:
-e NAME=${{ matrix.platform.name }}
-e TARGET_APT_ARCH=${{ matrix.platform.target_apt_arch }}
-e RUNNER_OS=${{ runner.os }}
-e FLAGS=${{ matrix.platform.flags }}
-e BUILD_TYPE=${{ env.BUILD_TYPE }}
run: |
cd /workspace
./SDL3-CS/build.sh
FLAGS="${{ matrix.platform.flags }}" ./External/build.sh
- name: Build
if: ${{ !contains(matrix.platform.container, 'arm') }}
@ -68,7 +75,8 @@ jobs:
TARGET_APT_ARCH: ${{ matrix.platform.target_apt_arch }}
RUNNER_OS: ${{ runner.os }}
FLAGS: ${{ matrix.platform.flags }}
run: ./SDL3-CS/build.sh
ANDROID_ABI: ${{ matrix.platform.abi }}
run: ./External/build.sh
- name: Get Actions user id
if: runner.os == 'Linux'
@ -81,75 +89,81 @@ jobs:
with:
user_id: ${{ steps.get_uid.outputs.uid }}
- name: Create pull request
uses: peter-evans/create-pull-request@v6
- name: Compress native directory
if: ${{ !contains(matrix.platform.name, 'android') }}
run: tar -cvf native-${{ matrix.platform.name }}.tar native/${{ matrix.platform.name }}
- name: Compress native directory (Android)
if: contains(matrix.platform.name, 'android')
run: tar -cvf native-${{ matrix.platform.name }}.tar native/android/${{ matrix.platform.abi }}
- name: Upload native artifact
uses: actions/upload-artifact@v4
with:
commit-message: Update ${{ matrix.platform.name }} SDL binaries
title: Update ${{ matrix.platform.name }} SDL binaries
body: This PR has been auto-generated to update the ${{ matrix.platform.name }} SDL binaries.
branch: update-${{ matrix.platform.name }}-binaries
path: 'SDL3-CS'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
name: native-${{ matrix.platform.name }}
path: native-${{ matrix.platform.name }}.tar
if-no-files-found: error
build-ios:
name: ios
runs-on: macos-latest
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
repository: 'libsdl-org/SDL'
ref: ${{ inputs.sdl_ref }}
submodules: recursive
- uses: actions/checkout@v4
with:
path: 'SDL3-CS'
# https://github.com/dotnet/macios/issues/19157
# https://github.com/actions/runner-images/issues/12758
- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
- name: Build (iOS)
run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target SDL3.xcframework -configuration Release
- name: Prepare release directory (iOS)
run: mkdir -p SDL3-CS/native/ios
- name: Prepare release (iOS)
run: |
mkdir -p SDL3-CS/native/ios/SDL3.xcframework/ios-arm64/SDL3.framework;
mkdir -p SDL3-CS/native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework;
cp Xcode/SDL/build/SDL3.xcframework/Info.plist SDL3-CS/native/ios/SDL3.xcframework/Info.plist;
cp Xcode/SDL/build/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3 SDL3-CS/native/ios/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3;
cp Xcode/SDL/build/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist SDL3-CS/native/ios/SDL3.xcframework/ios-arm64/SDL3.framework/Info.plist;
cp Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3 SDL3-CS/native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/SDL3;
cp Xcode/SDL/build/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist SDL3-CS/native/ios/SDL3.xcframework/ios-arm64_x86_64-simulator/SDL3.framework/Info.plist;
modules=("SDL3" "SDL3_image" "SDL3_ttf" "SDL3_mixer")
architectures=("ios-arm64" "ios-arm64_x86_64-simulator")
- name: Create pull request
uses: peter-evans/create-pull-request@v6
for module in "${modules[@]}"; do
module0="${module/SDL3/SDL}"
directory="External/${module0}/Xcode"
if [ "$module" == "SDL3" ]; then
directory+="/SDL"
fi
target="${module}.xcframework"
framework="${module}.framework"
output_dir="native/ios/${target}"
xcodebuild -project "${directory}/${module0}.xcodeproj" -target "${target}" -configuration Release
build_dir="${directory}/build/${target}"
for arch in "${architectures[@]}"; do
mkdir -p "${output_dir}/${arch}/${framework}"
cp "${build_dir}/${arch}/${framework}/${module}" "${output_dir}/${arch}/${framework}/${module}"
cp "${build_dir}/${arch}/${framework}/Info.plist" "${output_dir}/${arch}/${framework}/Info.plist"
done
cp "${build_dir}/Info.plist" "${output_dir}/Info.plist"
done
- name: Compress native directory
run: tar -cvf native-ios.tar native/ios
- name: Upload native artifact
uses: actions/upload-artifact@v4
with:
commit-message: Update iOS SDL binaries
title: Update iOS SDL binaries
body: This PR has been auto-generated to update the iOS SDL binaries
branch: update-ios-binaries
path: 'SDL3-CS'
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
name: native-ios
path: native-ios.tar
if-no-files-found: error
build-android:
name: android
runs-on: ubuntu-20.04
env:
NDK_VER: 23.1.7779620
PLATFORM_VER: android-34
build-android-jar:
name: android-jar
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
repository: 'libsdl-org/SDL'
ref: ${{ inputs.sdl_ref }}
- uses: actions/checkout@v4
with:
path: 'SDL3-CS'
submodules: true
- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: |
@ -158,43 +172,63 @@ jobs:
- name: Install Android SDK Manager
uses: android-actions/setup-android@v3
with:
packages: ''
- name: Install Android SDK
run: |
sdkmanager --install "platform-tools" "platforms;$PLATFORM_VER"
sdkmanager --install "ndk;$NDK_VER" --channel=3
- name: Build (Android)
run: |
export PATH=$ANDROID_HOME/ndk/$NDK_VER:$PATH
export OUTPUT=$PWD/SDL3-CS/native/android
rm -rf $OUTPUT && mkdir -p $OUTPUT
# Build SDL3
sed -i 's/abi=.*/abi="armeabi-v7a arm64-v8a x86 x86_64"/g' ./build-scripts/androidbuildlibs.sh
./build-scripts/androidbuildlibs.sh NDK_LIBS_OUT="$OUTPUT"
sdkmanager --install "platforms;android-$PLATFORM_VER"
- name: Build SDL3 Android Java
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
export PATH=$JAVA_HOME_11_X64/bin:$PATH
export OUTPUT=$PWD/SDL3-CS/SDL3-CS.Android/Jars/
export OUTPUT=$PWD/SDL3-CS/Jars/
rm -rf $OUTPUT && mkdir -p $OUTPUT
# Build SDL3 Android Java part
cd android-project/app/src/main/java
javac -cp $ANDROID_HOME/platforms/$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java
cd ./External/SDL/android-project/app/src/main/java
javac -cp $ANDROID_HOME/platforms/android-$PLATFORM_VER/android.jar -encoding utf8 org/libsdl/app/*.java
jar cvf $OUTPUT/SDL3AndroidBridge.jar org/libsdl/app/*.class
- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: android-jar
path: SDL3-CS/Jars/SDL3AndroidBridge.jar
if-no-files-found: error
make-pr:
name: Submit pull request
runs-on: ubuntu-latest
needs: [ build, build-ios, build-android-jar ]
steps:
- uses: actions/checkout@v4
- name: Download native artifacts
uses: actions/download-artifact@v4
with:
pattern: native-*
merge-multiple: true
- name: Decompress native artifacts
run: |
for file in native-*.tar
do
tar -xf "$file"
done
rm native-*.tar
- name: Download JAR artifact
uses: actions/download-artifact@v4
with:
name: android-jar
path: SDL3-CS/Jars/
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Update Android SDL binaries
title: Update Android SDL binaries
body: This PR has been auto-generated to update the Android SDL binaries
branch: update-android-binaries
path: 'SDL3-CS'
commit-message: Update native binaries
title: Update native binaries
body: This PR has been auto-generated to update the native SDL binaries
branch: update-native-binaries
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

79
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: Continuous Integration
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build-only-desktop:
name: Build only (Desktop)
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CI_DONT_TARGET_ANDROID: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Build
run: dotnet build -c Debug SDL3-CS.Desktop.slnf
build-only-android:
name: Build only (Android)
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 11
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: 11
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install .NET workloads
run: dotnet workload install android
- name: Build
run: dotnet build -c Debug SDL3-CS.Android.slnf
build-only-ios:
name: Build only (iOS)
runs-on: macos-15
timeout-minutes: 60
env:
CI_DONT_TARGET_ANDROID: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install .NET Workloads
run: dotnet workload install ios
# https://github.com/dotnet/macios/issues/19157
# https://github.com/actions/runner-images/issues/12758
- name: Use Xcode 16.4
run: sudo xcode-select -switch /Applications/Xcode_16.4.app
- name: Build
run: dotnet build -c Debug SDL3-CS.iOS.slnf

View File

@ -6,7 +6,7 @@ on:
- '*'
jobs:
desktop:
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -16,45 +16,30 @@ jobs:
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build SDL3-CS.Desktop.slnf -c Release
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: microsoft
java-version: 17
- name: Pack
run: dotnet pack SDL3-CS/SDL3-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD)
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install .NET workloads
run: dotnet workload restore
- name: Build & pack
run: |
dotnet pack SDL3-CS/SDL3-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_image-CS/SDL3_image-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_ttf-CS/SDL3_ttf-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
dotnet pack SDL3_mixer-CS/SDL3_mixer-CS.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD) -o artifacts
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SDL3-CS
path: SDL3-CS/bin/Release/ppy.*.nupkg
name: Packages
path: artifacts/ppy.*.nupkg
- name: Publish tagged release to nuget.org
run: dotnet nuget push SDL3-CS/bin/Release/ppy.*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
android:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install Android workload
run: dotnet workload install android
- name: Build
run: dotnet build SDL3-CS.Android.slnf -c Release
- name: Pack
run: dotnet pack SDL3-CS.Android\SDL3-CS.Android.csproj -c Release /p:Version=$(git describe --exact-match --tags HEAD)
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SDL3-CS.Android
path: SDL3-CS.Android\bin\Release\ppy.*.nupkg
- name: Publish tagged release to nuget.org
run: dotnet nuget push SDL3-CS.Android\bin\Release\ppy.*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}
run: dotnet nuget push artifacts/ppy.*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}}

2
.gitignore vendored
View File

@ -338,3 +338,5 @@ inspectcodereport.xml
inspectcode
sdl.json
install_output/

15
.gitmodules vendored Normal file
View File

@ -0,0 +1,15 @@
[submodule "SDL"]
path = External/SDL
url = https://github.com/libsdl-org/SDL
[submodule "SDL_image"]
path = External/SDL_image
url = https://github.com/libsdl-org/SDL_image.git
branch = main
[submodule "SDL_ttf"]
path = External/SDL_ttf
url = https://github.com/libsdl-org/SDL_ttf.git
branch = main
[submodule "SDL_mixer"]
path = External/SDL_mixer
url = https://github.com/libsdl-org/SDL_mixer.git
branch = main

View File

@ -1 +0,0 @@
SDL3-CS.Android

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="2" />
</component>
</project>

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y dotnet-sdk-8.0 python3 git build-essential
WORKDIR /tmp
COPY .config/dotnet-tools.json .config/dotnet-tools.json
COPY SDL3-CS/SDL3-CS.csproj SDL3-CS/SDL3-CS.csproj
# .NET 8 installed using the distro package does not support the android workload.
# Since the project is only used for reference purposes, we'll retarget it to a single framework.
# See: https://github.com/dotnet/core/discussions/9258#discussioncomment-9548857
RUN sed -i 's/<TargetFrameworks.*$/<TargetFramework>net8.0<\/TargetFramework>/' SDL3-CS/SDL3-CS.csproj
RUN dotnet tool restore && \
dotnet restore --ucr SDL3-CS/SDL3-CS.csproj
WORKDIR /
RUN echo '#!/bin/bash' >> entrypoint.sh && \
echo 'export LD_LIBRARY_PATH="$(echo ~/.nuget/packages/libclang.runtime.*/*/runtimes/*/native):$(echo ~/.nuget/packages/libclangsharp.runtime.*/*/runtimes/*/native):${LD_LIBRARY_PATH:-}"' >> entrypoint.sh && \
echo 'export CPLUS_INCLUDE_PATH="$(echo /usr/lib/gcc/*/*/include):/usr/include:${CPLUS_INCLUDE_PATH:-}"' >> entrypoint.sh && \
echo 'python3 SDL3-CS/generate_bindings.py "$@"' >> entrypoint.sh && \
chmod +x entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

4
External/.idea/encodings.xml vendored Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

60
External/.idea/misc.xml vendored Normal file
View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectUserFactors">
<factor id="completionFinishedType">
<dailyData date="26-06-2023">
<observation name="cancelled" value="31.0" />
<observation name="explicitSelect" value="7.0" />
</dailyData>
</factor>
<factor id="completionType">
<dailyData date="26-06-2023">
<observation name="BASIC" value="31.0" />
</dailyData>
</factor>
<factor id="completionUsage">
<dailyData date="26-06-2023">
<observation name="count" value="38.0" />
</dailyData>
</factor>
<factor id="itemPosition">
<dailyData date="26-06-2023">
<observation name="0" value="6.0" />
<observation name="86" value="1.0" />
</dailyData>
</factor>
<factor id="mnemonicsUsage">
<dailyData date="26-06-2023">
<observation name="total" value="7.0" />
<observation name="withMnemonics" value="0.0" />
</dailyData>
</factor>
<factor id="prefixLength">
<dailyData date="26-06-2023">
<observation name="21" value="1.0" />
<observation name="24" value="1.0" />
<observation name="26" value="1.0" />
<observation name="28" value="1.0" />
<observation name="29" value="2.0" />
<observation name="32" value="1.0" />
</dailyData>
</factor>
<factor id="prefixMatchingType">
<dailyData date="26-06-2023">
<observation name="GREEDY_WITH_CASE" value="4.0" />
<observation name="WORDS_FIRST_CHAR" value="1.0" />
</dailyData>
</factor>
<factor id="templatesUsage">
<dailyData date="26-06-2023">
<observation name="totalStartingWithPrefix" value="7.0" />
</dailyData>
</factor>
<factor id="timeBetweenTyping">
<dailyData date="26-06-2023">
<observation name="average" value="115.76087" />
<observation name="count" value="92.0" />
</dailyData>
</factor>
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="singleClickDiffPreview" value="1" />
<option name="unhandledExceptionsIgnoreList" value="1" />
<option name="vcsConfiguration" value="3" />
</component>
</project>

1
External/SDL vendored Submodule

@ -0,0 +1 @@
Subproject commit 8e644111c2220e654f53de4ea0aa3afdfc7813c5

1
External/SDL_image vendored Submodule

@ -0,0 +1 @@
Subproject commit 13ec6e9be1d69d2a989ec1fc4f09e8743ef3932d

1
External/SDL_mixer vendored Submodule

@ -0,0 +1 @@
Subproject commit 7d6e46ad28cc33ad1e87a46df739a7cba47f57fa

1
External/SDL_ttf vendored Submodule

@ -0,0 +1 @@
Subproject commit d929bc0d84bfaf3a71ec7f6be27aeb466380c1a0

186
External/build.sh vendored Executable file
View File

@ -0,0 +1,186 @@
#!/bin/bash
set -e
pushd "$(dirname "$0")"
# Check if environment variables are defined
if [[ -z $NAME || -z $RUNNER_OS || -z $FLAGS || -z $BUILD_TYPE ]]; then
echo "One or more required environment variables are not defined."
exit 1
fi
if [[ $RUNNER_OS == 'Windows' ]]; then
SUDO=""
else
SUDO=$(which sudo || exit 0)
fi
if [[ -n $ANDROID_ABI ]]; then
BUILD_PLATFORM="Android"
else
BUILD_PLATFORM="$RUNNER_OS"
fi
export DEBIAN_FRONTEND=noninteractive
if [[ $BUILD_PLATFORM != 'Android' ]]; then
NATIVE_PATH="$NAME"
if [[ $BUILD_PLATFORM == 'Linux' ]]; then
# Setup Linux dependencies
if [[ $TARGET_APT_ARCH == :i386 ]]; then
$SUDO dpkg --add-architecture i386
fi
$SUDO apt-get update -y -qq
if [[ $NAME != 'linux-x86' && $NAME != 'linux-x64' ]]; then
GCC="gcc"
GPP="g++"
else
GCC="gcc-multilib"
GPP="g++-multilib"
fi
$SUDO apt-get install -y \
$GCC \
$GPP \
git \
cmake \
ninja-build \
wayland-scanner++ \
wayland-protocols \
meson \
pkg-config$TARGET_APT_ARCH \
libasound2-dev$TARGET_APT_ARCH \
libdbus-1-dev$TARGET_APT_ARCH \
libegl1-mesa-dev$TARGET_APT_ARCH \
libgl1-mesa-dev$TARGET_APT_ARCH \
libgles2-mesa-dev$TARGET_APT_ARCH \
libglu1-mesa-dev$TARGET_APT_ARCH \
libgtk-3-dev$TARGET_APT_ARCH \
libibus-1.0-dev$TARGET_APT_ARCH \
libpango1.0-dev$TARGET_APT_ARCH \
libpulse-dev$TARGET_APT_ARCH \
libsndio-dev$TARGET_APT_ARCH \
libudev-dev$TARGET_APT_ARCH \
libwayland-dev$TARGET_APT_ARCH \
libx11-dev$TARGET_APT_ARCH \
libxcursor-dev$TARGET_APT_ARCH \
libxext-dev$TARGET_APT_ARCH \
libxi-dev$TARGET_APT_ARCH \
libxinerama-dev$TARGET_APT_ARCH \
libxkbcommon-dev$TARGET_APT_ARCH \
libxrandr-dev$TARGET_APT_ARCH \
libxss-dev$TARGET_APT_ARCH \
libxt-dev$TARGET_APT_ARCH \
libxv-dev$TARGET_APT_ARCH \
libxxf86vm-dev$TARGET_APT_ARCH \
libdrm-dev$TARGET_APT_ARCH \
libgbm-dev$TARGET_APT_ARCH \
libpulse-dev$TARGET_APT_ARCH \
libpipewire-0.3-dev$TARGET_APT_ARCH \
libdecor-0-dev$TARGET_APT_ARCH
fi
else
if [[ -z $ANDROID_HOME || -z $NDK_VER || -z $ANDROID_ABI ]]; then
echo "One or more required environment variables are not defined."
exit 1
fi
NATIVE_PATH="android/$ANDROID_ABI"
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VER"
export FLAGS="$FLAGS -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-DANDROID_HOME=$ANDROID_HOME \
-DANDROID_PLATFORM=21 \
-DANDROID_ABI=$ANDROID_ABI \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_DATAROOTDIR=share \
-DSDL_ANDROID_JAR=OFF"
$SUDO apt-get install -y \
git \
cmake \
ninja-build \
meson
fi
if [[ $RUNNER_OS == 'Linux' ]]; then
git config --global --add safe.directory $PWD/SDL
git config --global --add safe.directory $PWD/SDL_image
git config --global --add safe.directory $PWD/SDL_ttf
git config --global --add safe.directory $PWD/SDL_mixer
fi
CMAKE_INSTALL_PREFIX="$PWD/install_output"
rm -rf $CMAKE_INSTALL_PREFIX
if [[ $BUILD_PLATFORM == 'Android' ]]; then
OUTPUT_LIB="lib/libSDL3variant.so"
elif [[ $BUILD_PLATFORM == 'Windows' ]]; then
OUTPUT_LIB="bin/SDL3variant.dll"
elif [[ $BUILD_PLATFORM == 'Linux' ]]; then
OUTPUT_LIB="lib/libSDL3variant.so"
elif [[ $BUILD_PLATFORM == 'macOS' ]]; then
OUTPUT_LIB="lib/libSDL3variant.dylib"
fi
# Use the correct CMAKE_PREFIX_PATH for SDL_image and SDL_ttf, probably due differences in Cmake versions.
if [[ $BUILD_PLATFORM == 'Android' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX"
elif [[ $BUILD_PLATFORM == 'Windows' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/cmake/"
elif [[ $BUILD_PLATFORM == 'Linux' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/lib/cmake/"
elif [[ $BUILD_PLATFORM == 'macOS' ]]; then
CMAKE_PREFIX_PATH="$CMAKE_INSTALL_PREFIX/lib/cmake/"
fi
run_cmake() {
LIB_NAME=$1
LIB_OUTPUT=$2
pushd $LIB_NAME
git reset --hard HEAD || echo "Failed to clean up the repository"
if [[ $BUILD_PLATFORM == 'Windows' && $LIB_NAME == 'SDL' ]]; then
echo "Patching SDL to not include gameinput.h"
sed -i 's/#include <gameinput.h>/#_include <gameinput.h>/g' CMakeLists.txt
fi
# Change the minumum Android API level for SDL_mixer to API 24 as opusfile and libflac fail to build on lower versions.
if [[ $BUILD_PLATFORM == 'Android' && $LIB_NAME == 'SDL_mixer' ]]; then
export FLAGS="${FLAGS/-DANDROID_PLATFORM=21/-DANDROID_PLATFORM=24}"
fi
rm -rf build
cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED=ON -DSDL_STATIC=OFF "${@:3}"
cmake --build build/ --config $BUILD_TYPE --verbose
cmake --install build/ --prefix $CMAKE_INSTALL_PREFIX --config $BUILD_TYPE
# Move build lib into correct folders
cp $CMAKE_INSTALL_PREFIX/$LIB_OUTPUT ../../native/$NATIVE_PATH
popd
}
run_cmake SDL ${OUTPUT_LIB/variant/}
run_cmake SDL_ttf ${OUTPUT_LIB/variant/_ttf} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DSDLTTF_VENDORED=ON
# -DSDLIMAGE_AVIF=OFF is used because windows requires special setup to build avif support (nasm)
# TODO: Add support for avif on windows (VisualC script uses dynamic imports)
run_cmake SDL_image ${OUTPUT_LIB/variant/_image} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLIMAGE_AVIF=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_VENDORED=ON
# -DSDLMIXER_MP3_MPG123=OFF is used because upstream build is broken. Fallback to dr_mp3.
# See: https://github.com/libsdl-org/SDL_mixer/pull/744#issuecomment-3180682130
# Fixing using the proposed solution causes more issues.
run_cmake SDL_mixer ${OUTPUT_LIB/variant/_mixer} -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH -DSDLMIXER_MP3_MPG123=OFF -DSDLMIXER_DEPS_SHARED=OFF -DSDLMIXER_VENDORED=ON
popd

View File

@ -1 +1,34 @@
# SDL3-CS
C# bindings for the [SDL3](https://github.com/libsdl-org/SDL) family of libraries.
| Product | Usage | Package |
|------------------------------------------------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [`SDL`](https://github.com/libsdl-org/SDL/tree/main) | `dotnet add package ppy.SDL3-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3-CS) |
| [`SDL_image`](https://github.com/libsdl-org/SDL_image/tree/main) | `dotnet add package ppy.SDL3_image-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_image-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_image-CS) |
| [`SDL_ttf`](https://github.com/libsdl-org/SDL_ttf/tree/main) | `dotnet add package ppy.SDL3_ttf-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_ttf-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_ttf-CS) |
| [`SDL_mixer`](https://github.com/libsdl-org/SDL_mixer/tree/main) | `dotnet add package ppy.SDL3_mixer-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_mixer-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_mixer-CS) |
Contributions to keep the bindings up-to-date with upstream changes are welcome. If you have improvements or updates, feel free to submit a pull request.
## Platform support
| Product | `win-x64` | `win-x86` | `win-arm64` | `osx-arm64` | `osx-x64` | `linux-x64` | `linux-x86` | `linux-arm64` | `linux-arm` | `ios` | `android` |
|-----------------|-----------|-----------|-------------|-------------|-----------|-------------|-------------|---------------|-------------|---------|-----------|
| `SDL3-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_image-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_ttf-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_mixer-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | API 24+ |
## Generating bindings
Bindings are generated via the provided Dockerfile:
```sh
docker build -t 'sdl-gen' .
docker run --rm -v .:/app -w /app -it sdl-gen
```
## License
This code is released under [MIT](LICENCE).

19
README_nuget.md Normal file
View File

@ -0,0 +1,19 @@
C# bindings for the [SDL3](https://github.com/libsdl-org/SDL) family of libraries.
| Product | Usage | Package |
|------------------------------------------------------------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| [`SDL`](https://github.com/libsdl-org/SDL/tree/main) | `dotnet add package ppy.SDL3-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3-CS) |
| [`SDL_image`](https://github.com/libsdl-org/SDL_image/tree/main) | `dotnet add package ppy.SDL3_image-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_image-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_image-CS) |
| [`SDL_ttf`](https://github.com/libsdl-org/SDL_ttf/tree/main) | `dotnet add package ppy.SDL3_ttf-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_ttf-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_ttf-CS) |
| [`SDL_mixer`](https://github.com/libsdl-org/SDL_mixer/tree/main) | `dotnet add package ppy.SDL3_mixer-CS` | [![NuGet](https://img.shields.io/nuget/v/ppy.SDL3_mixer-CS?label=nuget)](https://www.nuget.org/packages/ppy.SDL3_mixer-CS) |
Contributions to keep the bindings up-to-date with upstream changes are welcome. If you have improvements or updates, feel free to submit a pull request.
## Platform support
| Product | `win-x64` | `win-x86` | `win-arm64` | `osx-arm64` | `osx-x64` | `linux-x64` | `linux-x86` | `linux-arm64` | `linux-arm` | `ios` | `android` |
|-----------------|-----------|-----------|-------------|-------------|-----------|-------------|-------------|---------------|-------------|---------|-----------|
| `SDL3-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_image-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_ttf-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; |
| `SDL3_mixer-CS` | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | &check; | API 24+ |

View File

@ -2,11 +2,13 @@
"solution": {
"path": "SDL3-CS.sln",
"projects": [
"SDL3-CS\\SDL3-CS.csproj",
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Android\\SDL3-CS.Android.csproj",
"SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Tests.Android\\SDL3-CS.Tests.Android.csproj"
"SDL3-CS\\SDL3-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj"
]
}
}
}

View File

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<RootNamespace>SDL.Android</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<Authors>ppy Pty Ltd</Authors>
<Company>ppy Pty Ltd</Company>
<Copyright>Copyright (c) 2024 ppy Pty Ltd</Copyright>
<Product>ppy.SDL3-CS.Android</Product>
<PackageId>ppy.SDL3-CS.Android</PackageId>
<PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl>
<RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<EmbeddedJar Include="Jars\SDL3AndroidBridge.jar" />
</ItemGroup>
</Project>

View File

@ -2,10 +2,13 @@
"solution": {
"path": "SDL3-CS.sln",
"projects": [
"SDL3-CS\\SDL3-CS.csproj",
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Tests.Desktop\\SDL3-CS.Tests.Desktop.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Tests.Desktop\\SDL3-CS.Tests.Desktop.csproj"
"SDL3-CS\\SDL3-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj"
]
}
}
}

View File

@ -32,9 +32,14 @@ using System;
foreach (var kvp in finder.Methods)
{
if (kvp.Value.Count == 0)
return;
string filename = kvp.Key;
var foundMethods = kvp.Value;
string className = ClassNameFromMethod(foundMethods.First().NativeMethod);
var result = new StringBuilder();
result.Append(file_header);
result.Append(
@ -42,7 +47,7 @@ using System;
SyntaxFactory.IdentifierName("SDL"))
.WithMembers(
SyntaxFactory.SingletonList<MemberDeclarationSyntax>(
SyntaxFactory.ClassDeclaration("SDL3")
SyntaxFactory.ClassDeclaration(className)
.WithModifiers(
SyntaxFactory.TokenList(
SyntaxFactory.Token(SyntaxKind.UnsafeKeyword),
@ -54,6 +59,16 @@ using System;
}
}
private static string ClassNameFromMethod(MethodDeclarationSyntax methodNode)
{
if (methodNode.Parent is ClassDeclarationSyntax classDeclaration)
{
return classDeclaration.Identifier.Text;
}
return "SDL3"; // fallback!
}
private static MemberDeclarationSyntax makeFriendlyMethod(GeneratedMethod gm)
{
var returnType = gm.RequiredChanges.HasFlag(Changes.ChangeReturnTypeToString)
@ -126,7 +141,10 @@ using System;
if (gm.RequiredChanges.HasFlag(Changes.ChangeReturnTypeToString))
{
expr = SyntaxFactory.InvocationExpression(
SyntaxFactory.IdentifierName("PtrToStringUTF8"))
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
SyntaxFactory.IdentifierName("SDL3"),
SyntaxFactory.IdentifierName("PtrToStringUTF8")))
.WithArguments(new[]
{
SyntaxFactory.Argument(makeFunctionCall(gm)),

View File

@ -15,14 +15,31 @@ namespace SDL.SourceGeneration
{
public readonly Dictionary<string, List<GeneratedMethod>> Methods = new Dictionary<string, List<GeneratedMethod>>();
private static readonly string[] sdlPrefixes = ["SDL_", "TTF_", "IMG_", "MIX_"];
/// <summary>
/// Checks whether the method is from any SDL library.
/// It identifies those by checking the SDL prefix in the method name.
/// </summary>
private static bool IsMethodFromSDL(MethodDeclarationSyntax methodNode)
{
foreach (string prefix in sdlPrefixes)
{
if (methodNode.Identifier.ValueText.StartsWith(prefix, StringComparison.Ordinal))
return true;
}
return false;
}
public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
{
if (syntaxNode is MethodDeclarationSyntax method)
{
string name = method.Identifier.ValueText;
bool isUnsafe = name.StartsWith($"{Helper.UnsafePrefix}SDL_", StringComparison.Ordinal);
bool isUnsafe = name.StartsWith(Helper.UnsafePrefix, StringComparison.Ordinal);
if (!name.StartsWith("SDL_", StringComparison.Ordinal) && !isUnsafe)
if (!IsMethodFromSDL(method) && !isUnsafe)
return;
if (method.ParameterList.Parameters.Any(p => p.Identifier.IsKind(SyntaxKind.ArgListKeyword)))

View File

@ -5,7 +5,7 @@ namespace SDL.Tests.Android
[Activity(Label = "SDL3-CS Android Tests", MainLauncher = true)]
public class MainActivity : SDLActivity
{
protected override string[] GetLibraries() => ["SDL3"];
protected override string[] GetLibraries() => ["SDL3", "SDL3_image", "SDL3_ttf", "SDL3_mixer"];
protected override void Main() => Program.Main();
}

View File

@ -9,24 +9,28 @@
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationId>SDL.Tests.Android</ApplicationId>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SDL3-CS.Tests\SDL3-CS.Tests.csproj"/>
<ProjectReference Include="..\SDL3-CS.Android\SDL3-CS.Android.csproj"/>
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3.so">
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\*.so">
<Abi>armeabi-v7a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\libSDL3.so">
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\arm64-v8a\*.so">
<Abi>arm64-v8a</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86\libSDL3.so">
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86\*.so">
<Abi>x86</Abi>
</AndroidNativeLibrary>
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\libSDL3.so">
<AndroidNativeLibrary Include="$(MSBuildThisFileDirectory)..\native\android\x86_64\*.so">
<Abi>x86_64</Abi>
</AndroidNativeLibrary>
</ItemGroup>

View File

@ -8,26 +8,21 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\SDL3-CS.Tests\SDL3-CS.Tests.csproj"/>
</ItemGroup>
<PropertyGroup>
<SDLArch>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</SDLArch>
<!-- If RID is specified -->
<SDLNativeLib Condition=" $(RuntimeIdentifier.StartsWith('win')) ">$(RuntimeIdentifier)\SDL3.dll</SDLNativeLib>
<SDLNativeLib Condition=" $(RuntimeIdentifier.StartsWith('linux')) ">$(RuntimeIdentifier)\libSDL3.so</SDLNativeLib>
<SDLNativeLib Condition=" $(RuntimeIdentifier.StartsWith('osx')) ">$(RuntimeIdentifier)\libSDL3.dylib</SDLNativeLib>
<!-- If RID is not specified -->
<SDLNativeLib Condition=" '$(SDLNativeLib)' == '' And '$([MSBuild]::IsOSPlatform(Windows))' ">win-$(SDLArch.ToLower())\SDL3.dll</SDLNativeLib>
<SDLNativeLib Condition=" '$(SDLNativeLib)' == '' And '$([MSBuild]::IsOSPlatform(Linux))' ">linux-$(SDLArch.ToLower())\libSDL3.so</SDLNativeLib>
<SDLNativeLib Condition=" '$(SDLNativeLib)' == '' And '$([MSBuild]::IsOSPlatform(OSX))' ">osx-$(SDLArch.ToLower())\libSDL3.dylib</SDLNativeLib>
<SDLArch Condition="'$(RuntimeIdentifier)' == ''">$(NETCoreSdkRuntimeIdentifier)</SDLArch>
<SDLArch Condition="'$(RuntimeIdentifier)' != ''">$(RuntimeIdentifier)</SDLArch>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)..\native\$(SDLNativeLib)">
<Content Include="$(MSBuildThisFileDirectory)..\native\$(SDLArch)\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

View File

@ -7,6 +7,9 @@ public class Program
public static unsafe void Main(string[] args)
{
NativeLibrary.SetDllImportResolver(typeof(SDL3).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3.framework/SDL3", assembly, path));
NativeLibrary.SetDllImportResolver(typeof(SDL3_image).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_image.framework/SDL3_image", assembly, path));
NativeLibrary.SetDllImportResolver(typeof(SDL3_ttf).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_ttf.framework/SDL3_ttf", assembly, path));
NativeLibrary.SetDllImportResolver(typeof(SDL3_mixer).Assembly, (_, assembly, path) => NativeLibrary.Load("@rpath/SDL3_mixer.framework/SDL3_mixer", assembly, path));
SDL3.SDL_RunApp(0, null, &main, IntPtr.Zero);
}

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-ios</TargetFramework>
@ -8,6 +8,11 @@
<ImplicitUsings>true</ImplicitUsings>
<SupportedOSPlatformVersion>13.0</SupportedOSPlatformVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
@ -16,6 +21,9 @@
<ItemGroup>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3.xcframework"/>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_image.xcframework"/>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_ttf.xcframework"/>
<NativeReference Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3_mixer.xcframework"/>
</ItemGroup>
</Project>

View File

@ -22,24 +22,20 @@ namespace SDL.Tests
SDL3.SDL_EnterAppMainCallbacks(0, (byte**)objectHandle.Handle, &AppInit, &AppIterate, &AppEvent, &AppQuit);
}
protected virtual int Init()
protected virtual SDL_AppResult Init()
{
SDL3.SDL_SetLogPriorities(SDL_LogPriority.SDL_LOG_PRIORITY_VERBOSE);
SDL3.SDL_SetLogOutputFunction(&LogOutput, IntPtr.Zero);
return CONTINUE;
return SDL_AppResult.SDL_APP_CONTINUE;
}
protected const int TERMINATE_ERROR = -1;
protected const int CONTINUE = 0;
protected const int TERMINATE_SUCCESS = 1;
protected virtual int Iterate()
protected virtual SDL_AppResult Iterate()
{
Thread.Sleep(10);
return CONTINUE;
return SDL_AppResult.SDL_APP_CONTINUE;
}
protected virtual int Event(SDL_Event e)
protected virtual SDL_AppResult Event(SDL_Event e)
{
switch (e.Type)
{
@ -47,24 +43,24 @@ namespace SDL.Tests
case SDL_EventType.SDL_EVENT_WINDOW_CLOSE_REQUESTED:
case SDL_EventType.SDL_EVENT_TERMINATING:
case SDL_EventType.SDL_EVENT_KEY_DOWN when e.key.key == SDL_Keycode.SDLK_ESCAPE:
return TERMINATE_SUCCESS;
return SDL_AppResult.SDL_APP_SUCCESS;
}
return CONTINUE;
return SDL_AppResult.SDL_APP_CONTINUE;
}
protected virtual void Quit()
protected virtual void Quit(SDL_AppResult result)
{
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static void LogOutput(IntPtr userdata, SDL_LogCategory category, SDL_LogPriority priority, byte* message)
private static void LogOutput(IntPtr userdata, int category, SDL_LogPriority priority, byte* message)
{
Console.WriteLine(SDL3.PtrToStringUTF8(message));
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static int AppInit(IntPtr* appState, int argc, byte** argv)
private static SDL_AppResult AppInit(IntPtr* appState, int argc, byte** argv)
{
IntPtr handle = (IntPtr)argv;
*appState = handle;
@ -73,35 +69,35 @@ namespace SDL.Tests
if (objectHandle.GetTarget(out var target))
return target.Init();
return TERMINATE_ERROR;
return SDL_AppResult.SDL_APP_FAILURE;
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static int AppIterate(IntPtr appState)
private static SDL_AppResult AppIterate(IntPtr appState)
{
var objectHandle = new ObjectHandle<MainCallbacksTest>(appState, true);
if (objectHandle.GetTarget(out var target))
return target.Iterate();
return TERMINATE_ERROR;
return SDL_AppResult.SDL_APP_FAILURE;
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static int AppEvent(IntPtr appState, SDL_Event* e)
private static SDL_AppResult AppEvent(IntPtr appState, SDL_Event* e)
{
var objectHandle = new ObjectHandle<MainCallbacksTest>(appState, true);
if (objectHandle.GetTarget(out var target))
return target.Event(*e);
return TERMINATE_ERROR;
return SDL_AppResult.SDL_APP_FAILURE;
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static void AppQuit(IntPtr appState)
private static void AppQuit(IntPtr appState, SDL_AppResult result)
{
using var objectHandle = new ObjectHandle<MainCallbacksTest>(appState, true);
if (objectHandle.GetTarget(out var target))
target.Quit();
target.Quit(result);
}
}
}

View File

@ -19,7 +19,7 @@ namespace SDL.Tests
public MyWindow()
{
if (SDL_InitSubSystem(init_flags) < 0)
if (!SDL_InitSubSystem(init_flags))
throw new InvalidOperationException($"failed to initialise SDL. Error: {SDL_GetError()}");
initSuccess = true;
@ -29,7 +29,7 @@ namespace SDL.Tests
public void Setup()
{
SDL_SetGamepadEventsEnabled(SDL_bool.SDL_TRUE);
SDL_SetGamepadEventsEnabled(true);
SDL_SetEventFilter(&nativeFilter, objectHandle.Handle);
if (OperatingSystem.IsWindows())
@ -37,7 +37,7 @@ namespace SDL.Tests
}
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
private static SDL_bool wndProc(IntPtr userdata, MSG* message)
private static SDLBool wndProc(IntPtr userdata, MSG* message)
{
var handle = new ObjectHandle<MyWindow>(userdata);
@ -46,23 +46,23 @@ namespace SDL.Tests
Console.WriteLine($"from {window}, message: {message->message}");
}
return SDL_TRUE; // sample use of definition from SDL3 class, not SDL_bool enum
return true;
}
// ReSharper disable once UseCollectionExpression
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
private static int nativeFilter(IntPtr userdata, SDL_Event* e)
private static SDLBool nativeFilter(IntPtr userdata, SDL_Event* e)
{
var handle = new ObjectHandle<MyWindow>(userdata);
if (handle.GetTarget(out var window))
return window.handleEventFromFilter(e);
return 1;
return true;
}
public Action<SDL_Event>? EventFilter;
private int handleEventFromFilter(SDL_Event* e)
private bool handleEventFromFilter(SDL_Event* e)
{
switch (e->Type)
{
@ -76,7 +76,7 @@ namespace SDL.Tests
break;
}
return 1;
return true;
}
private void handleKeyFromFilter(SDL_KeyboardEvent e)
@ -105,8 +105,8 @@ namespace SDL.Tests
switch (e.key.key)
{
case SDL_Keycode.SDLK_R:
bool old = SDL_GetRelativeMouseMode() == SDL_bool.SDL_TRUE;
SDL_SetRelativeMouseMode(old ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE);
bool old = SDL_GetWindowRelativeMouseMode(sdlWindowHandle);
SDL_SetWindowRelativeMouseMode(sdlWindowHandle, !old);
break;
case SDL_Keycode.SDLK_V:
@ -115,11 +115,11 @@ namespace SDL.Tests
break;
case SDL_Keycode.SDLK_F10:
SDL_SetWindowFullscreen(sdlWindowHandle, SDL_bool.SDL_FALSE);
SDL_SetWindowFullscreen(sdlWindowHandle, false);
break;
case SDL_Keycode.SDLK_F11:
SDL_SetWindowFullscreen(sdlWindowHandle, SDL_bool.SDL_TRUE);
SDL_SetWindowFullscreen(sdlWindowHandle, true);
break;
case SDL_Keycode.SDLK_J:
@ -158,6 +158,10 @@ namespace SDL.Tests
SDL_Keymod mod = e.key.mod;
Console.WriteLine(mod);
break;
case SDL_Keycode.SDLK_E:
Console.WriteLine(SDL_GetEventDescription(e));
break;
}
break;
@ -170,14 +174,8 @@ namespace SDL.Tests
Console.WriteLine($"gamepad added: {e.gdevice.which}");
break;
case SDL_EventType.SDL_EVENT_WINDOW_PEN_ENTER:
SDL_PenCapabilityInfo info;
var cap = SDL_GetPenCapabilities((SDL_PenID)e.window.data1, &info);
if (cap.HasFlag(SDL_PenCapabilityFlags.SDL_PEN_AXIS_XTILT_MASK))
Console.WriteLine("has pen xtilt axis");
Console.WriteLine(info.max_tilt);
case SDL_EventType.SDL_EVENT_PEN_PROXIMITY_IN:
Console.WriteLine($"pen proximity in: {e.pproximity.which}");
break;
}
}

View File

@ -3,6 +3,9 @@
using System.Diagnostics;
using System.Text;
using static SDL.SDL3_image;
using static SDL.SDL3_ttf;
using static SDL.SDL3_mixer;
using static SDL.SDL3;
namespace SDL.Tests
@ -14,6 +17,9 @@ namespace SDL.Tests
if (OperatingSystem.IsWindows())
Console.OutputEncoding = Encoding.UTF8;
Console.WriteLine($"false is represented as {SDL_OutOfMemory()} (expected 0x{SDLBool.FALSE_VALUE:x2})");
Console.WriteLine($"true is represented as {SDL_ClearError()} (expected 0x{SDLBool.TRUE_VALUE:x2})");
SDL_SetHint(SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, "null byte \0 in string"u8);
Debug.Assert(SDL_GetHint(SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4) == "null byte ");
@ -22,13 +28,16 @@ namespace SDL.Tests
using (var window = new MyWindow())
{
Console.WriteLine($"SDL revision: {SDL_GetRevision()}");
// Check if satellite libraries exist.
Console.WriteLine($"SDL revision: {SDL_GetRevision()}, IMG {IMG_Version()}, TTF {TTF_Version()}, Mixer {MIX_Version()}");
printDisplays();
window.Setup();
window.Create();
printWindows();
const SDL_Keymod state = SDL_Keymod.SDL_KMOD_CAPS | SDL_Keymod.SDL_KMOD_ALT;
SDL_SetModState(state);
Debug.Assert(SDL_GetModState() == state);
@ -61,5 +70,17 @@ namespace SDL.Tests
}
}
}
private static unsafe void printWindows()
{
using var windows = SDL_GetWindows();
if (windows == null)
return;
for (int i = 0; i < windows.Count; i++)
{
Console.WriteLine($"Window {i} title: {SDL_GetWindowTitle(windows[i])}");
}
}
}
}

View File

@ -10,6 +10,10 @@
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>
<PropertyGroup Label="NuGet">
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
<PackageReference Include="NUnit" Version="3.13.3"/>
@ -18,6 +22,16 @@
<ItemGroup>
<ProjectReference Include="..\SDL3-CS\SDL3-CS.csproj"/>
<ProjectReference Include="..\SDL3_image-CS\SDL3_image-CS.csproj"/>
<ProjectReference Include="..\SDL3_ttf-CS\SDL3_ttf-CS.csproj"/>
<ProjectReference Include="..\SDL3_mixer-CS\SDL3_mixer-CS.csproj"/>
</ItemGroup>
<ItemGroup>
<None Include="..\External\SDL_image\test\sample.png" Condition="Exists('..\External\SDL_image\test\sample.png')">
<Link>sample.png</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View File

@ -24,12 +24,12 @@ namespace SDL.Tests
[Test]
public unsafe void TestClipboardData()
{
int ret = SDL3.SDL_SetClipboardData(&dataCallback, &cleanupCallback, IntPtr.Zero, "test/one", "test/two");
Assert.That(ret, Is.EqualTo(0), SDL3.SDL_GetError);
var ret = SDL3.SDL_SetClipboardData(&dataCallback, &cleanupCallback, IntPtr.Zero, "test/one", "test/two");
Assert.That(ret, SDL3.SDL_GetError);
Assert.That(SDL3.SDL_HasClipboardData("test/one"), Is.EqualTo(SDL_bool.SDL_TRUE));
Assert.That(SDL3.SDL_HasClipboardData("test/two"), Is.EqualTo(SDL_bool.SDL_TRUE));
Assert.That(SDL3.SDL_HasClipboardData("test/three"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(SDL3.SDL_HasClipboardData("test/one"));
Assert.That(SDL3.SDL_HasClipboardData("test/two"));
Assert.That(!SDL3.SDL_HasClipboardData("test/three"));
UIntPtr size;
IntPtr data = SDL3.SDL_GetClipboardData("test/one", &size);
@ -46,13 +46,13 @@ namespace SDL.Tests
}
ret = SDL3.SDL_ClearClipboardData();
Assert.That(ret, Is.EqualTo(0), SDL3.SDL_GetError);
Assert.That(ret, SDL3.SDL_GetError);
Assert.That(cleanups, Is.EqualTo(1));
Assert.That(SDL3.SDL_HasClipboardData("test/one"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(SDL3.SDL_HasClipboardData("test/two"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(SDL3.SDL_HasClipboardData("test/three"), Is.EqualTo(SDL_bool.SDL_FALSE));
Assert.That(!SDL3.SDL_HasClipboardData("test/one"));
Assert.That(!SDL3.SDL_HasClipboardData("test/two"));
Assert.That(!SDL3.SDL_HasClipboardData("test/three"));
data = SDL3.SDL_GetClipboardData("test/two", &size);

View File

@ -0,0 +1,25 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
namespace SDL.Tests
{
[TestFixture]
public class TestError
{
[Test]
public void TestUnsupported()
{
Assert.That((bool)SDL3.SDL_Unsupported(), Is.False);
Assert.That(SDL3.SDL_GetError(), Is.EqualTo("That operation is not supported"));
}
[Test]
public void TestInvalidParam()
{
Assert.That((bool)SDL3.SDL_InvalidParamError("test"), Is.False);
Assert.That(SDL3.SDL_GetError(), Is.EqualTo("Parameter 'test' is invalid"));
}
}
}

View File

@ -0,0 +1,41 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3_image;
using static SDL.SDL3;
namespace SDL.Tests
{
public unsafe class TestImage
{
[Test]
public void TestBasic()
{
SDL_Init(0);
try
{
Assert.That(IMG_Version(), Is.EqualTo(SDL_IMAGE_VERSION));
Assume.That("sample.png", Does.Exist);
var image = IMG_Load("sample.png");
try
{
Assert.That(image != null, SDL_GetError);
Assert.That(image->w, Is.EqualTo(23));
Assert.That(image->h, Is.EqualTo(42));
}
finally
{
SDL_DestroySurface(image);
}
}
finally
{
SDL_Quit();
}
}
}
}

View File

@ -0,0 +1,44 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
namespace SDL.Tests
{
[TestFixture]
public class TestInterface
{
[Test]
public unsafe void TestIOInterface()
{
SDL_IOStreamInterface iface;
SDL3.SDL_INIT_INTERFACE(out iface);
Assert.That(iface.version, Is.EqualTo(sizeof(SDL_IOStreamInterface)));
Assert.That(iface.size == null);
Assert.That(iface.seek == null);
Assert.That(iface.read == null);
Assert.That(iface.write == null);
Assert.That(iface.flush == null);
Assert.That(iface.close == null);
}
[Test]
public unsafe void TestIOInterfaceManual()
{
SDL_IOStreamInterface iface = new SDL_IOStreamInterface
{
version = (uint)sizeof(SDL_IOStreamInterface),
};
Assert.That(iface.version, Is.EqualTo(sizeof(SDL_IOStreamInterface)));
Assert.That(iface.size == null);
Assert.That(iface.seek == null);
Assert.That(iface.read == null);
Assert.That(iface.write == null);
Assert.That(iface.flush == null);
Assert.That(iface.close == null);
}
}
}

View File

@ -0,0 +1,41 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3_mixer;
using static SDL.SDL3;
namespace SDL.Tests
{
[TestFixture]
public class TestMixer
{
[Test]
public unsafe void TestBasic()
{
SDL_Init(0);
bool init = MIX_Init();
try
{
Assert.That(init, Is.True, SDL_GetError);
Assert.That(MIX_Version(), Is.EqualTo(SDL_MIXER_VERSION));
Assume.That(MIX_GetNumAudioDecoders() > 0);
string? name = MIX_GetAudioDecoder(0);
Assert.That(name, Is.Not.Null, SDL_GetError);
Assume.That(@"C:\Windows\Media\Windows Logon.wav", Does.Exist);
var decoder = MIX_CreateAudioDecoder(@"C:\Windows\Media\Windows Logon.wav", 0);
Assert.That(decoder != null, SDL_GetError);
MIX_DestroyAudioDecoder(decoder);
}
finally
{
MIX_Quit();
SDL_Quit();
}
}
}
}

View File

@ -2,21 +2,22 @@
// See the LICENCE file in the repository root for full licence text.
using System.Drawing;
using NUnit.Framework;
using static SDL.SDL3;
namespace SDL.Tests
{
[Explicit("Uses an interactive window.")]
public unsafe class TestPositionalInputVisualisation : MainCallbacksTest
{
private SDL_Window* window;
private SDL_Renderer* renderer;
protected override int Init()
protected override SDL_AppResult Init()
{
// decouple pen, mouse and touch events
SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0");
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
SDL_SetHint(SDL_HINT_PEN_NOT_MOUSE, "2");
SDL_Init(SDL_InitFlags.SDL_INIT_VIDEO);
@ -48,7 +49,7 @@ namespace SDL.Tests
SDL_RenderFillRect(renderer, &r);
}
protected override int Iterate()
protected override SDL_AppResult Iterate()
{
const float gray = 0.1f;
SDL_SetRenderDrawColorFloat(renderer, gray, gray, gray, 1.0f);
@ -86,7 +87,7 @@ namespace SDL.Tests
return base.Iterate();
}
protected override int Event(SDL_Event e)
protected override SDL_AppResult Event(SDL_Event e)
{
SDL_ConvertEventToRenderCoordinates(renderer, &e);
@ -117,15 +118,15 @@ namespace SDL.Tests
switch (e.key.key)
{
case SDL_Keycode.SDLK_R:
SDL_SetRelativeMouseMode(SDL_GetRelativeMouseMode() == SDL_bool.SDL_TRUE ? SDL_bool.SDL_FALSE : SDL_bool.SDL_TRUE);
SDL_SetWindowRelativeMouseMode(window, !SDL_GetWindowRelativeMouseMode(window));
break;
case SDL_Keycode.SDLK_F:
SDL_SetWindowFullscreen(window, SDL_bool.SDL_TRUE);
SDL_SetWindowFullscreen(window, true);
break;
case SDL_Keycode.SDLK_W:
SDL_SetWindowFullscreen(window, SDL_bool.SDL_FALSE);
SDL_SetWindowFullscreen(window, false);
break;
}

View File

@ -0,0 +1,117 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Runtime.InteropServices;
using NUnit.Framework;
namespace SDL.Tests
{
[TestFixture]
public class TestSDLArray
{
private static unsafe T* CopyToSdl<T>(T[] array)
where T : unmanaged
{
UIntPtr size = (UIntPtr)(Marshal.SizeOf<T>() * array.Length);
IntPtr target = SDL3.SDL_malloc(size);
fixed (T* source = array)
{
SDL3.SDL_memcpy(target, (IntPtr)source, size);
}
return (T*)target;
}
private static unsafe T** CopyToSdl<T>(T*[] array)
where T : unmanaged
{
UIntPtr size = (UIntPtr)(sizeof(IntPtr) * array.Length);
IntPtr target = SDL3.SDL_malloc(size);
fixed (T** source = array)
{
SDL3.SDL_memcpy(target, (IntPtr)source, size);
}
return (T**)target;
}
[Test]
public unsafe void TestArrayEnumerator()
{
int[] values = [10, 20, 30, 40];
int* sdlMemory = CopyToSdl(values);
using var array = new SDLArray<int>(sdlMemory, values.Length);
int index = 0;
foreach (int i in array)
{
Assert.AreEqual(values[index++], i);
}
}
[Test]
public unsafe void TestConstOpaquePointerArrayEnumerator()
{
int a = 10, b = 20, c = 30, d = 40;
int*[] values = [&a, &b, &c, &d];
int** sdlMemory = null;
// Const pointer arrays are not freed automatically. Since the
// unit test owns the memory, this must be done at the end of the
// test.
try
{
sdlMemory = CopyToSdl(values);
var array = new SDLConstOpaquePointerArray<int>(sdlMemory, values.Length);
int index = 0;
foreach (int* i in array)
{
Assert.AreEqual((IntPtr)values[index++], (IntPtr)i);
}
}
finally
{
if (sdlMemory != null)
SDL3.SDL_free(sdlMemory);
}
}
[Test]
public unsafe void TestOpaquePointerArrayEnumerator()
{
int a = 10, b = 20, c = 30, d = 40;
int*[] values = [&a, &b, &c, &d];
int** sdlMemory = CopyToSdl(values);
using var array = new SDLOpaquePointerArray<int>(sdlMemory, values.Length);
int index = 0;
foreach (int* i in array)
{
Assert.AreEqual((IntPtr)values[index++], (IntPtr)i);
}
}
[Test]
public unsafe void TestPointerArrayEnumerator()
{
int a = 10, b = 20, c = 30, d = 40;
int*[] values = [&a, &b, &c, &d];
int** memory = CopyToSdl(values);
using var array = new SDLPointerArray<int>(memory, values.Length);
int index = 0;
foreach (int i in array)
{
Assert.AreEqual(*values[index++], i);
}
}
}
}

View File

@ -0,0 +1,60 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections;
using NUnit.Framework;
namespace SDL.Tests
{
[TestFixture]
public class TestSDLBool
{
[Test]
public void TestFalse()
{
Assert.That((bool)SDL3.SDL_OutOfMemory(), Is.EqualTo(false));
}
[Test]
public void TestTrue()
{
Assert.That((bool)SDL3.SDL_ClearError(), Is.EqualTo(true));
}
[Test]
public void TestStoreLoad([Values] bool value)
{
var props = SDL3.SDL_CreateProperties();
Assume.That(props, Is.Not.EqualTo(0));
bool ret = SDL3.SDL_SetBooleanProperty(props, "test", value);
Assume.That(ret, Is.EqualTo(true));
Assert.That((bool)SDL3.SDL_GetBooleanProperty(props, "test", !value), Is.EqualTo(value));
SDL3.SDL_DestroyProperties(props);
}
public static IEnumerable BoolCases()
{
SDLBool[] values = [new SDLBool(4), true, false];
foreach (var x in values)
{
foreach (var y in values)
{
yield return new object[] { x, y };
}
}
}
[TestCaseSource(typeof(TestSDLBool), nameof(BoolCases))]
public void TestEquals(SDLBool first, SDLBool second)
{
Assert.That((SDLBool)(bool)first, Is.EqualTo(first));
Assert.That(first.Equals(second), Is.EqualTo((bool)first == (bool)second));
Assert.That(first == second, Is.EqualTo((bool)first == (bool)second));
}
}
}

44
SDL3-CS.Tests/TestTTF.cs Normal file
View File

@ -0,0 +1,44 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3_ttf;
using static SDL.SDL3;
namespace SDL.Tests
{
public unsafe class TestTTF
{
[Test]
public void TestBasic()
{
SDL_Init(0);
bool init = TTF_Init();
try
{
Assert.That(init, Is.True, SDL_GetError);
Assert.That(TTF_Version(), Is.EqualTo(SDL_TTF_VERSION));
Assume.That(@"C:\Windows\Fonts\times.ttf", Does.Exist);
var font = TTF_OpenFont(@"C:\Windows\Fonts\times.ttf", 12f);
try
{
Assert.That(font != null, SDL_GetError);
Assert.That(TTF_GetFontFamilyName(font), Is.EqualTo("Times New Roman"));
}
finally
{
TTF_CloseFont(font);
}
}
finally
{
TTF_Quit();
SDL_Quit();
}
}
}
}

43
SDL3-CS.Tests/TestTray.cs Normal file
View File

@ -0,0 +1,43 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using static SDL.SDL3;
namespace SDL.Tests
{
[Explicit("Uses an interactive tray icon.")]
public unsafe class TestTray : TrayTest
{
private volatile bool running;
[Test]
public void TestBasic()
{
var checkbox = SDL_InsertTrayEntryAt(RootMenu, -1, "Check box?", SDL_TrayEntryFlags.SDL_TRAYENTRY_CHECKBOX);
Assert.That(checkbox != null, SDL_GetError);
SetCallback(checkbox, () => Console.WriteLine("Checkbox was toggled."));
var separator = SDL_InsertTrayEntryAt(RootMenu, -1, (byte*)null, 0);
Assert.That(separator != null, SDL_GetError);
var exit = SDL_InsertTrayEntryAt(RootMenu, -1, "Exit tray", SDL_TrayEntryFlags.SDL_TRAYENTRY_BUTTON);
Assert.That(exit != null, SDL_GetError);
SetCallback(exit, () => running = false);
var entries = SDL_GetTrayEntries(RootMenu);
Assert.That(entries, Is.Not.Null, SDL_GetError);
Assert.That(entries!.Count, Is.EqualTo(3));
for (int i = 0; i < entries.Count; i++)
Console.WriteLine($"{i}. {SDL_GetTrayEntryLabel(entries[i]) ?? "<null>"}");
running = true;
while (running)
{
SDL_PumpEvents();
}
}
}
}

52
SDL3-CS.Tests/TrayTest.cs Normal file
View File

@ -0,0 +1,52 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using NUnit.Framework;
namespace SDL.Tests
{
[TestFixture]
public abstract unsafe class TrayTest
{
private SDL_Tray* tray;
protected SDL_TrayMenu* RootMenu { get; private set; }
[SetUp]
public void SetUp()
{
Assert.That(SDL3.SDL_Init(SDL_InitFlags.SDL_INIT_VIDEO), SDL3.SDL_GetError);
tray = SDL3.SDL_CreateTray(null, "Test tray");
Assert.That(tray != null, SDL3.SDL_GetError);
RootMenu = SDL3.SDL_CreateTrayMenu(tray);
Assert.That(RootMenu != null, SDL3.SDL_GetError);
}
protected static void SetCallback(SDL_TrayEntry* entry, Action callback)
{
var objectHandle = new ObjectHandle<Action>(callback, GCHandleType.Normal);
SDL3.SDL_SetTrayEntryCallback(entry, &nativeOnSelect, objectHandle.Handle); // this is leaking object handles, fine for tests
}
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvCdecl)])]
private static void nativeOnSelect(IntPtr userdata, SDL_TrayEntry* entry)
{
var objectHandle = new ObjectHandle<Action>(userdata, true);
if (objectHandle.GetTarget(out var action))
action();
else
Assert.Fail("Accessing disposed object handle.");
}
[TearDown]
public void TearDown()
{
if (tray != null)
SDL3.SDL_DestroyTray(tray);
SDL3.SDL_Quit();
}
}
}

View File

@ -2,10 +2,13 @@
"solution": {
"path": "SDL3-CS.sln",
"projects": [
"SDL3-CS\\SDL3-CS.csproj",
"SDL3-CS.SourceGeneration\\SDL3-CS.SourceGeneration.csproj",
"SDL3-CS.Tests.iOS\\SDL3-CS.Tests.iOS.csproj",
"SDL3-CS.Tests\\SDL3-CS.Tests.csproj",
"SDL3-CS.Tests.iOS\\SDL3-CS.Tests.iOS.csproj"
"SDL3-CS\\SDL3-CS.csproj",
"SDL3_image-CS\\SDL3_image-CS.csproj",
"SDL3_mixer-CS\\SDL3_mixer-CS.csproj",
"SDL3_ttf-CS\\SDL3_ttf-CS.csproj"
]
}
}
}

View File

@ -19,14 +19,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3-CS.SourceGeneration",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3-CS.Tests", "SDL3-CS.Tests\SDL3-CS.Tests.csproj", "{CF980481-8227-4BED-970E-6433C83F64CB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3-CS.Android", "SDL3-CS.Android\SDL3-CS.Android.csproj", "{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3-CS.Tests.Android", "SDL3-CS.Tests.Android\SDL3-CS.Tests.Android.csproj", "{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3-CS.Tests.iOS", "SDL3-CS.Tests.iOS\SDL3-CS.Tests.iOS.csproj", "{CCDD11EE-D552-4925-8B68-351AC9317589}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3-CS.Tests.Desktop", "SDL3-CS.Tests.Desktop\SDL3-CS.Tests.Desktop.csproj", "{7E8D719A-5B69-43B7-A9D5-385B6FE7F411}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3_ttf-CS", "SDL3_ttf-CS\SDL3_ttf-CS.csproj", "{8E37EB82-ACC4-4656-A6E5-DB298AE72066}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDL3_image-CS", "SDL3_image-CS\SDL3_image-CS.csproj", "{A0D6FC5F-BA26-4298-ABF0-234D2481E323}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDL3_mixer-CS", "SDL3_mixer-CS\SDL3_mixer-CS.csproj", "{421748C4-B51F-4B00-9637-566DBFD96E02}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -45,10 +49,6 @@ Global
{CF980481-8227-4BED-970E-6433C83F64CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF980481-8227-4BED-970E-6433C83F64CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF980481-8227-4BED-970E-6433C83F64CB}.Release|Any CPU.Build.0 = Release|Any CPU
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA28F49C-D0BE-47D6-9E82-7A0B8C380B8B}.Release|Any CPU.Build.0 = Release|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8469DA5-E437-4287-9E2A-8B8F4DC21C1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -61,6 +61,18 @@ Global
{7E8D719A-5B69-43B7-A9D5-385B6FE7F411}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E8D719A-5B69-43B7-A9D5-385B6FE7F411}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E8D719A-5B69-43B7-A9D5-385B6FE7F411}.Release|Any CPU.Build.0 = Release|Any CPU
{8E37EB82-ACC4-4656-A6E5-DB298AE72066}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E37EB82-ACC4-4656-A6E5-DB298AE72066}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E37EB82-ACC4-4656-A6E5-DB298AE72066}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E37EB82-ACC4-4656-A6E5-DB298AE72066}.Release|Any CPU.Build.0 = Release|Any CPU
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0D6FC5F-BA26-4298-ABF0-234D2481E323}.Release|Any CPU.Build.0 = Release|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{421748C4-B51F-4B00-9637-566DBFD96E02}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -785,5 +785,6 @@ See the LICENCE file in the repository root for full licence text.&#xD;
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Binary file not shown.

View File

@ -0,0 +1,29 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
// https://github.com/JetBrains/JetBrains.Annotations/blob/988289d09aad925b22a5321c075a735cb9597e59/src/Annotations.cs
namespace JetBrains.Annotations
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Parameter)]
internal sealed class MustDisposeResourceAttribute : Attribute
{
public MustDisposeResourceAttribute()
{
Value = true;
}
public MustDisposeResourceAttribute(bool value)
{
Value = value;
}
/// <summary>
/// When set to <c>false</c>, disposing of the resource is not obligatory.
/// The main use-case for explicit <c>[MustDisposeResource(false)]</c> annotation
/// is to loosen the annotation for inheritors.
/// </summary>
public bool Value { get; }
}
}

View File

@ -4,3 +4,8 @@
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("SDL3-CS.Tests")]
// Allow access to internal CodeGen members (e.g. NativeTypeNameAttribute, etc.) for SDL sister projects:
[assembly: InternalsVisibleTo("SDL3_ttf-CS")]
[assembly: InternalsVisibleTo("SDL3_image-CS")]
[assembly: InternalsVisibleTo("SDL3_mixer-CS")]

View File

@ -1,52 +0,0 @@
diff --git a/include/SDL3/SDL.h b/include/SDL3/SDL.h
index 6cda579f7..bc2952a4e 100644
--- a/include/SDL3/SDL.h
+++ b/include/SDL3/SDL.h
@@ -28,6 +28,8 @@
#ifndef SDL_h_
#define SDL_h_
+#error Don't build with enum type changes
+
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_assert.h>
#include <SDL3/SDL_atomic.h>
diff --git a/include/SDL3/SDL_log.h b/include/SDL3/SDL_log.h
index 3ded311ff..42760135f 100644
--- a/include/SDL3/SDL_log.h
+++ b/include/SDL3/SDL_log.h
@@ -372,7 +372,7 @@ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
*
* \since This datatype is available since SDL 3.0.0.
*/
-typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
+typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, SDL_LogCategory category, SDL_LogPriority priority, const char *message);
/**
* Get the current log output function.
diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h
index 00a54a139..847b50ecb 100644
--- a/include/SDL3/SDL_stdinc.h
+++ b/include/SDL3/SDL_stdinc.h
@@ -146,7 +146,7 @@ void *alloca(size_t);
*
* \sa SDL_bool
*/
-#define SDL_FALSE 0
+#define SDL_FALSE (SDL_bool)0
/**
* A boolean true.
@@ -155,7 +155,7 @@ void *alloca(size_t);
*
* \sa SDL_bool
*/
-#define SDL_TRUE 1
+#define SDL_TRUE (SDL_bool)1
/**
* A boolean type: true or false.
base-commit: 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82
--
2.40.0.windows.1

View File

@ -1,11 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>SDL</RootNamespace>
<TargetFrameworks Condition=" '$(CI_DONT_TARGET_ANDROID)' != '1' ">net8.0;net8.0-android</TargetFrameworks>
<TargetFramework Condition=" '$(CI_DONT_TARGET_ANDROID)' == '1' ">net8.0</TargetFramework>
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn);SYSLIB1054;CA1401</NoWarn>
<DefineConstants>$(DefineConstants);JETBRAINS_ANNOTATIONS</DefineConstants>
</PropertyGroup>
<PropertyGroup Label="NuGet">
@ -14,18 +17,30 @@
<Copyright>Copyright (c) 2024 ppy Pty Ltd</Copyright>
<Product>ppy.SDL3-CS</Product>
<PackageId>ppy.SDL3-CS</PackageId>
<PackageTags>SDL;SDL3;SDL3-CS</PackageTags>
<PackageReleaseNotes>Automated release.</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/ppy/SDL3-CS</PackageProjectUrl>
<PackageReadmeFile>README_nuget.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/ppy/SDL3-CS</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\README_nuget.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SDL3-CS.SourceGeneration\SDL3-CS.SourceGeneration.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="libclang" Version="17.0.4">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="libClangSharp" Version="17.0.4">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
@ -65,8 +80,8 @@
<PackagePath>runtimes/linux-arm/native</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\ios\**\*">
<PackagePath>runtimes/ios/native</PackagePath>
<None Include="$(MSBuildThisFileDirectory)..\native\ios\SDL3.xcframework\**\*">
<PackagePath>runtimes/ios/native/SDL3.xcframework</PackagePath>
<Pack>true</Pack>
</None>
<None Include="$(MSBuildThisFileDirectory)..\native\android\armeabi-v7a\libSDL3.so">
@ -85,6 +100,7 @@
<PackagePath>runtimes/android-x86/native</PackagePath>
<Pack>true</Pack>
</None>
<EmbeddedJar Include="Jars\SDL3AndroidBridge.jar"/>
</ItemGroup>
</Project>

View File

@ -0,0 +1,119 @@
/*
<auto-generated/>
C# bindings for Simple DirectMedia Layer.
Original copyright notice of input files:
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.
*/
using System;
using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_AsyncIO
{
}
public enum SDL_AsyncIOTaskType
{
SDL_ASYNCIO_TASK_READ,
SDL_ASYNCIO_TASK_WRITE,
SDL_ASYNCIO_TASK_CLOSE,
}
public enum SDL_AsyncIOResult
{
SDL_ASYNCIO_COMPLETE,
SDL_ASYNCIO_FAILURE,
SDL_ASYNCIO_CANCELED,
}
public unsafe partial struct SDL_AsyncIOOutcome
{
public SDL_AsyncIO* asyncio;
public SDL_AsyncIOTaskType type;
public SDL_AsyncIOResult result;
[NativeTypeName("void*")]
public IntPtr buffer;
[NativeTypeName("Uint64")]
public ulong offset;
[NativeTypeName("Uint64")]
public ulong bytes_requested;
[NativeTypeName("Uint64")]
public ulong bytes_transferred;
[NativeTypeName("void*")]
public IntPtr userdata;
}
public partial struct SDL_AsyncIOQueue
{
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AsyncIO* SDL_AsyncIOFromFile([NativeTypeName("const char *")] byte* file, [NativeTypeName("const char *")] byte* mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
public static extern long SDL_GetAsyncIOSize(SDL_AsyncIO* asyncio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadAsyncIO(SDL_AsyncIO* asyncio, [NativeTypeName("void*")] IntPtr ptr, [NativeTypeName("Uint64")] ulong offset, [NativeTypeName("Uint64")] ulong size, SDL_AsyncIOQueue* queue, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteAsyncIO(SDL_AsyncIO* asyncio, [NativeTypeName("void*")] IntPtr ptr, [NativeTypeName("Uint64")] ulong offset, [NativeTypeName("Uint64")] ulong size, SDL_AsyncIOQueue* queue, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CloseAsyncIO(SDL_AsyncIO* asyncio, [NativeTypeName("bool")] SDLBool flush, SDL_AsyncIOQueue* queue, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_AsyncIOQueue* SDL_CreateAsyncIOQueue();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyAsyncIOQueue(SDL_AsyncIOQueue* queue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetAsyncIOResult(SDL_AsyncIOQueue* queue, SDL_AsyncIOOutcome* outcome);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitAsyncIOResult(SDL_AsyncIOQueue* queue, SDL_AsyncIOOutcome* outcome, [NativeTypeName("Sint32")] int timeoutMS);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SignalAsyncIOQueue(SDL_AsyncIOQueue* queue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LoadFileAsync([NativeTypeName("const char *")] byte* file, SDL_AsyncIOQueue* queue, [NativeTypeName("void*")] IntPtr userdata);
}
}

View File

@ -33,10 +33,17 @@ namespace SDL
public int value;
}
public partial struct SDL_AtomicU32
{
[NativeTypeName("Uint32")]
public uint value;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TryLockSpinlock([NativeTypeName("SDL_SpinLock *")] int* @lock);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockSpinlock([NativeTypeName("SDL_SpinLock *")] int* @lock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_LockSpinlock([NativeTypeName("SDL_SpinLock *")] int* @lock);
@ -51,26 +58,44 @@ namespace SDL
public static extern void SDL_MemoryBarrierAcquireFunction();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AtomicCompareAndSwap(SDL_AtomicInt* a, int oldval, int newval);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt* a, int oldval, int newval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AtomicSet(SDL_AtomicInt* a, int v);
public static extern int SDL_SetAtomicInt(SDL_AtomicInt* a, int v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AtomicGet(SDL_AtomicInt* a);
public static extern int SDL_GetAtomicInt(SDL_AtomicInt* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AtomicAdd(SDL_AtomicInt* a, int v);
public static extern int SDL_AddAtomicInt(SDL_AtomicInt* a, int v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AtomicCompareAndSwapPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr oldval, [NativeTypeName("void*")] IntPtr newval);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32* a, [NativeTypeName("Uint32")] uint oldval, [NativeTypeName("Uint32")] uint newval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_SetAtomicU32(SDL_AtomicU32* a, [NativeTypeName("Uint32")] uint v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetAtomicU32(SDL_AtomicU32* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_AddAtomicU32(SDL_AtomicU32* a, int v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CompareAndSwapAtomicPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr oldval, [NativeTypeName("void*")] IntPtr newval);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_AtomicSetPtr([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v);
public static extern IntPtr SDL_SetAtomicPointer([NativeTypeName("void **")] IntPtr* a, [NativeTypeName("void*")] IntPtr v);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_AtomicGetPtr([NativeTypeName("void **")] IntPtr* a);
public static extern IntPtr SDL_GetAtomicPointer([NativeTypeName("void **")] IntPtr* a);
}
}

View File

@ -28,9 +28,9 @@ using System.Runtime.InteropServices;
namespace SDL
{
[NativeTypeName("int")]
public enum SDL_AudioFormat : uint
{
SDL_AUDIO_UNKNOWN = 0x0000U,
SDL_AUDIO_U8 = 0x0008U,
SDL_AUDIO_S8 = 0x8008U,
SDL_AUDIO_S16LE = 0x8010U,
@ -78,7 +78,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetAudioDeviceName(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec* spec, int* sample_frames);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int* SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int* count);
@ -87,31 +88,45 @@ namespace SDL
public static extern SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PauseAudioDevice(SDL_AudioDeviceID dev);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsAudioDevicePhysical(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ResumeAudioDevice(SDL_AudioDeviceID dev);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsAudioDevicePlayback(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID dev);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PauseAudioDevice(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResumeAudioDevice(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AudioDevicePaused(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseAudioDevice(SDL_AudioDeviceID devid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream** streams, int num_streams);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BindAudioStreams(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioStream *const *")] SDL_AudioStream** streams, int num_streams);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnbindAudioStreams(SDL_AudioStream** streams, int num_streams);
public static extern void SDL_UnbindAudioStreams([NativeTypeName("SDL_AudioStream *const *")] SDL_AudioStream** streams, int num_streams);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnbindAudioStream(SDL_AudioStream* stream);
@ -126,22 +141,26 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamFormat(SDL_AudioStream* stream, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamFormat(SDL_AudioStream* stream, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetAudioStreamGain(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamGain(SDL_AudioStream* stream, float gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int* SDL_GetAudioStreamInputChannelMap(SDL_AudioStream* stream, int* count);
@ -150,13 +169,24 @@ namespace SDL
public static extern int* SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream* stream, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream* stream, [NativeTypeName("const int *")] int* chmap, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PutAudioStreamDataNoCopy(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len, [NativeTypeName("SDL_AudioStreamDataCompleteCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PutAudioStreamPlanarData(SDL_AudioStream* stream, [NativeTypeName("const void *const *")] IntPtr* channel_buffers, int num_channels, int num_samples);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("void*")] IntPtr buf, int len);
@ -168,28 +198,40 @@ namespace SDL
public static extern int SDL_GetAudioStreamQueued(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FlushAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlushAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PauseAudioStreamDevice(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PauseAudioStreamDevice(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResumeAudioStreamDevice(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AudioStreamDevicePaused(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_UnlockAudioStream(SDL_AudioStream* stream);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UnlockAudioStream(SDL_AudioStream* stream);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyAudioStream(SDL_AudioStream* stream);
@ -198,19 +240,28 @@ namespace SDL
public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LoadWAV_IO(SDL_IOStream* src, SDL_bool closeio, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LoadWAV_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LoadWAV([NativeTypeName("const char *")] byte* path, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LoadWAV([NativeTypeName("const char *")] byte* path, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, SDL_AudioFormat format, [NativeTypeName("Uint32")] uint len, float volume);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_MixAudio([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, SDL_AudioFormat format, [NativeTypeName("Uint32")] uint len, float volume);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertAudioSamples([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const Uint8 *")] byte* src_data, int src_len, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec, [NativeTypeName("Uint8 **")] byte** dst_data, int* dst_len);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ConvertAudioSamples([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const Uint8 *")] byte* src_data, int src_len, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec, [NativeTypeName("Uint8 **")] byte** dst_data, int* dst_len);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAudioFormatName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetAudioFormatName(SDL_AudioFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSilenceValueForFormat(SDL_AudioFormat format);
@ -232,5 +283,8 @@ namespace SDL
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFEu)")]
public const SDL_AudioDeviceID SDL_AUDIO_DEVICE_DEFAULT_RECORDING = ((SDL_AudioDeviceID)(0xFFFFFFFEU));
[NativeTypeName("#define SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN \"SDL.audiostream.auto_cleanup\"")]
public static ReadOnlySpan<byte> SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN => "SDL.audiostream.auto_cleanup"u8;
}
}

View File

@ -53,6 +53,13 @@ namespace SDL
SDL_CAMERA_POSITION_BACK_FACING,
}
public enum SDL_CameraPermissionState
{
SDL_CAMERA_PERMISSION_STATE_DENIED = -1,
SDL_CAMERA_PERMISSION_STATE_PENDING,
SDL_CAMERA_PERMISSION_STATE_APPROVED,
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -70,7 +77,7 @@ namespace SDL
public static extern SDL_CameraID* SDL_GetCameras(int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraSpec** SDL_GetCameraSupportedFormats(SDL_CameraID devid, int* count);
public static extern SDL_CameraSpec** SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCameraName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -83,7 +90,7 @@ namespace SDL
public static extern SDL_Camera* SDL_OpenCamera(SDL_CameraID instance_id, [NativeTypeName("const SDL_CameraSpec *")] SDL_CameraSpec* spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCameraPermissionState(SDL_Camera* camera);
public static extern SDL_CameraPermissionState SDL_GetCameraPermissionState(SDL_Camera* camera);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_CameraID SDL_GetCameraID(SDL_Camera* camera);
@ -92,13 +99,14 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetCameraProperties(SDL_Camera* camera);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCameraFormat(SDL_Camera* camera, SDL_CameraSpec* spec);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetCameraFormat(SDL_Camera* camera, SDL_CameraSpec* spec);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_AcquireCameraFrame(SDL_Camera* camera, [NativeTypeName("Uint64 *")] ulong* timestampNS);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReleaseCameraFrame(SDL_Camera* camera, SDL_Surface* frame);
public static extern void SDL_ReleaseCameraFrame(SDL_Camera* camera, SDL_Surface* frame);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseCamera(SDL_Camera* camera);

View File

@ -31,36 +31,47 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetClipboardText([NativeTypeName("const char *")] byte* text);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetClipboardText([NativeTypeName("const char *")] byte* text);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetClipboardText", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetClipboardText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasClipboardText();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasClipboardText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPrimarySelectionText([NativeTypeName("const char *")] byte* text);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPrimarySelectionText([NativeTypeName("const char *")] byte* text);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPrimarySelectionText", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetPrimarySelectionText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasPrimarySelectionText();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasPrimarySelectionText();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetClipboardData([NativeTypeName("SDL_ClipboardDataCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, nuint*, IntPtr> callback, [NativeTypeName("SDL_ClipboardCleanupCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata, [NativeTypeName("const char **")] byte** mime_types, [NativeTypeName("size_t")] nuint num_mime_types);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetClipboardData([NativeTypeName("SDL_ClipboardDataCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, nuint*, IntPtr> callback, [NativeTypeName("SDL_ClipboardCleanupCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata, [NativeTypeName("const char **")] byte** mime_types, [NativeTypeName("size_t")] nuint num_mime_types);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearClipboardData();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearClipboardData();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_GetClipboardData([NativeTypeName("const char *")] byte* mime_type, [NativeTypeName("size_t *")] nuint* size);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasClipboardData([NativeTypeName("const char *")] byte* mime_type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasClipboardData([NativeTypeName("const char *")] byte* mime_type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("char **")]
public static extern byte** SDL_GetClipboardMimeTypes([NativeTypeName("size_t *")] nuint* num_mime_types);
}
}

View File

@ -30,52 +30,66 @@ namespace SDL
public static partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCPUCount();
public static extern int SDL_GetNumLogicalCPUCores();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCPUCacheLineSize();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAltiVec();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAltiVec();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasMMX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasMMX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE2();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE2();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE3();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE3();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE41();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE41();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasSSE42();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasSSE42();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAVX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAVX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAVX2();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAVX2();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasAVX512F();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasAVX512F();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasARMSIMD();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasARMSIMD();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasNEON();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasNEON();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasLSX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasLSX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasLASX();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasLASX();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSystemRAM();
@ -84,6 +98,9 @@ namespace SDL
[return: NativeTypeName("size_t")]
public static extern nuint SDL_GetSIMDAlignment();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSystemPageSize();
[NativeTypeName("#define SDL_CACHELINE_SIZE 128")]
public const int SDL_CACHELINE_SIZE = 128;
}

View File

@ -37,15 +37,49 @@ namespace SDL
public byte* pattern;
}
public enum SDL_FileDialogType
{
SDL_FILEDIALOG_OPENFILE,
SDL_FILEDIALOG_SAVEFILE,
SDL_FILEDIALOG_OPENFOLDER,
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowOpenFileDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const SDL_DialogFileFilter *")] SDL_DialogFileFilter* filters, int nfilters, [NativeTypeName("const char *")] byte* default_location, SDL_bool allow_many);
public static extern void SDL_ShowOpenFileDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const SDL_DialogFileFilter *")] SDL_DialogFileFilter* filters, int nfilters, [NativeTypeName("const char *")] byte* default_location, [NativeTypeName("bool")] SDLBool allow_many);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowSaveFileDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const SDL_DialogFileFilter *")] SDL_DialogFileFilter* filters, int nfilters, [NativeTypeName("const char *")] byte* default_location);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowOpenFolderDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const char *")] byte* default_location, SDL_bool allow_many);
public static extern void SDL_ShowOpenFolderDialog([NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_Window* window, [NativeTypeName("const char *")] byte* default_location, [NativeTypeName("bool")] SDLBool allow_many);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ShowFileDialogWithProperties(SDL_FileDialogType type, [NativeTypeName("SDL_DialogFileCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte**, int, void> callback, [NativeTypeName("void*")] IntPtr userdata, SDL_PropertiesID props);
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_FILTERS_POINTER \"SDL.filedialog.filters\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_FILTERS_POINTER => "SDL.filedialog.filters"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER \"SDL.filedialog.nfilters\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_NFILTERS_NUMBER => "SDL.filedialog.nfilters"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_WINDOW_POINTER \"SDL.filedialog.window\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_WINDOW_POINTER => "SDL.filedialog.window"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_LOCATION_STRING \"SDL.filedialog.location\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_LOCATION_STRING => "SDL.filedialog.location"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_MANY_BOOLEAN \"SDL.filedialog.many\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_MANY_BOOLEAN => "SDL.filedialog.many"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_TITLE_STRING \"SDL.filedialog.title\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_TITLE_STRING => "SDL.filedialog.title"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_ACCEPT_STRING \"SDL.filedialog.accept\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_ACCEPT_STRING => "SDL.filedialog.accept"u8;
[NativeTypeName("#define SDL_PROP_FILE_DIALOG_CANCEL_STRING \"SDL.filedialog.cancel\"")]
public static ReadOnlySpan<byte> SDL_PROP_FILE_DIALOG_CANCEL_STRING => "SDL.filedialog.cancel"u8;
}
}

View File

@ -30,16 +30,23 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetError([NativeTypeName("const char *")] byte* fmt, __arglist);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetError([NativeTypeName("const char *")] byte* fmt, __arglist);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_OutOfMemory();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetErrorV([NativeTypeName("const char *")] byte* fmt, [NativeTypeName("va_list")] byte* ap);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_OutOfMemory();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetError", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetError();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearError();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearError();
}
}

View File

@ -48,8 +48,9 @@ namespace SDL
SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED,
SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED,
SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
SDL_EVENT_DISPLAY_USABLE_BOUNDS_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_USABLE_BOUNDS_CHANGED,
SDL_EVENT_WINDOW_SHOWN = 0x202,
SDL_EVENT_WINDOW_HIDDEN,
SDL_EVENT_WINDOW_EXPOSED,
@ -74,8 +75,6 @@ namespace SDL
SDL_EVENT_WINDOW_ENTER_FULLSCREEN,
SDL_EVENT_WINDOW_LEAVE_FULLSCREEN,
SDL_EVENT_WINDOW_DESTROYED,
SDL_EVENT_WINDOW_PEN_ENTER,
SDL_EVENT_WINDOW_PEN_LEAVE,
SDL_EVENT_WINDOW_HDR_STATE_CHANGED,
SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN,
SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED,
@ -87,6 +86,8 @@ namespace SDL
SDL_EVENT_KEYBOARD_ADDED,
SDL_EVENT_KEYBOARD_REMOVED,
SDL_EVENT_TEXT_EDITING_CANDIDATES,
SDL_EVENT_SCREEN_KEYBOARD_SHOWN,
SDL_EVENT_SCREEN_KEYBOARD_HIDDEN,
SDL_EVENT_MOUSE_MOTION = 0x400,
SDL_EVENT_MOUSE_BUTTON_DOWN,
SDL_EVENT_MOUSE_BUTTON_UP,
@ -117,6 +118,10 @@ namespace SDL
SDL_EVENT_FINGER_DOWN = 0x700,
SDL_EVENT_FINGER_UP,
SDL_EVENT_FINGER_MOTION,
SDL_EVENT_FINGER_CANCELED,
SDL_EVENT_PINCH_BEGIN = 0x710,
SDL_EVENT_PINCH_UPDATE,
SDL_EVENT_PINCH_END,
SDL_EVENT_CLIPBOARD_UPDATE = 0x900,
SDL_EVENT_DROP_FILE = 0x1000,
SDL_EVENT_DROP_TEXT,
@ -127,17 +132,25 @@ namespace SDL
SDL_EVENT_AUDIO_DEVICE_REMOVED,
SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED,
SDL_EVENT_SENSOR_UPDATE = 0x1200,
SDL_EVENT_PEN_DOWN = 0x1300,
SDL_EVENT_PEN_PROXIMITY_IN = 0x1300,
SDL_EVENT_PEN_PROXIMITY_OUT,
SDL_EVENT_PEN_DOWN,
SDL_EVENT_PEN_UP,
SDL_EVENT_PEN_MOTION,
SDL_EVENT_PEN_BUTTON_DOWN,
SDL_EVENT_PEN_BUTTON_UP,
SDL_EVENT_PEN_MOTION,
SDL_EVENT_PEN_AXIS,
SDL_EVENT_CAMERA_DEVICE_ADDED = 0x1400,
SDL_EVENT_CAMERA_DEVICE_REMOVED,
SDL_EVENT_CAMERA_DEVICE_APPROVED,
SDL_EVENT_CAMERA_DEVICE_DENIED,
SDL_EVENT_RENDER_TARGETS_RESET = 0x2000,
SDL_EVENT_RENDER_DEVICE_RESET,
SDL_EVENT_RENDER_DEVICE_LOST,
SDL_EVENT_PRIVATE0 = 0x4000,
SDL_EVENT_PRIVATE1,
SDL_EVENT_PRIVATE2,
SDL_EVENT_PRIVATE3,
SDL_EVENT_POLL_SENTINEL = 0x7F00,
SDL_EVENT_USER = 0x8000,
SDL_EVENT_LAST = 0xFFFF,
@ -230,11 +243,11 @@ namespace SDL
[NativeTypeName("Uint16")]
public ushort raw;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte repeat;
[NativeTypeName("bool")]
public SDLBool repeat;
}
public unsafe partial struct SDL_TextEditingEvent
@ -280,7 +293,17 @@ namespace SDL
[NativeTypeName("Sint32")]
public int selected_candidate;
public SDL_bool horizontal;
[NativeTypeName("bool")]
public SDLBool horizontal;
[NativeTypeName("Uint8")]
public byte padding1;
[NativeTypeName("Uint8")]
public byte padding2;
[NativeTypeName("Uint8")]
public byte padding3;
}
public unsafe partial struct SDL_TextInputEvent
@ -354,8 +377,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte clicks;
@ -391,6 +414,12 @@ namespace SDL
public float mouse_x;
public float mouse_y;
[NativeTypeName("Sint32")]
public int integer_x;
[NativeTypeName("Sint32")]
public int integer_y;
}
public partial struct SDL_JoyAxisEvent
@ -495,8 +524,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte padding1;
@ -581,8 +610,8 @@ namespace SDL
[NativeTypeName("Uint8")]
public byte button;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("bool")]
public SDLBool down;
[NativeTypeName("Uint8")]
public byte padding1;
@ -669,8 +698,8 @@ namespace SDL
public SDL_AudioDeviceID which;
[NativeTypeName("Uint8")]
public byte recording;
[NativeTypeName("bool")]
public SDLBool recording;
[NativeTypeName("Uint8")]
public byte padding1;
@ -695,6 +724,19 @@ namespace SDL
public SDL_CameraID which;
}
public partial struct SDL_RenderEvent
{
public SDL_EventType type;
[NativeTypeName("Uint32")]
public uint reserved;
[NativeTypeName("Uint64")]
public ulong timestamp;
public SDL_WindowID windowID;
}
public partial struct SDL_TouchFingerEvent
{
public SDL_EventType type;
@ -722,7 +764,22 @@ namespace SDL
public SDL_WindowID windowID;
}
public partial struct SDL_PenTipEvent
public partial struct SDL_PinchFingerEvent
{
public SDL_EventType type;
[NativeTypeName("Uint32")]
public uint reserved;
[NativeTypeName("Uint64")]
public ulong timestamp;
public float scale;
public SDL_WindowID windowID;
}
public partial struct SDL_PenProximityEvent
{
public SDL_EventType type;
@ -735,28 +792,6 @@ namespace SDL
public SDL_WindowID windowID;
public SDL_PenID which;
[NativeTypeName("Uint8")]
public byte tip;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("Uint16")]
public ushort pen_state;
public float x;
public float y;
[NativeTypeName("float[6]")]
public _axes_e__FixedBuffer axes;
[InlineArray(6)]
public partial struct _axes_e__FixedBuffer
{
public float e0;
}
}
public partial struct SDL_PenMotionEvent
@ -773,27 +808,38 @@ namespace SDL
public SDL_PenID which;
[NativeTypeName("Uint8")]
public byte padding1;
public SDL_PenInputFlags pen_state;
[NativeTypeName("Uint8")]
public byte padding2;
public float x;
[NativeTypeName("Uint16")]
public ushort pen_state;
public float y;
}
public partial struct SDL_PenTouchEvent
{
public SDL_EventType type;
[NativeTypeName("Uint32")]
public uint reserved;
[NativeTypeName("Uint64")]
public ulong timestamp;
public SDL_WindowID windowID;
public SDL_PenID which;
public SDL_PenInputFlags pen_state;
public float x;
public float y;
[NativeTypeName("float[6]")]
public _axes_e__FixedBuffer axes;
[NativeTypeName("bool")]
public SDLBool eraser;
[InlineArray(6)]
public partial struct _axes_e__FixedBuffer
{
public float e0;
}
[NativeTypeName("bool")]
public SDLBool down;
}
public partial struct SDL_PenButtonEvent
@ -810,27 +856,42 @@ namespace SDL
public SDL_PenID which;
[NativeTypeName("Uint8")]
public byte button;
[NativeTypeName("Uint8")]
public byte state;
[NativeTypeName("Uint16")]
public ushort pen_state;
public SDL_PenInputFlags pen_state;
public float x;
public float y;
[NativeTypeName("float[6]")]
public _axes_e__FixedBuffer axes;
[NativeTypeName("Uint8")]
public byte button;
[InlineArray(6)]
public partial struct _axes_e__FixedBuffer
{
public float e0;
}
[NativeTypeName("bool")]
public SDLBool down;
}
public partial struct SDL_PenAxisEvent
{
public SDL_EventType type;
[NativeTypeName("Uint32")]
public uint reserved;
[NativeTypeName("Uint64")]
public ulong timestamp;
public SDL_WindowID windowID;
public SDL_PenID which;
public SDL_PenInputFlags pen_state;
public float x;
public float y;
public SDL_PenAxis axis;
public float value;
}
public unsafe partial struct SDL_DropEvent
@ -856,7 +917,7 @@ namespace SDL
public byte* data;
}
public partial struct SDL_ClipboardEvent
public unsafe partial struct SDL_ClipboardEvent
{
public SDL_EventType type;
@ -865,6 +926,15 @@ namespace SDL
[NativeTypeName("Uint64")]
public ulong timestamp;
[NativeTypeName("bool")]
public SDLBool owner;
[NativeTypeName("Sint32")]
public int num_mime_types;
[NativeTypeName("const char **")]
public byte** mime_types;
}
public partial struct SDL_SensorEvent
@ -1021,7 +1091,13 @@ namespace SDL
public SDL_TouchFingerEvent tfinger;
[FieldOffset(0)]
public SDL_PenTipEvent ptip;
public SDL_PinchFingerEvent pinch;
[FieldOffset(0)]
public SDL_PenProximityEvent pproximity;
[FieldOffset(0)]
public SDL_PenTouchEvent ptouch;
[FieldOffset(0)]
public SDL_PenMotionEvent pmotion;
@ -1029,6 +1105,12 @@ namespace SDL
[FieldOffset(0)]
public SDL_PenButtonEvent pbutton;
[FieldOffset(0)]
public SDL_PenAxisEvent paxis;
[FieldOffset(0)]
public SDL_RenderEvent render;
[FieldOffset(0)]
public SDL_DropEvent drop;
@ -1062,10 +1144,12 @@ namespace SDL
public static extern int SDL_PeepEvents(SDL_Event* events, int numevents, SDL_EventAction action, [NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasEvent([NativeTypeName("Uint32")] uint type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasEvent([NativeTypeName("Uint32")] uint type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_FlushEvent([NativeTypeName("Uint32")] uint type);
@ -1074,37 +1158,44 @@ namespace SDL
public static extern void SDL_FlushEvents([NativeTypeName("Uint32")] uint minType, [NativeTypeName("Uint32")] uint maxType);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PollEvent(SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PollEvent(SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitEvent(SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitEvent(SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WaitEventTimeout(SDL_Event* @event, [NativeTypeName("Sint32")] int timeoutMS);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitEventTimeout(SDL_Event* @event, [NativeTypeName("Sint32")] int timeoutMS);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PushEvent(SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PushEvent(SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, int> filter, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_SetEventFilter([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> filter, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, int>* filter, [NativeTypeName("void **")] IntPtr* userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetEventFilter([NativeTypeName("SDL_EventFilter *")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool>* filter, [NativeTypeName("void **")] IntPtr* userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, int> filter, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AddEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> filter, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DelEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, int> filter, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_RemoveEventWatch([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> filter, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, int> filter, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_FilterEvents([NativeTypeName("SDL_EventFilter")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDLBool> filter, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetEventEnabled([NativeTypeName("Uint32")] uint type, SDL_bool enabled);
public static extern void SDL_SetEventEnabled([NativeTypeName("Uint32")] uint type, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_EventEnabled([NativeTypeName("Uint32")] uint type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EventEnabled([NativeTypeName("Uint32")] uint type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
@ -1113,10 +1204,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Window* SDL_GetWindowFromEvent([NativeTypeName("const SDL_Event *")] SDL_Event* @event);
[NativeTypeName("#define SDL_RELEASED 0")]
public const int SDL_RELEASED = 0;
[NativeTypeName("#define SDL_PRESSED 1")]
public const int SDL_PRESSED = 1;
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetEventDescription([NativeTypeName("const SDL_Event *")] SDL_Event* @event, [NativeTypeName("char *")] byte* buf, int buflen);
}
}

View File

@ -41,7 +41,7 @@ namespace SDL
SDL_FOLDER_SCREENSHOTS,
SDL_FOLDER_TEMPLATES,
SDL_FOLDER_VIDEOS,
SDL_FOLDER_TOTAL,
SDL_FOLDER_COUNT,
}
public enum SDL_PathType
@ -66,6 +66,13 @@ namespace SDL
public SDL_Time access_time;
}
public enum SDL_EnumerationResult
{
SDL_ENUM_CONTINUE,
SDL_ENUM_SUCCESS,
SDL_ENUM_FAILURE,
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetBasePath", ExactSpelling = true)]
@ -81,27 +88,37 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetUserFolder(SDL_Folder folder);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CreateDirectory([NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CreateDirectory([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_EnumerateDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnumerateDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDL_EnumerationResult> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RemovePath([NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RemovePath([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenamePath([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenamePath([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CopyFile([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CopyFile([NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetPathInfo([NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetPathInfo([NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("char **")]
public static extern byte** SDL_GlobDirectory([NativeTypeName("const char *")] byte* path, [NativeTypeName("const char *")] byte* pattern, SDL_GlobFlags flags, int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetCurrentDirectory", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_GetCurrentDirectory();
[NativeTypeName("#define SDL_GLOB_CASEINSENSITIVE (1u << 0)")]
public const uint SDL_GLOB_CASEINSENSITIVE = (1U << 0);
}

View File

@ -45,7 +45,8 @@ namespace SDL
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
SDL_GAMEPAD_TYPE_MAX,
SDL_GAMEPAD_TYPE_GAMECUBE,
SDL_GAMEPAD_TYPE_COUNT,
}
public enum SDL_GamepadButton
@ -77,7 +78,7 @@ namespace SDL
SDL_GAMEPAD_BUTTON_MISC4,
SDL_GAMEPAD_BUTTON_MISC5,
SDL_GAMEPAD_BUTTON_MISC6,
SDL_GAMEPAD_BUTTON_MAX,
SDL_GAMEPAD_BUTTON_COUNT,
}
public enum SDL_GamepadButtonLabel
@ -102,7 +103,7 @@ namespace SDL
SDL_GAMEPAD_AXIS_RIGHTY,
SDL_GAMEPAD_AXIS_LEFT_TRIGGER,
SDL_GAMEPAD_AXIS_RIGHT_TRIGGER,
SDL_GAMEPAD_AXIS_MAX,
SDL_GAMEPAD_AXIS_COUNT,
}
public enum SDL_GamepadBindingType
@ -117,12 +118,12 @@ namespace SDL
{
public SDL_GamepadBindingType input_type;
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L245_C5")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L267_C5")]
public _input_e__Union input;
public SDL_GamepadBindingType output_type;
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L265_C5")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L287_C5")]
public _output_e__Union output;
[StructLayout(LayoutKind.Explicit)]
@ -132,11 +133,11 @@ namespace SDL
public int button;
[FieldOffset(0)]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L249_C9")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L271_C9")]
public _axis_e__Struct axis;
[FieldOffset(0)]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L256_C9")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L278_C9")]
public _hat_e__Struct hat;
public partial struct _axis_e__Struct
@ -163,7 +164,7 @@ namespace SDL
public SDL_GamepadButton button;
[FieldOffset(0)]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L269_C9")]
[NativeTypeName("__AnonymousRecord_SDL_gamepad_L291_C9")]
public _axis_e__Struct axis;
public partial struct _axis_e__Struct
@ -183,13 +184,14 @@ namespace SDL
public static extern int SDL_AddGamepadMapping([NativeTypeName("const char *")] byte* mapping);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddGamepadMappingsFromIO(SDL_IOStream* src, SDL_bool closeio);
public static extern int SDL_AddGamepadMappingsFromIO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddGamepadMappingsFromFile([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReloadGamepadMappings();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReloadGamepadMappings();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("char **")]
@ -204,16 +206,19 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetGamepadMapping(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetGamepadMapping(SDL_JoystickID instance_id, [NativeTypeName("const char *")] byte* mapping);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGamepadMapping(SDL_JoystickID instance_id, [NativeTypeName("const char *")] byte* mapping);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasGamepad();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasGamepad();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID* SDL_GetGamepads(int* count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsGamepad(SDL_JoystickID instance_id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsGamepad(SDL_JoystickID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetGamepadNameForID", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -284,7 +289,8 @@ namespace SDL
public static extern int SDL_GetGamepadPlayerIndex(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGamepadPlayerIndex(SDL_Gamepad* gamepad, int player_index);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint16")]
@ -317,16 +323,18 @@ namespace SDL
public static extern SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad* gamepad, int* percent);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadConnected(SDL_Gamepad* gamepad);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadConnected(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Joystick* SDL_GetGamepadJoystick(SDL_Gamepad* gamepad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetGamepadEventsEnabled(SDL_bool enabled);
public static extern void SDL_SetGamepadEventsEnabled([NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadEventsEnabled();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadEventsEnabled();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GamepadBinding** SDL_GetGamepadBindings(SDL_Gamepad* gamepad, int* count);
@ -349,7 +357,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetGamepadStringForAxis(SDL_GamepadAxis axis);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadHasAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadHasAxis(SDL_Gamepad* gamepad, SDL_GamepadAxis axis);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint16")]
@ -363,11 +372,12 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetGamepadStringForButton(SDL_GamepadButton button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadHasButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadHasButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint8")]
public static extern byte SDL_GetGamepadButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetGamepadButton(SDL_Gamepad* gamepad, SDL_GamepadButton button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GamepadButtonLabel SDL_GetGamepadButtonLabelForType(SDL_GamepadType type, SDL_GamepadButton button);
@ -382,34 +392,43 @@ namespace SDL
public static extern int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad* gamepad, int touchpad);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, [NativeTypeName("Uint8 *")] byte* state, float* x, float* y, float* pressure);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetGamepadTouchpadFinger(SDL_Gamepad* gamepad, int touchpad, int finger, [NativeTypeName("bool *")] SDLBool* down, float* x, float* y, float* pressure);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadHasSensor(SDL_Gamepad* gamepad, SDL_SensorType type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadHasSensor(SDL_Gamepad* gamepad, SDL_SensorType type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GamepadSensorEnabled(SDL_Gamepad* gamepad, SDL_SensorType type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern float SDL_GetGamepadSensorDataRate(SDL_Gamepad* gamepad, SDL_SensorType type);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetGamepadSensorData(SDL_Gamepad* gamepad, SDL_SensorType type, float* data, int num_values);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RumbleGamepad(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RumbleGamepad(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RumbleGamepadTriggers(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RumbleGamepadTriggers(SDL_Gamepad* gamepad, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetGamepadLED(SDL_Gamepad* gamepad, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGamepadLED(SDL_Gamepad* gamepad, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SendGamepadEffect(SDL_Gamepad* gamepad, [NativeTypeName("const void *")] IntPtr data, int size);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SendGamepadEffect(SDL_Gamepad* gamepad, [NativeTypeName("const void *")] IntPtr data, int size);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseGamepad(SDL_Gamepad* gamepad);

File diff suppressed because it is too large Load Diff

View File

@ -34,8 +34,7 @@ namespace SDL
public partial struct SDL_HapticDirection
{
[NativeTypeName("Uint8")]
public byte type;
public SDL_HapticDirectionType type;
[NativeTypeName("Sint32[3]")]
public _dir_e__FixedBuffer dir;
@ -49,8 +48,7 @@ namespace SDL
public partial struct SDL_HapticConstant
{
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
public SDL_HapticDirection direction;
@ -84,8 +82,7 @@ namespace SDL
public partial struct SDL_HapticPeriodic
{
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
public SDL_HapticDirection direction;
@ -128,8 +125,7 @@ namespace SDL
public partial struct SDL_HapticCondition
{
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
public SDL_HapticDirection direction;
@ -202,8 +198,7 @@ namespace SDL
public partial struct SDL_HapticRamp
{
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
public SDL_HapticDirection direction;
@ -240,8 +235,7 @@ namespace SDL
public partial struct SDL_HapticLeftRight
{
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
[NativeTypeName("Uint32")]
public uint length;
@ -255,8 +249,7 @@ namespace SDL
public unsafe partial struct SDL_HapticCustom
{
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
public SDL_HapticDirection direction;
@ -301,8 +294,7 @@ namespace SDL
public partial struct SDL_HapticEffect
{
[FieldOffset(0)]
[NativeTypeName("Uint16")]
public ushort type;
public SDL_HapticEffectType type;
[FieldOffset(0)]
public SDL_HapticConstant constant;
@ -346,13 +338,15 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetHapticName(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsMouseHaptic();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsMouseHaptic();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Haptic* SDL_OpenHapticFromMouse();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsJoystickHaptic(SDL_Joystick* joystick);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsJoystickHaptic(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Haptic* SDL_OpenHapticFromJoystick(SDL_Joystick* joystick);
@ -374,52 +368,69 @@ namespace SDL
public static extern int SDL_GetNumHapticAxes(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HapticEffectSupported(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HapticEffectSupported(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CreateHapticEffect(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect);
public static extern SDL_HapticEffectID SDL_CreateHapticEffect(SDL_Haptic* haptic, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_UpdateHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect, [NativeTypeName("const SDL_HapticEffect *")] SDL_HapticEffect* data);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RunHapticEffect(SDL_Haptic* haptic, int effect, [NativeTypeName("Uint32")] uint iterations);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RunHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect, [NativeTypeName("Uint32")] uint iterations);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_StopHapticEffect(SDL_Haptic* haptic, int effect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyHapticEffect(SDL_Haptic* haptic, int effect);
public static extern void SDL_DestroyHapticEffect(SDL_Haptic* haptic, SDL_HapticEffectID effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetHapticEffectStatus(SDL_Haptic* haptic, int effect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetHapticEffectStatus(SDL_Haptic* haptic, SDL_HapticEffectID effect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetHapticGain(SDL_Haptic* haptic, int gain);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHapticGain(SDL_Haptic* haptic, int gain);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHapticAutocenter(SDL_Haptic* haptic, int autocenter);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PauseHaptic(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PauseHaptic(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ResumeHaptic(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResumeHaptic(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_StopHapticEffects(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopHapticEffects(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HapticRumbleSupported(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HapticRumbleSupported(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_InitHapticRumble(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_InitHapticRumble(SDL_Haptic* haptic);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, [NativeTypeName("Uint32")] uint length);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PlayHapticRumble(SDL_Haptic* haptic, float strength, [NativeTypeName("Uint32")] uint length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_StopHapticRumble(SDL_Haptic* haptic);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopHapticRumble(SDL_Haptic* haptic);
[NativeTypeName("#define SDL_HAPTIC_INFINITY 4294967295U")]
public const uint SDL_HAPTIC_INFINITY = 4294967295U;
[NativeTypeName("#define SDL_HAPTIC_CONSTANT (1u<<0)")]
public const uint SDL_HAPTIC_CONSTANT = (1U << 0);
@ -492,8 +503,5 @@ namespace SDL
[NativeTypeName("#define SDL_HAPTIC_STEERING_AXIS 3")]
public const int SDL_HAPTIC_STEERING_AXIS = 3;
[NativeTypeName("#define SDL_HAPTIC_INFINITY 4294967295U")]
public const uint SDL_HAPTIC_INFINITY = 4294967295U;
}
}

View File

@ -108,6 +108,9 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_hid_device* SDL_hid_open_path([NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_hid_get_properties(SDL_hid_device* dev);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_hid_write(SDL_hid_device* dev, [NativeTypeName("const unsigned char *")] byte* data, [NativeTypeName("size_t")] nuint length);
@ -151,6 +154,9 @@ namespace SDL
public static extern int SDL_hid_get_report_descriptor(SDL_hid_device* dev, [NativeTypeName("unsigned char *")] byte* buf, [NativeTypeName("size_t")] nuint buf_size);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_hid_ble_scan(SDL_bool active);
public static extern void SDL_hid_ble_scan([NativeTypeName("bool")] SDLBool active);
[NativeTypeName("#define SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER \"SDL.hidapi.libusb.device.handle\"")]
public static ReadOnlySpan<byte> SDL_PROP_HIDAPI_LIBUSB_DEVICE_HANDLE_POINTER => "SDL.hidapi.libusb.device.handle"u8;
}
}

View File

@ -38,13 +38,16 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetHintWithPriority([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_HintPriority priority);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHintWithPriority([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, SDL_HintPriority priority);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetHint([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetHint([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ResetHint([NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ResetHint([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ResetHints();
@ -54,13 +57,15 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetHint([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetHintBoolean([NativeTypeName("const char *")] byte* name, SDL_bool default_value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetHintBoolean([NativeTypeName("const char *")] byte* name, [NativeTypeName("bool")] SDLBool default_value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AddHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DelHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_RemoveHintCallback([NativeTypeName("const char *")] byte* name, [NativeTypeName("SDL_HintCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[NativeTypeName("#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED \"SDL_ALLOW_ALT_TAB_WHILE_GRABBED\"")]
public static ReadOnlySpan<byte> SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED => "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"u8;
@ -71,6 +76,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE \"SDL_ANDROID_BLOCK_ON_PAUSE\"")]
public static ReadOnlySpan<byte> SDL_HINT_ANDROID_BLOCK_ON_PAUSE => "SDL_ANDROID_BLOCK_ON_PAUSE"u8;
[NativeTypeName("#define SDL_HINT_ANDROID_LOW_LATENCY_AUDIO \"SDL_ANDROID_LOW_LATENCY_AUDIO\"")]
public static ReadOnlySpan<byte> SDL_HINT_ANDROID_LOW_LATENCY_AUDIO => "SDL_ANDROID_LOW_LATENCY_AUDIO"u8;
[NativeTypeName("#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON \"SDL_ANDROID_TRAP_BACK_BUTTON\"")]
public static ReadOnlySpan<byte> SDL_HINT_ANDROID_TRAP_BACK_BUTTON => "SDL_ANDROID_TRAP_BACK_BUTTON"u8;
@ -89,6 +97,12 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE \"SDL_AUDIO_ALSA_DEFAULT_DEVICE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_ALSA_DEFAULT_DEVICE => "SDL_AUDIO_ALSA_DEFAULT_DEVICE"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE \"SDL_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE => "SDL_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE \"SDL_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE => "SDL_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_CATEGORY \"SDL_AUDIO_CATEGORY\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_CATEGORY => "SDL_AUDIO_CATEGORY"u8;
@ -107,6 +121,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE \"SDL_AUDIO_DEVICE_STREAM_ROLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DEVICE_STREAM_ROLE => "SDL_AUDIO_DEVICE_STREAM_ROLE"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_DEVICE_RAW_STREAM \"SDL_AUDIO_DEVICE_RAW_STREAM\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DEVICE_RAW_STREAM => "SDL_AUDIO_DEVICE_RAW_STREAM"u8;
[NativeTypeName("#define SDL_HINT_AUDIO_DISK_INPUT_FILE \"SDL_AUDIO_DISK_INPUT_FILE\"")]
public static ReadOnlySpan<byte> SDL_HINT_AUDIO_DISK_INPUT_FILE => "SDL_AUDIO_DISK_INPUT_FILE"u8;
@ -155,6 +172,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_DISPLAY_USABLE_BOUNDS \"SDL_DISPLAY_USABLE_BOUNDS\"")]
public static ReadOnlySpan<byte> SDL_HINT_DISPLAY_USABLE_BOUNDS => "SDL_DISPLAY_USABLE_BOUNDS"u8;
[NativeTypeName("#define SDL_HINT_INVALID_PARAM_CHECKS \"SDL_INVALID_PARAM_CHECKS\"")]
public static ReadOnlySpan<byte> SDL_HINT_INVALID_PARAM_CHECKS => "SDL_INVALID_PARAM_CHECKS"u8;
[NativeTypeName("#define SDL_HINT_EMSCRIPTEN_ASYNCIFY \"SDL_EMSCRIPTEN_ASYNCIFY\"")]
public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_ASYNCIFY => "SDL_EMSCRIPTEN_ASYNCIFY"u8;
@ -164,6 +184,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT \"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT\"")]
public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT => "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"u8;
[NativeTypeName("#define SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT \"SDL_EMSCRIPTEN_FILL_DOCUMENT\"")]
public static ReadOnlySpan<byte> SDL_HINT_EMSCRIPTEN_FILL_DOCUMENT => "SDL_EMSCRIPTEN_FILL_DOCUMENT"u8;
[NativeTypeName("#define SDL_HINT_ENABLE_SCREEN_KEYBOARD \"SDL_ENABLE_SCREEN_KEYBOARD\"")]
public static ReadOnlySpan<byte> SDL_HINT_ENABLE_SCREEN_KEYBOARD => "SDL_ENABLE_SCREEN_KEYBOARD"u8;
@ -221,6 +244,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_HIDAPI_UDEV \"SDL_HIDAPI_UDEV\"")]
public static ReadOnlySpan<byte> SDL_HINT_HIDAPI_UDEV => "SDL_HIDAPI_UDEV"u8;
[NativeTypeName("#define SDL_HINT_GPU_DRIVER \"SDL_GPU_DRIVER\"")]
public static ReadOnlySpan<byte> SDL_HINT_GPU_DRIVER => "SDL_GPU_DRIVER"u8;
[NativeTypeName("#define SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS \"SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS\"")]
public static ReadOnlySpan<byte> SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS => "SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS"u8;
@ -251,12 +277,18 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_DEVICE \"SDL_JOYSTICK_DEVICE\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_DEVICE => "SDL_JOYSTICK_DEVICE"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_ENHANCED_REPORTS \"SDL_JOYSTICK_ENHANCED_REPORTS\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_ENHANCED_REPORTS => "SDL_JOYSTICK_ENHANCED_REPORTS"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES \"SDL_JOYSTICK_FLIGHTSTICK_DEVICES\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES => "SDL_JOYSTICK_FLIGHTSTICK_DEVICES"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED \"SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED => "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_GAMEINPUT \"SDL_JOYSTICK_GAMEINPUT\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_GAMEINPUT => "SDL_JOYSTICK_GAMEINPUT"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES \"SDL_JOYSTICK_GAMECUBE_DEVICES\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_GAMECUBE_DEVICES => "SDL_JOYSTICK_GAMECUBE_DEVICES"u8;
@ -299,18 +331,12 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL \"SDL_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL => "SDL_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE => "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5 \"SDL_JOYSTICK_HIDAPI_PS5\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_PS5 => "SDL_JOYSTICK_HIDAPI_PS5"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE \"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE => "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD \"SDL_JOYSTICK_HIDAPI_SHIELD\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SHIELD => "SDL_JOYSTICK_HIDAPI_SHIELD"u8;
@ -320,9 +346,30 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM \"SDL_JOYSTICK_HIDAPI_STEAM\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_STEAM => "SDL_JOYSTICK_HIDAPI_STEAM"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HOME_LED \"SDL_JOYSTICK_HIDAPI_STEAM_HOME_LED\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_STEAM_HOME_LED => "SDL_JOYSTICK_HIDAPI_STEAM_HOME_LED"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK \"SDL_JOYSTICK_HIDAPI_STEAMDECK\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK => "SDL_JOYSTICK_HIDAPI_STEAMDECK"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI \"SDL_JOYSTICK_HIDAPI_STEAM_HORI\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_STEAM_HORI => "SDL_JOYSTICK_HIDAPI_STEAM_HORI"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_LG4FF \"SDL_JOYSTICK_HIDAPI_LG4FF\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_LG4FF => "SDL_JOYSTICK_HIDAPI_LG4FF"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_8BITDO \"SDL_JOYSTICK_HIDAPI_8BITDO\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_8BITDO => "SDL_JOYSTICK_HIDAPI_8BITDO"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SINPUT \"SDL_JOYSTICK_HIDAPI_SINPUT\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SINPUT => "SDL_JOYSTICK_HIDAPI_SINPUT"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_ZUIKI \"SDL_JOYSTICK_HIDAPI_ZUIKI\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_ZUIKI => "SDL_JOYSTICK_HIDAPI_ZUIKI"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI \"SDL_JOYSTICK_HIDAPI_FLYDIGI\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI => "SDL_JOYSTICK_HIDAPI_FLYDIGI"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH \"SDL_JOYSTICK_HIDAPI_SWITCH\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH => "SDL_JOYSTICK_HIDAPI_SWITCH"u8;
@ -332,6 +379,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED \"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED => "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 \"SDL_JOYSTICK_HIDAPI_SWITCH2\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_SWITCH2 => "SDL_JOYSTICK_HIDAPI_SWITCH2"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS \"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS => "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"u8;
@ -359,6 +409,12 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED \"SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED => "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GIP \"SDL_JOYSTICK_HIDAPI_GIP\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_GIP => "SDL_JOYSTICK_HIDAPI_GIP"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA \"SDL_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA => "SDL_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_IOKIT \"SDL_JOYSTICK_IOKIT\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_IOKIT => "SDL_JOYSTICK_IOKIT"u8;
@ -407,6 +463,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES \"SDL_JOYSTICK_ZERO_CENTERED_DEVICES\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES => "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"u8;
[NativeTypeName("#define SDL_HINT_JOYSTICK_HAPTIC_AXES \"SDL_JOYSTICK_HAPTIC_AXES\"")]
public static ReadOnlySpan<byte> SDL_HINT_JOYSTICK_HAPTIC_AXES => "SDL_JOYSTICK_HAPTIC_AXES"u8;
[NativeTypeName("#define SDL_HINT_KEYCODE_OPTIONS \"SDL_KEYCODE_OPTIONS\"")]
public static ReadOnlySpan<byte> SDL_HINT_KEYCODE_OPTIONS => "SDL_KEYCODE_OPTIONS"u8;
@ -416,6 +475,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER \"SDL_KMSDRM_REQUIRE_DRM_MASTER\"")]
public static ReadOnlySpan<byte> SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER => "SDL_KMSDRM_REQUIRE_DRM_MASTER"u8;
[NativeTypeName("#define SDL_HINT_KMSDRM_ATOMIC \"SDL_KMSDRM_ATOMIC\"")]
public static ReadOnlySpan<byte> SDL_HINT_KMSDRM_ATOMIC => "SDL_KMSDRM_ATOMIC"u8;
[NativeTypeName("#define SDL_HINT_LOGGING \"SDL_LOGGING\"")]
public static ReadOnlySpan<byte> SDL_HINT_LOGGING => "SDL_LOGGING"u8;
@ -428,6 +490,15 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH \"SDL_MAC_OPENGL_ASYNC_DISPATCH\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH => "SDL_MAC_OPENGL_ASYNC_DISPATCH"u8;
[NativeTypeName("#define SDL_HINT_MAC_OPTION_AS_ALT \"SDL_MAC_OPTION_AS_ALT\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAC_OPTION_AS_ALT => "SDL_MAC_OPTION_AS_ALT"u8;
[NativeTypeName("#define SDL_HINT_MAC_SCROLL_MOMENTUM \"SDL_MAC_SCROLL_MOMENTUM\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAC_SCROLL_MOMENTUM => "SDL_MAC_SCROLL_MOMENTUM"u8;
[NativeTypeName("#define SDL_HINT_MAC_PRESS_AND_HOLD \"SDL_MAC_PRESS_AND_HOLD\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAC_PRESS_AND_HOLD => "SDL_MAC_PRESS_AND_HOLD"u8;
[NativeTypeName("#define SDL_HINT_MAIN_CALLBACK_RATE \"SDL_MAIN_CALLBACK_RATE\"")]
public static ReadOnlySpan<byte> SDL_HINT_MAIN_CALLBACK_RATE => "SDL_MAIN_CALLBACK_RATE"u8;
@ -440,6 +511,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME \"SDL_MOUSE_DOUBLE_CLICK_TIME\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_DOUBLE_CLICK_TIME => "SDL_MOUSE_DOUBLE_CLICK_TIME"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_DEFAULT_SYSTEM_CURSOR \"SDL_MOUSE_DEFAULT_SYSTEM_CURSOR\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_DEFAULT_SYSTEM_CURSOR => "SDL_MOUSE_DEFAULT_SYSTEM_CURSOR"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE \"SDL_MOUSE_EMULATE_WARP_WITH_RELATIVE\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE => "SDL_MOUSE_EMULATE_WARP_WITH_RELATIVE"u8;
@ -452,9 +526,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER \"SDL_MOUSE_RELATIVE_MODE_CENTER\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_MODE_CENTER => "SDL_MOUSE_RELATIVE_MODE_CENTER"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP \"SDL_MOUSE_RELATIVE_MODE_WARP\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_MODE_WARP => "SDL_MOUSE_RELATIVE_MODE_WARP"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE \"SDL_MOUSE_RELATIVE_SPEED_SCALE\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE => "SDL_MOUSE_RELATIVE_SPEED_SCALE"u8;
@ -467,9 +538,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE \"SDL_MOUSE_RELATIVE_CURSOR_VISIBLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE => "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL \"SDL_MOUSE_RELATIVE_CLIP_INTERVAL\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL => "SDL_MOUSE_RELATIVE_CLIP_INTERVAL"u8;
[NativeTypeName("#define SDL_HINT_MOUSE_TOUCH_EVENTS \"SDL_MOUSE_TOUCH_EVENTS\"")]
public static ReadOnlySpan<byte> SDL_HINT_MOUSE_TOUCH_EVENTS => "SDL_MOUSE_TOUCH_EVENTS"u8;
@ -482,18 +550,18 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_OPENGL_LIBRARY \"SDL_OPENGL_LIBRARY\"")]
public static ReadOnlySpan<byte> SDL_HINT_OPENGL_LIBRARY => "SDL_OPENGL_LIBRARY"u8;
[NativeTypeName("#define SDL_HINT_EGL_LIBRARY \"SDL_EGL_LIBRARY\"")]
public static ReadOnlySpan<byte> SDL_HINT_EGL_LIBRARY => "SDL_EGL_LIBRARY"u8;
[NativeTypeName("#define SDL_HINT_OPENGL_ES_DRIVER \"SDL_OPENGL_ES_DRIVER\"")]
public static ReadOnlySpan<byte> SDL_HINT_OPENGL_ES_DRIVER => "SDL_OPENGL_ES_DRIVER"u8;
[NativeTypeName("#define SDL_HINT_OPENVR_LIBRARY \"SDL_OPENVR_LIBRARY\"")]
public static ReadOnlySpan<byte> SDL_HINT_OPENVR_LIBRARY => "SDL_OPENVR_LIBRARY"u8;
[NativeTypeName("#define SDL_HINT_ORIENTATIONS \"SDL_ORIENTATIONS\"")]
public static ReadOnlySpan<byte> SDL_HINT_ORIENTATIONS => "SDL_ORIENTATIONS"u8;
[NativeTypeName("#define SDL_HINT_PEN_DELAY_MOUSE_BUTTON \"SDL_PEN_DELAY_MOUSE_BUTTON\"")]
public static ReadOnlySpan<byte> SDL_HINT_PEN_DELAY_MOUSE_BUTTON => "SDL_PEN_DELAY_MOUSE_BUTTON"u8;
[NativeTypeName("#define SDL_HINT_PEN_NOT_MOUSE \"SDL_PEN_NOT_MOUSE\"")]
public static ReadOnlySpan<byte> SDL_HINT_PEN_NOT_MOUSE => "SDL_PEN_NOT_MOUSE"u8;
[NativeTypeName("#define SDL_HINT_POLL_SENTINEL \"SDL_POLL_SENTINEL\"")]
public static ReadOnlySpan<byte> SDL_HINT_POLL_SENTINEL => "SDL_POLL_SENTINEL"u8;
@ -509,9 +577,18 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_DEBUG \"SDL_RENDER_DIRECT3D11_DEBUG\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_DIRECT3D11_DEBUG => "SDL_RENDER_DIRECT3D11_DEBUG"u8;
[NativeTypeName("#define SDL_HINT_RENDER_DIRECT3D11_WARP \"SDL_RENDER_DIRECT3D11_WARP\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_DIRECT3D11_WARP => "SDL_RENDER_DIRECT3D11_WARP"u8;
[NativeTypeName("#define SDL_HINT_RENDER_VULKAN_DEBUG \"SDL_RENDER_VULKAN_DEBUG\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_VULKAN_DEBUG => "SDL_RENDER_VULKAN_DEBUG"u8;
[NativeTypeName("#define SDL_HINT_RENDER_GPU_DEBUG \"SDL_RENDER_GPU_DEBUG\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_GPU_DEBUG => "SDL_RENDER_GPU_DEBUG"u8;
[NativeTypeName("#define SDL_HINT_RENDER_GPU_LOW_POWER \"SDL_RENDER_GPU_LOW_POWER\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_GPU_LOW_POWER => "SDL_RENDER_GPU_LOW_POWER"u8;
[NativeTypeName("#define SDL_HINT_RENDER_DRIVER \"SDL_RENDER_DRIVER\"")]
public static ReadOnlySpan<byte> SDL_HINT_RENDER_DRIVER => "SDL_RENDER_DRIVER"u8;
@ -533,6 +610,18 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED \"SDL_ROG_GAMEPAD_MICE_EXCLUDED\"")]
public static ReadOnlySpan<byte> SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED => "SDL_ROG_GAMEPAD_MICE_EXCLUDED"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_WIDTH \"SDL_PS2_GS_WIDTH\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_WIDTH => "SDL_PS2_GS_WIDTH"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_HEIGHT \"SDL_PS2_GS_HEIGHT\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_HEIGHT => "SDL_PS2_GS_HEIGHT"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_PROGRESSIVE \"SDL_PS2_GS_PROGRESSIVE\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_PROGRESSIVE => "SDL_PS2_GS_PROGRESSIVE"u8;
[NativeTypeName("#define SDL_HINT_PS2_GS_MODE \"SDL_PS2_GS_MODE\"")]
public static ReadOnlySpan<byte> SDL_HINT_PS2_GS_MODE => "SDL_PS2_GS_MODE"u8;
[NativeTypeName("#define SDL_HINT_RPI_VIDEO_LAYER \"SDL_RPI_VIDEO_LAYER\"")]
public static ReadOnlySpan<byte> SDL_HINT_RPI_VIDEO_LAYER => "SDL_RPI_VIDEO_LAYER"u8;
@ -569,6 +658,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER \"SDL_VIDEO_ALLOW_SCREENSAVER\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_ALLOW_SCREENSAVER => "SDL_VIDEO_ALLOW_SCREENSAVER"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_DISPLAY_PRIORITY \"SDL_VIDEO_DISPLAY_PRIORITY\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_DISPLAY_PRIORITY => "SDL_VIDEO_DISPLAY_PRIORITY"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_DOUBLE_BUFFER \"SDL_VIDEO_DOUBLE_BUFFER\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_DOUBLE_BUFFER => "SDL_VIDEO_DOUBLE_BUFFER"u8;
@ -587,6 +679,15 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES \"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES => "SDL_VIDEO_MAC_FULLSCREEN_SPACES"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY \"SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY => "SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE \"SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE => "SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE \"SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE => "SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS \"SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS => "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"u8;
@ -614,6 +715,9 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_VIDEO_WIN_D3DCOMPILER \"SDL_VIDEO_WIN_D3DCOMPILER\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_WIN_D3DCOMPILER => "SDL_VIDEO_WIN_D3DCOMPILER"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT \"SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT => "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT"u8;
[NativeTypeName("#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR \"SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR\"")]
public static ReadOnlySpan<byte> SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR => "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"u8;
@ -695,9 +799,15 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP \"SDL_WINDOWS_ENABLE_MESSAGELOOP\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP => "SDL_WINDOWS_ENABLE_MESSAGELOOP"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_GAMEINPUT \"SDL_WINDOWS_GAMEINPUT\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_GAMEINPUT => "SDL_WINDOWS_GAMEINPUT"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_RAW_KEYBOARD \"SDL_WINDOWS_RAW_KEYBOARD\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_RAW_KEYBOARD => "SDL_WINDOWS_RAW_KEYBOARD"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS \"SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS => "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS"u8;
[NativeTypeName("#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL \"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL => "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"u8;
@ -713,15 +823,6 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE \"SDL_WINDOWS_ERASE_BACKGROUND_MODE\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE => "SDL_WINDOWS_ERASE_BACKGROUND_MODE"u8;
[NativeTypeName("#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON \"SDL_WINRT_HANDLE_BACK_BUTTON\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINRT_HANDLE_BACK_BUTTON => "SDL_WINRT_HANDLE_BACK_BUTTON"u8;
[NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL \"SDL_WINRT_PRIVACY_POLICY_LABEL\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINRT_PRIVACY_POLICY_LABEL => "SDL_WINRT_PRIVACY_POLICY_LABEL"u8;
[NativeTypeName("#define SDL_HINT_WINRT_PRIVACY_POLICY_URL \"SDL_WINRT_PRIVACY_POLICY_URL\"")]
public static ReadOnlySpan<byte> SDL_HINT_WINRT_PRIVACY_POLICY_URL => "SDL_WINRT_PRIVACY_POLICY_URL"u8;
[NativeTypeName("#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT \"SDL_X11_FORCE_OVERRIDE_REDIRECT\"")]
public static ReadOnlySpan<byte> SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT => "SDL_X11_FORCE_OVERRIDE_REDIRECT"u8;
@ -733,5 +834,14 @@ namespace SDL
[NativeTypeName("#define SDL_HINT_XINPUT_ENABLED \"SDL_XINPUT_ENABLED\"")]
public static ReadOnlySpan<byte> SDL_HINT_XINPUT_ENABLED => "SDL_XINPUT_ENABLED"u8;
[NativeTypeName("#define SDL_HINT_ASSERT \"SDL_ASSERT\"")]
public static ReadOnlySpan<byte> SDL_HINT_ASSERT => "SDL_ASSERT"u8;
[NativeTypeName("#define SDL_HINT_PEN_MOUSE_EVENTS \"SDL_PEN_MOUSE_EVENTS\"")]
public static ReadOnlySpan<byte> SDL_HINT_PEN_MOUSE_EVENTS => "SDL_PEN_MOUSE_EVENTS"u8;
[NativeTypeName("#define SDL_HINT_PEN_TOUCH_EVENTS \"SDL_PEN_TOUCH_EVENTS\"")]
public static ReadOnlySpan<byte> SDL_HINT_PEN_TOUCH_EVENTS => "SDL_PEN_TOUCH_EVENTS"u8;
}
}

View File

@ -28,13 +28,22 @@ using System.Runtime.InteropServices;
namespace SDL
{
public enum SDL_AppResult
{
SDL_APP_CONTINUE,
SDL_APP_SUCCESS,
SDL_APP_FAILURE,
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_Init(SDL_InitFlags flags);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_Init(SDL_InitFlags flags);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_InitSubSystem(SDL_InitFlags flags);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_InitSubSystem(SDL_InitFlags flags);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_QuitSubSystem(SDL_InitFlags flags);
@ -46,18 +55,25 @@ namespace SDL
public static extern void SDL_Quit();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAppMetadata([NativeTypeName("const char *")] byte* appname, [NativeTypeName("const char *")] byte* appversion, [NativeTypeName("const char *")] byte* appidentifier);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsMainThread();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetAppMetadataProperty([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RunOnMainThread([NativeTypeName("SDL_MainThreadCallback")] delegate* unmanaged[Cdecl]<IntPtr, void> callback, [NativeTypeName("void*")] IntPtr userdata, [NativeTypeName("bool")] SDLBool wait_complete);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAppMetadata([NativeTypeName("const char *")] byte* appname, [NativeTypeName("const char *")] byte* appversion, [NativeTypeName("const char *")] byte* appidentifier);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetAppMetadataProperty([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetAppMetadataProperty", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetAppMetadataProperty([NativeTypeName("const char *")] byte* name);
[NativeTypeName("#define SDL_INIT_TIMER 0x00000001u")]
public const uint SDL_INIT_TIMER = 0x00000001U;
[NativeTypeName("#define SDL_INIT_AUDIO 0x00000010u")]
public const uint SDL_INIT_AUDIO = 0x00000010U;

View File

@ -47,6 +47,9 @@ namespace SDL
public unsafe partial struct SDL_IOStreamInterface
{
[NativeTypeName("Uint32")]
public uint version;
[NativeTypeName("Sint64 (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, long> size;
@ -59,8 +62,11 @@ namespace SDL
[NativeTypeName("size_t (*)(void *, const void *, size_t, SDL_IOStatus *)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, nuint, SDL_IOStatus*, nuint> write;
[NativeTypeName("int (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, int> close;
[NativeTypeName("bool (*)(void *, SDL_IOStatus *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_IOStatus*, SDLBool> flush;
[NativeTypeName("bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool> close;
}
public partial struct SDL_IOStream
@ -85,7 +91,8 @@ namespace SDL
public static extern SDL_IOStream* SDL_OpenIO([NativeTypeName("const SDL_IOStreamInterface *")] SDL_IOStreamInterface* iface, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CloseIO(SDL_IOStream* context);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CloseIO(SDL_IOStream* context);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_GetIOProperties(SDL_IOStream* context);
@ -121,97 +128,137 @@ namespace SDL
[return: NativeTypeName("size_t")]
public static extern nuint SDL_IOvprintf(SDL_IOStream* context, [NativeTypeName("const char *")] byte* fmt, [NativeTypeName("va_list")] byte* ap);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlushIO(SDL_IOStream* context);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_LoadFile_IO(SDL_IOStream* src, [NativeTypeName("size_t *")] nuint* datasize, SDL_bool closeio);
public static extern IntPtr SDL_LoadFile_IO(SDL_IOStream* src, [NativeTypeName("size_t *")] nuint* datasize, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_LoadFile([NativeTypeName("const char *")] byte* file, [NativeTypeName("size_t *")] nuint* datasize);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU8(SDL_IOStream* src, [NativeTypeName("Uint8 *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveFile_IO(SDL_IOStream* src, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint datasize, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS8(SDL_IOStream* src, [NativeTypeName("Sint8 *")] sbyte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveFile([NativeTypeName("const char *")] byte* file, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint datasize);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU16LE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU8(SDL_IOStream* src, [NativeTypeName("Uint8 *")] byte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS16LE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS8(SDL_IOStream* src, [NativeTypeName("Sint8 *")] sbyte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU16BE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU16LE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS16BE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS16LE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU32LE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU16BE(SDL_IOStream* src, [NativeTypeName("Uint16 *")] ushort* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS32LE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS16BE(SDL_IOStream* src, [NativeTypeName("Sint16 *")] short* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU32BE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU32LE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS32BE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS32LE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU64LE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU32BE(SDL_IOStream* src, [NativeTypeName("Uint32 *")] uint* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS64LE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS32BE(SDL_IOStream* src, [NativeTypeName("Sint32 *")] int* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadU64BE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU64LE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ReadS64BE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS64LE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU8(SDL_IOStream* dst, [NativeTypeName("Uint8")] byte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadU64BE(SDL_IOStream* src, [NativeTypeName("Uint64 *")] ulong* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS8(SDL_IOStream* dst, [NativeTypeName("Sint8")] sbyte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadS64BE(SDL_IOStream* src, [NativeTypeName("Sint64 *")] long* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU16LE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU8(SDL_IOStream* dst, [NativeTypeName("Uint8")] byte value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS16LE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS8(SDL_IOStream* dst, [NativeTypeName("Sint8")] sbyte value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU16BE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU16LE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS16BE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS16LE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU32LE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU16BE(SDL_IOStream* dst, [NativeTypeName("Uint16")] ushort value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS32LE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS16BE(SDL_IOStream* dst, [NativeTypeName("Sint16")] short value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU32BE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU32LE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS32BE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS32LE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU64LE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU32BE(SDL_IOStream* dst, [NativeTypeName("Uint32")] uint value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS64LE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS32BE(SDL_IOStream* dst, [NativeTypeName("Sint32")] int value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteU64BE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU64LE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_WriteS64BE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS64LE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteU64BE(SDL_IOStream* dst, [NativeTypeName("Uint64")] ulong value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteS64BE(SDL_IOStream* dst, [NativeTypeName("Sint64")] long value);
[NativeTypeName("#define SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER \"SDL.iostream.windows.handle\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER => "SDL.iostream.windows.handle"u8;
@ -219,9 +266,21 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_IOSTREAM_STDIO_FILE_POINTER \"SDL.iostream.stdio.file\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_STDIO_FILE_POINTER => "SDL.iostream.stdio.file"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER \"SDL.iostream.file_descriptor\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBER => "SDL.iostream.file_descriptor"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER \"SDL.iostream.android.aasset\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER => "SDL.iostream.android.aasset"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_POINTER \"SDL.iostream.memory.base\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_MEMORY_POINTER => "SDL.iostream.memory.base"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER \"SDL.iostream.memory.size\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER => "SDL.iostream.memory.size"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER \"SDL.iostream.memory.free\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER => "SDL.iostream.memory.free"u8;
[NativeTypeName("#define SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER \"SDL.iostream.dynamic.memory\"")]
public static ReadOnlySpan<byte> SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER => "SDL.iostream.dynamic.memory"u8;

View File

@ -45,6 +45,7 @@ namespace SDL
SDL_JOYSTICK_TYPE_DRUM_KIT,
SDL_JOYSTICK_TYPE_ARCADE_PAD,
SDL_JOYSTICK_TYPE_THROTTLE,
SDL_JOYSTICK_TYPE_COUNT,
}
public enum SDL_JoystickConnectionState
@ -79,6 +80,9 @@ namespace SDL
public unsafe partial struct SDL_VirtualJoystickDesc
{
[NativeTypeName("Uint32")]
public uint version;
[NativeTypeName("Uint16")]
public ushort type;
@ -136,20 +140,23 @@ namespace SDL
[NativeTypeName("void (*)(void *, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, int, void> SetPlayerIndex;
[NativeTypeName("int (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, int> Rumble;
[NativeTypeName("bool (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, SDLBool> Rumble;
[NativeTypeName("int (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, int> RumbleTriggers;
[NativeTypeName("bool (*)(void *, Uint16, Uint16)")]
public delegate* unmanaged[Cdecl]<IntPtr, ushort, ushort, SDLBool> RumbleTriggers;
[NativeTypeName("int (*)(void *, Uint8, Uint8, Uint8)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte, byte, byte, int> SetLED;
[NativeTypeName("bool (*)(void *, Uint8, Uint8, Uint8)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte, byte, byte, SDLBool> SetLED;
[NativeTypeName("int (*)(void *, const void *, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, int> SendEffect;
[NativeTypeName("bool (*)(void *, const void *, int)")]
public delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int, SDLBool> SendEffect;
[NativeTypeName("int (*)(void *, SDL_bool)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_bool, int> SetSensorsEnabled;
[NativeTypeName("bool (*)(void *, bool)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool, SDLBool> SetSensorsEnabled;
[NativeTypeName("void (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, void> Cleanup;
[InlineArray(2)]
public partial struct _padding2_e__FixedBuffer
@ -167,7 +174,8 @@ namespace SDL
public static extern void SDL_UnlockJoysticks();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasJoystick();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasJoystick();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID* SDL_GetJoysticks(int* count);
@ -214,28 +222,36 @@ namespace SDL
public static extern SDL_JoystickID SDL_AttachVirtualJoystick([NativeTypeName("const SDL_VirtualJoystickDesc *")] SDL_VirtualJoystickDesc* desc);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_IsJoystickVirtual(SDL_JoystickID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickVirtualAxis(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualAxis(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16")] short value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickVirtualBall(SDL_Joystick* joystick, int ball, [NativeTypeName("Sint16")] short xrel, [NativeTypeName("Sint16")] short yrel);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualBall(SDL_Joystick* joystick, int ball, [NativeTypeName("Sint16")] short xrel, [NativeTypeName("Sint16")] short yrel);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickVirtualButton(SDL_Joystick* joystick, int button, [NativeTypeName("Uint8")] byte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualButton(SDL_Joystick* joystick, int button, [NativeTypeName("bool")] SDLBool down);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickVirtualHat(SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualHat(SDL_Joystick* joystick, int hat, [NativeTypeName("Uint8")] byte value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickVirtualTouchpad(SDL_Joystick* joystick, int touchpad, int finger, [NativeTypeName("Uint8")] byte state, float x, float y, float pressure);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickVirtualTouchpad(SDL_Joystick* joystick, int touchpad, int finger, [NativeTypeName("bool")] SDLBool down, float x, float y, float pressure);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SendJoystickVirtualSensorData(SDL_Joystick* joystick, SDL_SensorType type, [NativeTypeName("Uint64")] ulong sensor_timestamp, [NativeTypeName("const float *")] float* data, int num_values);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SendJoystickVirtualSensorData(SDL_Joystick* joystick, SDL_SensorType type, [NativeTypeName("Uint64")] ulong sensor_timestamp, [NativeTypeName("const float *")] float* data, int num_values);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_GetJoystickProperties(SDL_Joystick* joystick);
@ -252,7 +268,8 @@ namespace SDL
public static extern int SDL_GetJoystickPlayerIndex(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickPlayerIndex(SDL_Joystick* joystick, int player_index);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickPlayerIndex(SDL_Joystick* joystick, int player_index);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GUID SDL_GetJoystickGUID(SDL_Joystick* joystick);
@ -284,7 +301,8 @@ namespace SDL
public static extern void SDL_GetJoystickGUIDInfo(SDL_GUID guid, [NativeTypeName("Uint16 *")] ushort* vendor, [NativeTypeName("Uint16 *")] ushort* product, [NativeTypeName("Uint16 *")] ushort* version, [NativeTypeName("Uint16 *")] ushort* crc16);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_JoystickConnected(SDL_Joystick* joystick);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_JoystickConnected(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_JoystickID SDL_GetJoystickID(SDL_Joystick* joystick);
@ -302,10 +320,11 @@ namespace SDL
public static extern int SDL_GetNumJoystickButtons(SDL_Joystick* joystick);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetJoystickEventsEnabled(SDL_bool enabled);
public static extern void SDL_SetJoystickEventsEnabled([NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_JoystickEventsEnabled();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_JoystickEventsEnabled();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UpdateJoysticks();
@ -315,30 +334,36 @@ namespace SDL
public static extern short SDL_GetJoystickAxis(SDL_Joystick* joystick, int axis);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetJoystickAxisInitialState(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetJoystickAxisInitialState(SDL_Joystick* joystick, int axis, [NativeTypeName("Sint16 *")] short* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetJoystickBall(SDL_Joystick* joystick, int ball, int* dx, int* dy);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetJoystickBall(SDL_Joystick* joystick, int ball, int* dx, int* dy);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint8")]
public static extern byte SDL_GetJoystickHat(SDL_Joystick* joystick, int hat);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint8")]
public static extern byte SDL_GetJoystickButton(SDL_Joystick* joystick, int button);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetJoystickButton(SDL_Joystick* joystick, int button);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RumbleJoystick(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RumbleJoystick(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort low_frequency_rumble, [NativeTypeName("Uint16")] ushort high_frequency_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RumbleJoystickTriggers(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RumbleJoystickTriggers(SDL_Joystick* joystick, [NativeTypeName("Uint16")] ushort left_rumble, [NativeTypeName("Uint16")] ushort right_rumble, [NativeTypeName("Uint32")] uint duration_ms);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetJoystickLED(SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetJoystickLED(SDL_Joystick* joystick, [NativeTypeName("Uint8")] byte red, [NativeTypeName("Uint8")] byte green, [NativeTypeName("Uint8")] byte blue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SendJoystickEffect(SDL_Joystick* joystick, [NativeTypeName("const void *")] IntPtr data, int size);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SendJoystickEffect(SDL_Joystick* joystick, [NativeTypeName("const void *")] IntPtr data, int size);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseJoystick(SDL_Joystick* joystick);
@ -355,9 +380,6 @@ namespace SDL
[NativeTypeName("#define SDL_JOYSTICK_AXIS_MIN -32768")]
public const int SDL_JOYSTICK_AXIS_MIN = -32768;
[NativeTypeName("#define SDL_IPHONE_MAX_GFORCE 5.0")]
public const double SDL_IPHONE_MAX_GFORCE = 5.0;
[NativeTypeName("#define SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN \"SDL.joystick.cap.mono_led\"")]
public static ReadOnlySpan<byte> SDL_PROP_JOYSTICK_CAP_MONO_LED_BOOLEAN => "SDL.joystick.cap.mono_led"u8;

View File

@ -52,7 +52,8 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasKeyboard();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasKeyboard();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_KeyboardID* SDL_GetKeyboards(int* count);
@ -65,8 +66,8 @@ namespace SDL
public static extern SDL_Window* SDL_GetKeyboardFocus();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const Uint8 *")]
public static extern byte* SDL_GetKeyboardState(int* numkeys);
[return: NativeTypeName("const bool *")]
public static extern SDLBool* SDL_GetKeyboardState(int* numkeys);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_ResetKeyboard();
@ -78,13 +79,14 @@ namespace SDL
public static extern void SDL_SetModState(SDL_Keymod modstate);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event);
public static extern SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, [NativeTypeName("bool")] SDLBool key_event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod* modstate);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetScancodeName(SDL_Scancode scancode, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetScancodeName(SDL_Scancode scancode, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetScancodeName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
@ -101,31 +103,40 @@ namespace SDL
public static extern SDL_Keycode SDL_GetKeyFromName([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_StartTextInput(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StartTextInput(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_StartTextInputWithProperties(SDL_Window* window, SDL_PropertiesID props);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StartTextInputWithProperties(SDL_Window* window, SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_TextInputActive(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TextInputActive(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_StopTextInput(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StopTextInput(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearComposition(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearComposition(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextInputArea(SDL_Window* window, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextInputArea(SDL_Window* window, SDL_Rect* rect, int* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasScreenKeyboardSupport();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasScreenKeyboardSupport();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_ScreenKeyboardShown(SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ScreenKeyboardShown(SDL_Window* window);
[NativeTypeName("#define SDL_PROP_TEXTINPUT_TYPE_NUMBER \"SDL.textinput.type\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTINPUT_TYPE_NUMBER => "SDL.textinput.type"u8;

View File

@ -27,7 +27,10 @@ namespace SDL
{
public static partial class SDL3
{
[NativeTypeName("#define SDLK_SCANCODE_MASK (1u<<30)")]
[NativeTypeName("#define SDLK_EXTENDED_MASK (1u << 29)")]
public const uint SDLK_EXTENDED_MASK = (1U << 29);
[NativeTypeName("#define SDLK_SCANCODE_MASK (1u << 30)")]
public const uint SDLK_SCANCODE_MASK = (1U << 30);
[NativeTypeName("#define SDLK_UNKNOWN 0x00000000u")]
@ -777,6 +780,27 @@ namespace SDL
[NativeTypeName("#define SDLK_ENDCALL 0x40000122u")]
public const uint SDLK_ENDCALL = 0x40000122U;
[NativeTypeName("#define SDLK_LEFT_TAB 0x20000001u")]
public const uint SDLK_LEFT_TAB = 0x20000001U;
[NativeTypeName("#define SDLK_LEVEL5_SHIFT 0x20000002u")]
public const uint SDLK_LEVEL5_SHIFT = 0x20000002U;
[NativeTypeName("#define SDLK_MULTI_KEY_COMPOSE 0x20000003u")]
public const uint SDLK_MULTI_KEY_COMPOSE = 0x20000003U;
[NativeTypeName("#define SDLK_LMETA 0x20000004u")]
public const uint SDLK_LMETA = 0x20000004U;
[NativeTypeName("#define SDLK_RMETA 0x20000005u")]
public const uint SDLK_RMETA = 0x20000005U;
[NativeTypeName("#define SDLK_LHYPER 0x20000006u")]
public const uint SDLK_LHYPER = 0x20000006U;
[NativeTypeName("#define SDLK_RHYPER 0x20000007u")]
public const uint SDLK_RHYPER = 0x20000007U;
[NativeTypeName("#define SDL_KMOD_NONE 0x0000u")]
public const uint SDL_KMOD_NONE = 0x0000U;
@ -786,6 +810,9 @@ namespace SDL
[NativeTypeName("#define SDL_KMOD_RSHIFT 0x0002u")]
public const uint SDL_KMOD_RSHIFT = 0x0002U;
[NativeTypeName("#define SDL_KMOD_LEVEL5 0x0004u")]
public const uint SDL_KMOD_LEVEL5 = 0x0004U;
[NativeTypeName("#define SDL_KMOD_LCTRL 0x0040u")]
public const uint SDL_KMOD_LCTRL = 0x0040U;

View File

@ -28,17 +28,20 @@ using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_SharedObject
{
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_LoadObject([NativeTypeName("const char *")] byte* sofile);
public static extern SDL_SharedObject* SDL_LoadObject([NativeTypeName("const char *")] byte* sofile);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
public static extern IntPtr SDL_LoadFunction([NativeTypeName("void*")] IntPtr handle, [NativeTypeName("const char *")] byte* name);
public static extern IntPtr SDL_LoadFunction(SDL_SharedObject* handle, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnloadObject([NativeTypeName("void*")] IntPtr handle);
public static extern void SDL_UnloadObject(SDL_SharedObject* handle);
}
}

View File

@ -39,7 +39,7 @@ namespace SDL
SDL_LOG_CATEGORY_RENDER,
SDL_LOG_CATEGORY_INPUT,
SDL_LOG_CATEGORY_TEST,
SDL_LOG_CATEGORY_RESERVED1,
SDL_LOG_CATEGORY_GPU,
SDL_LOG_CATEGORY_RESERVED2,
SDL_LOG_CATEGORY_RESERVED3,
SDL_LOG_CATEGORY_RESERVED4,
@ -54,13 +54,15 @@ namespace SDL
public enum SDL_LogPriority
{
SDL_LOG_PRIORITY_VERBOSE = 1,
SDL_LOG_PRIORITY_INVALID,
SDL_LOG_PRIORITY_TRACE,
SDL_LOG_PRIORITY_VERBOSE,
SDL_LOG_PRIORITY_DEBUG,
SDL_LOG_PRIORITY_INFO,
SDL_LOG_PRIORITY_WARN,
SDL_LOG_PRIORITY_ERROR,
SDL_LOG_PRIORITY_CRITICAL,
SDL_NUM_LOG_PRIORITIES,
SDL_LOG_PRIORITY_COUNT,
}
public static unsafe partial class SDL3
@ -78,11 +80,15 @@ namespace SDL
public static extern void SDL_ResetLogPriorities();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetLogPriorityPrefix(SDL_LogPriority priority, [NativeTypeName("const char *")] byte* prefix);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, [NativeTypeName("const char *")] byte* prefix);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_Log([NativeTypeName("const char *")] byte* fmt, __arglist);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_LogTrace(int category, [NativeTypeName("const char *")] byte* fmt, __arglist);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_LogVerbose(int category, [NativeTypeName("const char *")] byte* fmt, __arglist);
@ -108,9 +114,13 @@ namespace SDL
public static extern void SDL_LogMessageV(int category, SDL_LogPriority priority, [NativeTypeName("const char *")] byte* fmt, [NativeTypeName("va_list")] byte* ap);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction *")] delegate* unmanaged[Cdecl]<IntPtr, SDL_LogCategory, SDL_LogPriority, byte*, void>* callback, [NativeTypeName("void **")] IntPtr* userdata);
[return: NativeTypeName("SDL_LogOutputFunction")]
public static extern delegate* unmanaged[Cdecl]<IntPtr, int, SDL_LogPriority, byte*, void> SDL_GetDefaultLogOutputFunction();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction")] delegate* unmanaged[Cdecl]<IntPtr, SDL_LogCategory, SDL_LogPriority, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_GetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction *")] delegate* unmanaged[Cdecl]<IntPtr, int, SDL_LogPriority, byte*, void>* callback, [NativeTypeName("void **")] IntPtr* userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetLogOutputFunction([NativeTypeName("SDL_LogOutputFunction")] delegate* unmanaged[Cdecl]<IntPtr, int, SDL_LogPriority, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
}
}

View File

@ -32,15 +32,12 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern int SDL_RegisterApp([NativeTypeName("const char *")] byte* name, [NativeTypeName("Uint32")] uint style, [NativeTypeName("void*")] IntPtr hInst);
public static extern SDLBool SDL_RegisterApp([NativeTypeName("const char *")] byte* name, [NativeTypeName("Uint32")] uint style, [NativeTypeName("void*")] IntPtr hInst);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern void SDL_UnregisterApp();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern void SDL_GDKSuspendComplete();
}
}

View File

@ -37,6 +37,9 @@ namespace SDL
public static extern int SDL_RunApp(int argc, [NativeTypeName("char *[]")] byte** argv, [NativeTypeName("SDL_main_func")] delegate* unmanaged[Cdecl]<int, byte**, int> mainFunction, [NativeTypeName("void*")] IntPtr reserved);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_EnterAppMainCallbacks(int argc, [NativeTypeName("char *[]")] byte** argv, [NativeTypeName("SDL_AppInit_func")] delegate* unmanaged[Cdecl]<IntPtr*, int, byte**, int> appinit, [NativeTypeName("SDL_AppIterate_func")] delegate* unmanaged[Cdecl]<IntPtr, int> appiter, [NativeTypeName("SDL_AppEvent_func")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, int> appevent, [NativeTypeName("SDL_AppQuit_func")] delegate* unmanaged[Cdecl]<IntPtr, void> appquit);
public static extern int SDL_EnterAppMainCallbacks(int argc, [NativeTypeName("char *[]")] byte** argv, [NativeTypeName("SDL_AppInit_func")] delegate* unmanaged[Cdecl]<IntPtr*, int, byte**, SDL_AppResult> appinit, [NativeTypeName("SDL_AppIterate_func")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AppResult> appiter, [NativeTypeName("SDL_AppEvent_func")] delegate* unmanaged[Cdecl]<IntPtr, SDL_Event*, SDL_AppResult> appevent, [NativeTypeName("SDL_AppQuit_func")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AppResult, void> appquit);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GDKSuspendComplete();
}
}

View File

@ -57,7 +57,7 @@ namespace SDL
SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
SDL_MESSAGEBOX_COLOR_MAX,
SDL_MESSAGEBOX_COLOR_COUNT,
}
public partial struct SDL_MessageBoxColorScheme
@ -96,10 +96,12 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ShowMessageBox([NativeTypeName("const SDL_MessageBoxData *")] SDL_MessageBoxData* messageboxdata, int* buttonid);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowMessageBox([NativeTypeName("const SDL_MessageBoxData *")] SDL_MessageBoxData* messageboxdata, int* buttonid);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, [NativeTypeName("const char *")] byte* title, [NativeTypeName("const char *")] byte* message, SDL_Window* window);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, [NativeTypeName("const char *")] byte* title, [NativeTypeName("const char *")] byte* message, SDL_Window* window);
[NativeTypeName("#define SDL_MESSAGEBOX_ERROR 0x00000010u")]
public const uint SDL_MESSAGEBOX_ERROR = 0x00000010U;

View File

@ -30,6 +30,7 @@ namespace SDL
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_OpenURL([NativeTypeName("const char *")] byte* url);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_OpenURL([NativeTypeName("const char *")] byte* url);
}
}

View File

@ -23,6 +23,7 @@
3. This notice may not be removed or altered from any source distribution.
*/
using System;
using System.Runtime.InteropServices;
namespace SDL
@ -53,7 +54,7 @@ namespace SDL
SDL_SYSTEM_CURSOR_S_RESIZE,
SDL_SYSTEM_CURSOR_SW_RESIZE,
SDL_SYSTEM_CURSOR_W_RESIZE,
SDL_NUM_SYSTEM_CURSORS,
SDL_SYSTEM_CURSOR_COUNT,
}
public enum SDL_MouseWheelDirection
@ -62,10 +63,19 @@ namespace SDL
SDL_MOUSEWHEEL_FLIPPED,
}
public unsafe partial struct SDL_CursorFrameInfo
{
public SDL_Surface* surface;
[NativeTypeName("Uint32")]
public uint duration;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasMouse();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasMouse();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_MouseID* SDL_GetMice(int* count);
@ -90,16 +100,24 @@ namespace SDL
public static extern void SDL_WarpMouseInWindow(SDL_Window* window, float x, float y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WarpMouseGlobal(float x, float y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WarpMouseGlobal(float x, float y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRelativeMouseMode(SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRelativeMouseTransform([NativeTypeName("SDL_MouseMotionTransformCallback")] delegate* unmanaged[Cdecl]<IntPtr, ulong, SDL_Window*, SDL_MouseID, float*, float*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CaptureMouse(SDL_bool enabled);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetWindowRelativeMouseMode(SDL_Window* window, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRelativeMouseMode();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetWindowRelativeMouseMode(SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CaptureMouse([NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y);
@ -107,11 +125,15 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateAnimatedCursor(SDL_CursorFrameInfo* frames, int frame_count, int hot_x, int hot_y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetCursor(SDL_Cursor* cursor);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetCursor(SDL_Cursor* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Cursor* SDL_GetCursor();
@ -123,13 +145,16 @@ namespace SDL
public static extern void SDL_DestroyCursor(SDL_Cursor* cursor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ShowCursor();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShowCursor();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_HideCursor();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HideCursor();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_CursorVisible();
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CursorVisible();
[NativeTypeName("#define SDL_BUTTON_LEFT 1")]
public const int SDL_BUTTON_LEFT = 1;
@ -146,19 +171,19 @@ namespace SDL
[NativeTypeName("#define SDL_BUTTON_X2 5")]
public const int SDL_BUTTON_X2 = 5;
[NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)")]
[NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON_MASK(SDL_BUTTON_LEFT)")]
public const uint SDL_BUTTON_LMASK = (1U << ((1) - 1));
[NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)")]
[NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON_MASK(SDL_BUTTON_MIDDLE)")]
public const uint SDL_BUTTON_MMASK = (1U << ((2) - 1));
[NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)")]
[NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON_MASK(SDL_BUTTON_RIGHT)")]
public const uint SDL_BUTTON_RMASK = (1U << ((3) - 1));
[NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)")]
[NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON_MASK(SDL_BUTTON_X1)")]
public const uint SDL_BUTTON_X1MASK = (1U << ((4) - 1));
[NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)")]
[NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON_MASK(SDL_BUTTON_X2)")]
public const uint SDL_BUTTON_X2MASK = (1U << ((5) - 1));
}
}

View File

@ -23,6 +23,7 @@
3. This notice may not be removed or altered from any source distribution.
*/
using System;
using System.Runtime.InteropServices;
namespace SDL
@ -43,6 +44,24 @@ namespace SDL
{
}
public enum SDL_InitStatus
{
SDL_INIT_STATUS_UNINITIALIZED,
SDL_INIT_STATUS_INITIALIZING,
SDL_INIT_STATUS_INITIALIZED,
SDL_INIT_STATUS_UNINITIALIZING,
}
public partial struct SDL_InitState
{
public SDL_AtomicInt status;
public SDL_ThreadID thread;
[NativeTypeName("void*")]
public IntPtr reserved;
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -52,7 +71,8 @@ namespace SDL
public static extern void SDL_LockMutex(SDL_Mutex* mutex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_TryLockMutex(SDL_Mutex* mutex);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockMutex(SDL_Mutex* mutex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockMutex(SDL_Mutex* mutex);
@ -70,10 +90,12 @@ namespace SDL
public static extern void SDL_LockRWLockForWriting(SDL_RWLock* rwlock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_TryLockRWLockForReading(SDL_RWLock* rwlock);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockRWLockForReading(SDL_RWLock* rwlock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_TryLockRWLockForWriting(SDL_RWLock* rwlock);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryLockRWLockForWriting(SDL_RWLock* rwlock);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockRWLock(SDL_RWLock* rwlock);
@ -88,16 +110,18 @@ namespace SDL
public static extern void SDL_DestroySemaphore(SDL_Semaphore* sem);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WaitSemaphore(SDL_Semaphore* sem);
public static extern void SDL_WaitSemaphore(SDL_Semaphore* sem);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_TryWaitSemaphore(SDL_Semaphore* sem);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_TryWaitSemaphore(SDL_Semaphore* sem);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WaitSemaphoreTimeout(SDL_Semaphore* sem, [NativeTypeName("Sint32")] int timeoutMS);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitSemaphoreTimeout(SDL_Semaphore* sem, [NativeTypeName("Sint32")] int timeoutMS);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SignalSemaphore(SDL_Semaphore* sem);
public static extern void SDL_SignalSemaphore(SDL_Semaphore* sem);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
@ -110,21 +134,27 @@ namespace SDL
public static extern void SDL_DestroyCondition(SDL_Condition* cond);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SignalCondition(SDL_Condition* cond);
public static extern void SDL_SignalCondition(SDL_Condition* cond);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BroadcastCondition(SDL_Condition* cond);
public static extern void SDL_BroadcastCondition(SDL_Condition* cond);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WaitCondition(SDL_Condition* cond, SDL_Mutex* mutex);
public static extern void SDL_WaitCondition(SDL_Condition* cond, SDL_Mutex* mutex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WaitConditionTimeout(SDL_Condition* cond, SDL_Mutex* mutex, [NativeTypeName("Sint32")] int timeoutMS);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitConditionTimeout(SDL_Condition* cond, SDL_Mutex* mutex, [NativeTypeName("Sint32")] int timeoutMS);
[NativeTypeName("#define SDL_MUTEX_TIMEDOUT 1")]
public const int SDL_MUTEX_TIMEDOUT = 1;
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShouldInit(SDL_InitState* state);
[NativeTypeName("#define SDL_RWLOCK_TIMEDOUT SDL_MUTEX_TIMEDOUT")]
public const int SDL_RWLOCK_TIMEDOUT = 1;
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ShouldQuit(SDL_InitState* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_SetInitialized(SDL_InitState* state, [NativeTypeName("bool")] SDLBool initialized);
}
}

View File

@ -24,124 +24,56 @@
*/
using System.Runtime.InteropServices;
using static SDL.SDL_PenAxis;
namespace SDL
{
public enum SDL_PenAxis
{
SDL_PEN_AXIS_PRESSURE = 0,
SDL_PEN_AXIS_PRESSURE,
SDL_PEN_AXIS_XTILT,
SDL_PEN_AXIS_YTILT,
SDL_PEN_AXIS_DISTANCE,
SDL_PEN_AXIS_ROTATION,
SDL_PEN_AXIS_SLIDER,
SDL_PEN_NUM_AXES,
SDL_PEN_AXIS_LAST = SDL_PEN_NUM_AXES - 1,
SDL_PEN_AXIS_TANGENTIAL_PRESSURE,
SDL_PEN_AXIS_COUNT,
}
public enum SDL_PenSubtype
public enum SDL_PenDeviceType
{
SDL_PEN_TYPE_UNKNOWN = 0,
SDL_PEN_TYPE_ERASER = 1,
SDL_PEN_TYPE_PEN,
SDL_PEN_TYPE_PENCIL,
SDL_PEN_TYPE_BRUSH,
SDL_PEN_TYPE_AIRBRUSH,
SDL_PEN_TYPE_LAST = SDL_PEN_TYPE_AIRBRUSH,
SDL_PEN_DEVICE_TYPE_INVALID = -1,
SDL_PEN_DEVICE_TYPE_UNKNOWN,
SDL_PEN_DEVICE_TYPE_DIRECT,
SDL_PEN_DEVICE_TYPE_INDIRECT,
}
public partial struct SDL_PenCapabilityInfo
{
public float max_tilt;
[NativeTypeName("Uint32")]
public uint wacom_id;
[NativeTypeName("Sint8")]
public sbyte num_buttons;
}
public static unsafe partial class SDL3
public static partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PenID* SDL_GetPens(int* count);
public static extern SDL_PenDeviceType SDL_GetPenDeviceType(SDL_PenID instance_id);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_GetPenStatus(SDL_PenID instance_id, float* x, float* y, float* axes, [NativeTypeName("size_t")] nuint num_axes);
[NativeTypeName("#define SDL_PEN_INPUT_DOWN (1u << 0)")]
public const uint SDL_PEN_INPUT_DOWN = (1U << 0);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PenID SDL_GetPenFromGUID(SDL_GUID guid);
[NativeTypeName("#define SDL_PEN_INPUT_BUTTON_1 (1u << 1)")]
public const uint SDL_PEN_INPUT_BUTTON_1 = (1U << 1);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GUID SDL_GetPenGUID(SDL_PenID instance_id);
[NativeTypeName("#define SDL_PEN_INPUT_BUTTON_2 (1u << 2)")]
public const uint SDL_PEN_INPUT_BUTTON_2 = (1U << 2);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_PenConnected(SDL_PenID instance_id);
[NativeTypeName("#define SDL_PEN_INPUT_BUTTON_3 (1u << 3)")]
public const uint SDL_PEN_INPUT_BUTTON_3 = (1U << 3);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetPenName", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetPenName(SDL_PenID instance_id);
[NativeTypeName("#define SDL_PEN_INPUT_BUTTON_4 (1u << 4)")]
public const uint SDL_PEN_INPUT_BUTTON_4 = (1U << 4);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PenCapabilityFlags SDL_GetPenCapabilities(SDL_PenID instance_id, SDL_PenCapabilityInfo* capabilities);
[NativeTypeName("#define SDL_PEN_INPUT_BUTTON_5 (1u << 5)")]
public const uint SDL_PEN_INPUT_BUTTON_5 = (1U << 5);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PenSubtype SDL_GetPenType(SDL_PenID instance_id);
[NativeTypeName("#define SDL_PEN_INPUT_ERASER_TIP (1u << 30)")]
public const uint SDL_PEN_INPUT_ERASER_TIP = (1U << 30);
[NativeTypeName("#define SDL_PEN_INVALID ((SDL_PenID)0)")]
public const SDL_PenID SDL_PEN_INVALID = ((SDL_PenID)(0));
[NativeTypeName("#define SDL_PEN_INFO_UNKNOWN (-1)")]
public const int SDL_PEN_INFO_UNKNOWN = (-1);
[NativeTypeName("#define SDL_PEN_FLAG_DOWN_BIT_INDEX 13")]
public const int SDL_PEN_FLAG_DOWN_BIT_INDEX = 13;
[NativeTypeName("#define SDL_PEN_FLAG_INK_BIT_INDEX 14")]
public const int SDL_PEN_FLAG_INK_BIT_INDEX = 14;
[NativeTypeName("#define SDL_PEN_FLAG_ERASER_BIT_INDEX 15")]
public const int SDL_PEN_FLAG_ERASER_BIT_INDEX = 15;
[NativeTypeName("#define SDL_PEN_FLAG_AXIS_BIT_OFFSET 16")]
public const int SDL_PEN_FLAG_AXIS_BIT_OFFSET = 16;
[NativeTypeName("#define SDL_PEN_TIP_INK SDL_PEN_FLAG_INK_BIT_INDEX")]
public const int SDL_PEN_TIP_INK = 14;
[NativeTypeName("#define SDL_PEN_TIP_ERASER SDL_PEN_FLAG_ERASER_BIT_INDEX")]
public const int SDL_PEN_TIP_ERASER = 15;
[NativeTypeName("#define SDL_PEN_DOWN_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_DOWN_BIT_INDEX)")]
public const uint SDL_PEN_DOWN_MASK = (1U << (13));
[NativeTypeName("#define SDL_PEN_INK_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_INK_BIT_INDEX)")]
public const uint SDL_PEN_INK_MASK = (1U << (14));
[NativeTypeName("#define SDL_PEN_ERASER_MASK SDL_PEN_CAPABILITY(SDL_PEN_FLAG_ERASER_BIT_INDEX)")]
public const uint SDL_PEN_ERASER_MASK = (1U << (15));
[NativeTypeName("#define SDL_PEN_AXIS_PRESSURE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_PRESSURE)")]
public const uint SDL_PEN_AXIS_PRESSURE_MASK = (1U << ((int)(SDL_PEN_AXIS_PRESSURE) + 16));
[NativeTypeName("#define SDL_PEN_AXIS_XTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_XTILT)")]
public const uint SDL_PEN_AXIS_XTILT_MASK = (1U << ((int)(SDL_PEN_AXIS_XTILT) + 16));
[NativeTypeName("#define SDL_PEN_AXIS_YTILT_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_YTILT)")]
public const uint SDL_PEN_AXIS_YTILT_MASK = (1U << ((int)(SDL_PEN_AXIS_YTILT) + 16));
[NativeTypeName("#define SDL_PEN_AXIS_DISTANCE_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_DISTANCE)")]
public const uint SDL_PEN_AXIS_DISTANCE_MASK = (1U << ((int)(SDL_PEN_AXIS_DISTANCE) + 16));
[NativeTypeName("#define SDL_PEN_AXIS_ROTATION_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_ROTATION)")]
public const uint SDL_PEN_AXIS_ROTATION_MASK = (1U << ((int)(SDL_PEN_AXIS_ROTATION) + 16));
[NativeTypeName("#define SDL_PEN_AXIS_SLIDER_MASK SDL_PEN_AXIS_CAPABILITY(SDL_PEN_AXIS_SLIDER)")]
public const uint SDL_PEN_AXIS_SLIDER_MASK = (1U << ((int)(SDL_PEN_AXIS_SLIDER) + 16));
[NativeTypeName("#define SDL_PEN_AXIS_BIDIRECTIONAL_MASKS (SDL_PEN_AXIS_XTILT_MASK | SDL_PEN_AXIS_YTILT_MASK)")]
public const uint SDL_PEN_AXIS_BIDIRECTIONAL_MASKS = ((1U << ((int)(SDL_PEN_AXIS_XTILT) + 16)) | (1U << ((int)(SDL_PEN_AXIS_YTILT) + 16)));
[NativeTypeName("#define SDL_PEN_INPUT_IN_PROXIMITY (1u << 31)")]
public const uint SDL_PEN_INPUT_IN_PROXIMITY = (1U << 31);
}
}

View File

@ -25,8 +25,6 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static SDL.SDL_Colorspace;
using static SDL.SDL_PixelFormat;
namespace SDL
{
@ -91,7 +89,6 @@ namespace SDL
SDL_PACKEDLAYOUT_1010102,
}
[NativeTypeName("int")]
public enum SDL_PixelFormat : uint
{
SDL_PIXELFORMAT_UNKNOWN = 0,
@ -158,6 +155,7 @@ namespace SDL
SDL_PIXELFORMAT_NV21 = 0x3132564eU,
SDL_PIXELFORMAT_P010 = 0x30313050U,
SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fU,
SDL_PIXELFORMAT_MJPG = 0x47504a4dU,
}
public enum SDL_ColorType
@ -242,7 +240,6 @@ namespace SDL
SDL_CHROMA_LOCATION_TOPLEFT = 3,
}
[NativeTypeName("int")]
public enum SDL_Colorspace : uint
{
SDL_COLORSPACE_UNKNOWN = 0,
@ -256,6 +253,8 @@ namespace SDL
SDL_COLORSPACE_BT709_FULL = 0x22100421U,
SDL_COLORSPACE_BT2020_LIMITED = 0x21102609U,
SDL_COLORSPACE_BT2020_FULL = 0x22102609U,
SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB,
SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_BT601_LIMITED,
}
public partial struct SDL_Color
@ -359,7 +358,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetPixelFormatName(SDL_PixelFormat format);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int* bpp, [NativeTypeName("Uint32 *")] uint* Rmask, [NativeTypeName("Uint32 *")] uint* Gmask, [NativeTypeName("Uint32 *")] uint* Bmask, [NativeTypeName("Uint32 *")] uint* Amask);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PixelFormat SDL_GetPixelFormatForMasks(int bpp, [NativeTypeName("Uint32")] uint Rmask, [NativeTypeName("Uint32")] uint Gmask, [NativeTypeName("Uint32")] uint Bmask, [NativeTypeName("Uint32")] uint Amask);
@ -372,7 +372,8 @@ namespace SDL
public static extern SDL_Palette* SDL_CreatePalette(int ncolors);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPaletteColors(SDL_Palette* palette, [NativeTypeName("const SDL_Color *")] SDL_Color* colors, int firstcolor, int ncolors);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyPalette(SDL_Palette* palette);
@ -386,45 +387,21 @@ namespace SDL
public static extern uint SDL_MapRGBA([NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetRGB([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
public static extern void SDL_GetRGB([NativeTypeName("Uint32")] uint pixelvalue, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixel, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
public static extern void SDL_GetRGBA([NativeTypeName("Uint32")] uint pixelvalue, [NativeTypeName("const SDL_PixelFormatDetails *")] SDL_PixelFormatDetails* format, [NativeTypeName("const SDL_Palette *")] SDL_Palette* palette, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[NativeTypeName("#define SDL_ALPHA_OPAQUE 255")]
public const int SDL_ALPHA_OPAQUE = 255;
[NativeTypeName("#define SDL_ALPHA_OPAQUE_FLOAT 1.0f")]
public const float SDL_ALPHA_OPAQUE_FLOAT = 1.0f;
[NativeTypeName("#define SDL_ALPHA_TRANSPARENT 0")]
public const int SDL_ALPHA_TRANSPARENT = 0;
[NativeTypeName("#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ABGR8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888;
[NativeTypeName("#define SDL_PIXELFORMAT_ARGB32 SDL_PIXELFORMAT_BGRA8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888;
[NativeTypeName("#define SDL_PIXELFORMAT_BGRA32 SDL_PIXELFORMAT_ARGB8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888;
[NativeTypeName("#define SDL_PIXELFORMAT_ABGR32 SDL_PIXELFORMAT_RGBA8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888;
[NativeTypeName("#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_XBGR8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888;
[NativeTypeName("#define SDL_PIXELFORMAT_XRGB32 SDL_PIXELFORMAT_BGRX8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888;
[NativeTypeName("#define SDL_PIXELFORMAT_BGRX32 SDL_PIXELFORMAT_XRGB8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888;
[NativeTypeName("#define SDL_PIXELFORMAT_XBGR32 SDL_PIXELFORMAT_RGBX8888")]
public const SDL_PixelFormat SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888;
[NativeTypeName("#define SDL_COLORSPACE_RGB_DEFAULT SDL_COLORSPACE_SRGB")]
public const SDL_Colorspace SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB;
[NativeTypeName("#define SDL_COLORSPACE_YUV_DEFAULT SDL_COLORSPACE_JPEG")]
public const SDL_Colorspace SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_JPEG;
[NativeTypeName("#define SDL_ALPHA_TRANSPARENT_FLOAT 0.0f")]
public const float SDL_ALPHA_TRANSPARENT_FLOAT = 0.0f;
}
}

View File

@ -0,0 +1,126 @@
/*
<auto-generated/>
C# bindings for Simple DirectMedia Layer.
Original copyright notice of input files:
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.
*/
using System;
using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_Process
{
}
public enum SDL_ProcessIO
{
SDL_PROCESS_STDIO_INHERITED,
SDL_PROCESS_STDIO_NULL,
SDL_PROCESS_STDIO_APP,
SDL_PROCESS_STDIO_REDIRECT,
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Process* SDL_CreateProcess([NativeTypeName("const char *const *")] byte** args, [NativeTypeName("bool")] SDLBool pipe_stdio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Process* SDL_CreateProcessWithProperties(SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertiesID SDL_GetProcessProperties(SDL_Process* process);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_ReadProcess(SDL_Process* process, [NativeTypeName("size_t *")] nuint* datasize, int* exitcode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_IOStream* SDL_GetProcessInput(SDL_Process* process);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_IOStream* SDL_GetProcessOutput(SDL_Process* process);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_KillProcess(SDL_Process* process, [NativeTypeName("bool")] SDLBool force);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WaitProcess(SDL_Process* process, [NativeTypeName("bool")] SDLBool block, int* exitcode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyProcess(SDL_Process* process);
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ARGS_POINTER \"SDL.process.create.args\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_ARGS_POINTER => "SDL.process.create.args"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER \"SDL.process.create.environment\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER => "SDL.process.create.environment"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING \"SDL.process.create.working_directory\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING => "SDL.process.create.working_directory"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_NUMBER \"SDL.process.create.stdin_option\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDIN_NUMBER => "SDL.process.create.stdin_option"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDIN_POINTER \"SDL.process.create.stdin_source\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDIN_POINTER => "SDL.process.create.stdin_source"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER \"SDL.process.create.stdout_option\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER => "SDL.process.create.stdout_option"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDOUT_POINTER \"SDL.process.create.stdout_source\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDOUT_POINTER => "SDL.process.create.stdout_source"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_NUMBER \"SDL.process.create.stderr_option\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDERR_NUMBER => "SDL.process.create.stderr_option"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_POINTER \"SDL.process.create.stderr_source\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDERR_POINTER => "SDL.process.create.stderr_source"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN \"SDL.process.create.stderr_to_stdout\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN => "SDL.process.create.stderr_to_stdout"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN \"SDL.process.create.background\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN => "SDL.process.create.background"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_CREATE_CMDLINE_STRING \"SDL.process.create.cmdline\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_CREATE_CMDLINE_STRING => "SDL.process.create.cmdline"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_PID_NUMBER \"SDL.process.pid\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_PID_NUMBER => "SDL.process.pid"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_STDIN_POINTER \"SDL.process.stdin\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_STDIN_POINTER => "SDL.process.stdin"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_STDOUT_POINTER \"SDL.process.stdout\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_STDOUT_POINTER => "SDL.process.stdout"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_STDERR_POINTER \"SDL.process.stderr\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_STDERR_POINTER => "SDL.process.stderr"u8;
[NativeTypeName("#define SDL_PROP_PROCESS_BACKGROUND_BOOLEAN \"SDL.process.background\"")]
public static ReadOnlySpan<byte> SDL_PROP_PROCESS_BACKGROUND_BOOLEAN => "SDL.process.background"u8;
}
}

View File

@ -47,34 +47,43 @@ namespace SDL
public static extern SDL_PropertiesID SDL_CreateProperties();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockProperties(SDL_PropertiesID props);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockProperties(SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockProperties(SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("SDL_CleanupPropertyCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value, [NativeTypeName("SDL_CleanupPropertyCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, void> cleanup, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetPointerProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetPointerProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("void*")] IntPtr value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetStringProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetStringProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetNumberProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("Sint64")] long value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetNumberProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("Sint64")] long value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("bool")] SDLBool value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_PropertyType SDL_GetPropertyType(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
@ -95,15 +104,21 @@ namespace SDL
public static extern float SDL_GetFloatProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, float default_value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, SDL_bool default_value);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetBooleanProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name, [NativeTypeName("bool")] SDLBool default_value);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearProperty(SDL_PropertiesID props, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_EnumerateProperties(SDL_PropertiesID props, [NativeTypeName("SDL_EnumeratePropertiesCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_PropertiesID, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnumerateProperties(SDL_PropertiesID props, [NativeTypeName("SDL_EnumeratePropertiesCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_PropertiesID, byte*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyProperties(SDL_PropertiesID props);
[NativeTypeName("#define SDL_PROP_NAME_STRING \"SDL.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_NAME_STRING => "SDL.name"u8;
}
}

View File

@ -73,69 +73,86 @@ namespace SDL
frect->h = (float)(rect->h);
}
public static SDL_bool SDL_PointInRect([NativeTypeName("const SDL_Point *")] SDL_Point* p, [NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_PointInRect([NativeTypeName("const SDL_Point *")] SDL_Point* p, [NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
{
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x < (r->x + r->w)) && (p->y >= r->y) && (p->y < (r->y + r->h))) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x < (r->x + r->w)) && (p->y >= r->y) && (p->y < (r->y + r->h))) ? true : false;
}
public static SDL_bool SDL_RectEmpty([NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectEmpty([NativeTypeName("const SDL_Rect *")] SDL_Rect* r)
{
return ((r == null) || (r->w <= 0) || (r->h <= 0)) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((r == null) || (r->w <= 0) || (r->h <= 0)) ? true : false;
}
public static SDL_bool SDL_RectsEqual([NativeTypeName("const SDL_Rect *")] SDL_Rect* a, [NativeTypeName("const SDL_Rect *")] SDL_Rect* b)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectsEqual([NativeTypeName("const SDL_Rect *")] SDL_Rect* a, [NativeTypeName("const SDL_Rect *")] SDL_Rect* b)
{
return ((a) != null && (b) != null && (a->x == b->x) && (a->y == b->y) && (a->w == b->w) && (a->h == b->h)) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((a) != null && (b) != null && (a->x == b->x) && (a->y == b->y) && (a->w == b->w) && (a->h == b->h)) ? true : false;
}
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRectUnion([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectUnion([NativeTypeName("const SDL_Rect *")] SDL_Rect* A, [NativeTypeName("const SDL_Rect *")] SDL_Rect* B, SDL_Rect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectEnclosingPoints([NativeTypeName("const SDL_Point *")] SDL_Point* points, int count, [NativeTypeName("const SDL_Rect *")] SDL_Rect* clip, SDL_Rect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectEnclosingPoints([NativeTypeName("const SDL_Point *")] SDL_Point* points, int count, [NativeTypeName("const SDL_Rect *")] SDL_Rect* clip, SDL_Rect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectAndLineIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int* X1, int* Y1, int* X2, int* Y2);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectAndLineIntersection([NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, int* X1, int* Y1, int* X2, int* Y2);
public static SDL_bool SDL_PointInRectFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* p, [NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_PointInRectFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* p, [NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
{
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x <= (r->x + r->w)) && (p->y >= r->y) && (p->y <= (r->y + r->h))) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((p) != null && (r) != null && (p->x >= r->x) && (p->x <= (r->x + r->w)) && (p->y >= r->y) && (p->y <= (r->y + r->h))) ? true : false;
}
public static SDL_bool SDL_RectEmptyFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectEmptyFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* r)
{
return ((r == null) || (r->w < 0.0f) || (r->h < 0.0f)) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((r == null) || (r->w < 0.0f) || (r->h < 0.0f)) ? true : false;
}
public static SDL_bool SDL_RectsEqualEpsilon([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b, [NativeTypeName("const float")] float epsilon)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectsEqualEpsilon([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b, float epsilon)
{
return ((a) != null && (b) != null && ((a == b) || ((SDL_fabsf(a->x - b->x) <= epsilon) && (SDL_fabsf(a->y - b->y) <= epsilon) && (SDL_fabsf(a->w - b->w) <= epsilon) && (SDL_fabsf(a->h - b->h) <= epsilon)))) ? (SDL_bool)(1) : (SDL_bool)(0);
return ((a) != null && (b) != null && ((a == b) || ((SDL_fabsf(a->x - b->x) <= epsilon) && (SDL_fabsf(a->y - b->y) <= epsilon) && (SDL_fabsf(a->w - b->w) <= epsilon) && (SDL_fabsf(a->h - b->h) <= epsilon)))) ? true : false;
}
public static SDL_bool SDL_RectsEqualFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b)
[return: NativeTypeName("bool")]
public static SDLBool SDL_RectsEqualFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* a, [NativeTypeName("const SDL_FRect *")] SDL_FRect* b)
{
return SDL_RectsEqualEpsilon(a, b, 1.1920928955078125e-07F);
}
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_HasRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_HasRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRectUnionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectUnionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* A, [NativeTypeName("const SDL_FRect *")] SDL_FRect* B, SDL_FRect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectEnclosingPointsFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count, [NativeTypeName("const SDL_FRect *")] SDL_FRect* clip, SDL_FRect* result);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectEnclosingPointsFloat([NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count, [NativeTypeName("const SDL_FRect *")] SDL_FRect* clip, SDL_FRect* result);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_GetRectAndLineIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* rect, float* X1, float* Y1, float* X2, float* Y2);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRectAndLineIntersectionFloat([NativeTypeName("const SDL_FRect *")] SDL_FRect* rect, float* X1, float* Y1, float* X2, float* Y2);
}
}

View File

@ -44,6 +44,14 @@ namespace SDL
SDL_TEXTUREACCESS_TARGET,
}
public enum SDL_TextureAddressMode
{
SDL_TEXTURE_ADDRESS_INVALID = -1,
SDL_TEXTURE_ADDRESS_AUTO,
SDL_TEXTURE_ADDRESS_CLAMP,
SDL_TEXTURE_ADDRESS_WRAP,
}
public enum SDL_RendererLogicalPresentation
{
SDL_LOGICAL_PRESENTATION_DISABLED,
@ -58,6 +66,42 @@ namespace SDL
}
public partial struct SDL_Texture
{
public SDL_PixelFormat format;
public int w;
public int h;
public int refcount;
}
public unsafe partial struct SDL_GPURenderStateCreateInfo
{
public SDL_GPUShader* fragment_shader;
[NativeTypeName("Sint32")]
public int num_sampler_bindings;
[NativeTypeName("const SDL_GPUTextureSamplerBinding *")]
public SDL_GPUTextureSamplerBinding* sampler_bindings;
[NativeTypeName("Sint32")]
public int num_storage_textures;
[NativeTypeName("SDL_GPUTexture *const *")]
public SDL_GPUTexture** storage_textures;
[NativeTypeName("Sint32")]
public int num_storage_buffers;
[NativeTypeName("SDL_GPUBuffer *const *")]
public SDL_GPUBuffer** storage_buffers;
public SDL_PropertiesID props;
}
public partial struct SDL_GPURenderState
{
}
@ -71,7 +115,8 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetRenderDriver(int index);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CreateWindowAndRenderer([NativeTypeName("const char *")] byte* title, int width, int height, SDL_WindowFlags window_flags, SDL_Window** window, SDL_Renderer** renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CreateWindowAndRenderer([NativeTypeName("const char *")] byte* title, int width, int height, SDL_WindowFlags window_flags, SDL_Window** window, SDL_Renderer** renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Renderer* SDL_CreateRenderer(SDL_Window* window, [NativeTypeName("const char *")] byte* name);
@ -79,6 +124,12 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Renderer* SDL_CreateRendererWithProperties(SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Renderer* SDL_CreateGPURenderer(SDL_GPUDevice* device, SDL_Window* window);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPUDevice* SDL_GetGPURendererDevice(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Renderer* SDL_CreateSoftwareRenderer(SDL_Surface* surface);
@ -96,10 +147,12 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetCurrentRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetCurrentRenderOutputSize(SDL_Renderer* renderer, int* w, int* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* SDL_CreateTexture(SDL_Renderer* renderer, SDL_PixelFormat format, SDL_TextureAccess access, int w, int h);
@ -117,187 +170,268 @@ namespace SDL
public static extern SDL_Renderer* SDL_GetRendererFromTexture(SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureSize(SDL_Texture* texture, float* w, float* h);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTexturePalette(SDL_Texture* texture, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureColorModFloat(SDL_Texture* texture, float r, float g, float b);
public static extern SDL_Palette* SDL_GetTexturePalette(SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureColorModFloat(SDL_Texture* texture, float* r, float* g, float* b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureColorModFloat(SDL_Texture* texture, float r, float g, float b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureColorMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureAlphaModFloat(SDL_Texture* texture, float alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureColorModFloat(SDL_Texture* texture, float* r, float* g, float* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8")] byte alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureAlphaModFloat(SDL_Texture* texture, float* alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureAlphaModFloat(SDL_Texture* texture, float alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureAlphaMod(SDL_Texture* texture, [NativeTypeName("Uint8 *")] byte* alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureAlphaModFloat(SDL_Texture* texture, float* alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] IntPtr pixels, int pitch);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const void *")] IntPtr pixels, int pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("void **")] IntPtr* pixels, int* pitch);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateYUVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* Uplane, int Upitch, [NativeTypeName("const Uint8 *")] byte* Vplane, int Vpitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UpdateNVTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("const Uint8 *")] byte* Yplane, int Ypitch, [NativeTypeName("const Uint8 *")] byte* UVplane, int UVpitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockTexture(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("void **")] IntPtr* pixels, int* pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockTextureToSurface(SDL_Texture* texture, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, SDL_Surface** surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockTexture(SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Texture* SDL_GetRenderTarget(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderLogicalPresentation(SDL_Renderer* renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderLogicalPresentation(SDL_Renderer* renderer, int w, int h, SDL_RendererLogicalPresentation mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderLogicalPresentation(SDL_Renderer* renderer, int* w, int* h, SDL_RendererLogicalPresentation* mode, SDL_ScaleMode* scale_mode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderLogicalPresentation(SDL_Renderer* renderer, int* w, int* h, SDL_RendererLogicalPresentation* mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderLogicalPresentationRect(SDL_Renderer* renderer, SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderCoordinatesFromWindow(SDL_Renderer* renderer, float window_x, float window_y, float* x, float* y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderCoordinatesFromWindow(SDL_Renderer* renderer, float window_x, float window_y, float* x, float* y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderCoordinatesToWindow(SDL_Renderer* renderer, float x, float y, float* window_x, float* window_y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderCoordinatesToWindow(SDL_Renderer* renderer, float x, float y, float* window_x, float* window_y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertEventToRenderCoordinates(SDL_Renderer* renderer, SDL_Event* @event);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ConvertEventToRenderCoordinates(SDL_Renderer* renderer, SDL_Event* @event);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderViewport(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderViewport(SDL_Renderer* renderer, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderViewport(SDL_Renderer* renderer, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderViewportSet(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderViewportSet(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderSafeArea(SDL_Renderer* renderer, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderSafeArea(SDL_Renderer* renderer, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderClipRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderClipRect(SDL_Renderer* renderer, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderClipRect(SDL_Renderer* renderer, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_RenderClipEnabled(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderClipEnabled(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderScale(SDL_Renderer* renderer, float scaleX, float scaleY);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderScale(SDL_Renderer* renderer, float scaleX, float scaleY);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderScale(SDL_Renderer* renderer, float* scaleX, float* scaleY);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderScale(SDL_Renderer* renderer, float* scaleX, float* scaleY);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderDrawColorFloat(SDL_Renderer* renderer, float r, float g, float b, float a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderDrawColorFloat(SDL_Renderer* renderer, float r, float g, float b, float a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderDrawColor(SDL_Renderer* renderer, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderDrawColorFloat(SDL_Renderer* renderer, float* r, float* g, float* b, float* a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderDrawColorFloat(SDL_Renderer* renderer, float* r, float* g, float* b, float* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderColorScale(SDL_Renderer* renderer, float scale);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderColorScale(SDL_Renderer* renderer, float scale);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderColorScale(SDL_Renderer* renderer, float* scale);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderColorScale(SDL_Renderer* renderer, float* scale);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderClear(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderClear(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderPoint(SDL_Renderer* renderer, float x, float y);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderPoint(SDL_Renderer* renderer, float x, float y);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderPoints(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderLine(SDL_Renderer* renderer, float x1, float y1, float x2, float y2);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderLine(SDL_Renderer* renderer, float x1, float y1, float x2, float y2);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderLines(SDL_Renderer* renderer, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* points, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderFillRect(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderFillRects(SDL_Renderer* renderer, [NativeTypeName("const SDL_FRect *")] SDL_FRect* rects, int count);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderTexture(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderTexture(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderTextureRotated(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, [NativeTypeName("const double")] double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, [NativeTypeName("const SDL_FlipMode")] SDL_FlipMode flip);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderTextureRotated(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, double angle, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* center, SDL_FlipMode flip);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderTextureTiled(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderTextureAffine(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* origin, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* right, [NativeTypeName("const SDL_FPoint *")] SDL_FPoint* down);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderTexture9Grid(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderTextureTiled(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderGeometry(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Vertex *")] SDL_Vertex* vertices, int num_vertices, [NativeTypeName("const int *")] int* indices, int num_indices);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderTexture9Grid(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderGeometryRaw(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_FColor *")] SDL_FColor* color, int color_stride, [NativeTypeName("const float *")] float* uv, int uv_stride, int num_vertices, [NativeTypeName("const void *")] IntPtr indices, int num_indices, int size_indices);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderTexture9GridTiled(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_FRect *")] SDL_FRect* srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, [NativeTypeName("const SDL_FRect *")] SDL_FRect* dstrect, float tileScale);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderGeometry(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const SDL_Vertex *")] SDL_Vertex* vertices, int num_vertices, [NativeTypeName("const int *")] int* indices, int num_indices);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderGeometryRaw(SDL_Renderer* renderer, SDL_Texture* texture, [NativeTypeName("const float *")] float* xy, int xy_stride, [NativeTypeName("const SDL_FColor *")] SDL_FColor* color, int color_stride, [NativeTypeName("const float *")] float* uv, int uv_stride, int num_vertices, [NativeTypeName("const void *")] IntPtr indices, int num_indices, int size_indices);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderTextureAddressMode(SDL_Renderer* renderer, SDL_TextureAddressMode u_mode, SDL_TextureAddressMode v_mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderTextureAddressMode(SDL_Renderer* renderer, SDL_TextureAddressMode* u_mode, SDL_TextureAddressMode* v_mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_RenderReadPixels(SDL_Renderer* renderer, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenderPresent(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderPresent(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyTexture(SDL_Texture* texture);
@ -306,7 +440,8 @@ namespace SDL
public static extern void SDL_DestroyRenderer(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FlushRenderer(SDL_Renderer* renderer);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlushRenderer(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
@ -317,49 +452,97 @@ namespace SDL
public static extern IntPtr SDL_GetRenderMetalCommandEncoder(SDL_Renderer* renderer);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddVulkanRenderSemaphores(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint wait_stage_mask, [NativeTypeName("Sint64")] long wait_semaphore, [NativeTypeName("Sint64")] long signal_semaphore);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AddVulkanRenderSemaphores(SDL_Renderer* renderer, [NativeTypeName("Uint32")] uint wait_stage_mask, [NativeTypeName("Sint64")] long wait_semaphore, [NativeTypeName("Sint64")] long signal_semaphore);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetRenderVSync(SDL_Renderer* renderer, int vsync);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetRenderVSync(SDL_Renderer* renderer, int vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetRenderVSync(SDL_Renderer* renderer, int* vsync);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetRenderVSync(SDL_Renderer* renderer, int* vsync);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderDebugText(SDL_Renderer* renderer, float x, float y, [NativeTypeName("const char *")] byte* str);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenderDebugTextFormat(SDL_Renderer* renderer, float x, float y, [NativeTypeName("const char *")] byte* fmt, __arglist);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetDefaultTextureScaleMode(SDL_Renderer* renderer, SDL_ScaleMode scale_mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetDefaultTextureScaleMode(SDL_Renderer* renderer, SDL_ScaleMode* scale_mode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_GPURenderState* SDL_CreateGPURenderState(SDL_Renderer* renderer, SDL_GPURenderStateCreateInfo* createinfo);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGPURenderStateFragmentUniforms(SDL_GPURenderState* state, [NativeTypeName("Uint32")] uint slot_index, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("Uint32")] uint length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetGPURenderState(SDL_Renderer* renderer, SDL_GPURenderState* state);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyGPURenderState(SDL_GPURenderState* state);
[NativeTypeName("#define SDL_SOFTWARE_RENDERER \"software\"")]
public static ReadOnlySpan<byte> SDL_SOFTWARE_RENDERER => "software"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_NAME_STRING \"name\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_NAME_STRING => "name"u8;
[NativeTypeName("#define SDL_GPU_RENDERER \"gpu\"")]
public static ReadOnlySpan<byte> SDL_GPU_RENDERER => "gpu"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER \"window\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_WINDOW_POINTER => "window"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_NAME_STRING \"SDL.renderer.create.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_NAME_STRING => "SDL.renderer.create.name"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER \"surface\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_SURFACE_POINTER => "surface"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER \"SDL.renderer.create.window\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_WINDOW_POINTER => "SDL.renderer.create.window"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER \"output_colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER => "output_colorspace"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER \"SDL.renderer.create.surface\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_SURFACE_POINTER => "SDL.renderer.create.surface"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"present_vsync\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "present_vsync"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER \"SDL.renderer.create.output_colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER => "SDL.renderer.create.output_colorspace"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER \"vulkan.instance\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER => "vulkan.instance"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER \"SDL.renderer.create.present_vsync\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER => "SDL.renderer.create.present_vsync"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER \"vulkan.surface\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER => "vulkan.surface"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTER \"SDL.renderer.create.gpu.device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTER => "SDL.renderer.create.gpu.device"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER \"vulkan.physical_device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER => "vulkan.physical_device"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN \"SDL.renderer.create.gpu.shaders_spirv\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEAN => "SDL.renderer.create.gpu.shaders_spirv"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER \"vulkan.device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER => "vulkan.device"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN \"SDL.renderer.create.gpu.shaders_dxil\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEAN => "SDL.renderer.create.gpu.shaders_dxil"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER \"vulkan.graphics_queue_family_index\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER => "vulkan.graphics_queue_family_index"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN \"SDL.renderer.create.gpu.shaders_msl\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEAN => "SDL.renderer.create.gpu.shaders_msl"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER \"vulkan.present_queue_family_index\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER => "vulkan.present_queue_family_index"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER \"SDL.renderer.create.vulkan.instance\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER => "SDL.renderer.create.vulkan.instance"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER \"SDL.renderer.create.vulkan.surface\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER => "SDL.renderer.create.vulkan.surface"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER \"SDL.renderer.create.vulkan.physical_device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER => "SDL.renderer.create.vulkan.physical_device"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER \"SDL.renderer.create.vulkan.device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER => "SDL.renderer.create.vulkan.device"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER \"SDL.renderer.create.vulkan.graphics_queue_family_index\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER => "SDL.renderer.create.vulkan.graphics_queue_family_index"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER \"SDL.renderer.create.vulkan.present_queue_family_index\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER => "SDL.renderer.create.vulkan.present_queue_family_index"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_NAME_STRING \"SDL.renderer.name\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_NAME_STRING => "SDL.renderer.name"u8;
@ -379,6 +562,9 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER \"SDL.renderer.texture_formats\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER => "SDL.renderer.texture_formats"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN \"SDL.renderer.texture_wrapping\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEAN => "SDL.renderer.texture_wrapping"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER \"SDL.renderer.output_colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER => "SDL.renderer.output_colorspace"u8;
@ -430,74 +616,92 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER \"SDL.renderer.vulkan.swapchain_image_count\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBER => "SDL.renderer.vulkan.swapchain_image_count"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER \"colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER => "colorspace"u8;
[NativeTypeName("#define SDL_PROP_RENDERER_GPU_DEVICE_POINTER \"SDL.renderer.gpu.device\"")]
public static ReadOnlySpan<byte> SDL_PROP_RENDERER_GPU_DEVICE_POINTER => "SDL.renderer.gpu.device"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER \"format\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER => "format"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER \"SDL.texture.create.colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER => "SDL.texture.create.colorspace"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER \"access\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER => "access"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER \"SDL.texture.create.format\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER => "SDL.texture.create.format"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER \"width\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER => "width"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER \"SDL.texture.create.access\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER => "SDL.texture.create.access"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER \"height\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => "height"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER \"SDL.texture.create.width\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER => "SDL.texture.create.width"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT \"SDR_white_point\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => "SDR_white_point"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER \"SDL.texture.create.height\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER => "SDL.texture.create.height"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT \"HDR_headroom\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT => "HDR_headroom"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER \"SDL.texture.create.palette\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_PALETTE_POINTER => "SDL.texture.create.palette"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER \"d3d11.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER => "d3d11.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT \"SDL.texture.create.SDR_white_point\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_SDR_WHITE_POINT_FLOAT => "SDL.texture.create.SDR_white_point"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER \"d3d11.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER => "d3d11.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT \"SDL.texture.create.HDR_headroom\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_HDR_HEADROOM_FLOAT => "SDL.texture.create.HDR_headroom"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER \"d3d11.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER => "d3d11.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER \"SDL.texture.create.d3d11.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_POINTER => "SDL.texture.create.d3d11.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER \"d3d12.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER => "d3d12.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER \"SDL.texture.create.d3d11.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_U_POINTER => "SDL.texture.create.d3d11.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER \"d3d12.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER => "d3d12.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER \"SDL.texture.create.d3d11.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D11_TEXTURE_V_POINTER => "SDL.texture.create.d3d11.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER \"d3d12.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER => "d3d12.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER \"SDL.texture.create.d3d12.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_POINTER => "SDL.texture.create.d3d12.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER \"metal.pixelbuffer\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER => "metal.pixelbuffer"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER \"SDL.texture.create.d3d12.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_U_POINTER => "SDL.texture.create.d3d12.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER \"opengl.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER => "opengl.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER \"SDL.texture.create.d3d12.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_D3D12_TEXTURE_V_POINTER => "SDL.texture.create.d3d12.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER \"opengl.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER => "opengl.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER \"SDL.texture.create.metal.pixelbuffer\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER => "SDL.texture.create.metal.pixelbuffer"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER \"opengl.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER => "opengl.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER \"SDL.texture.create.opengl.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_NUMBER => "SDL.texture.create.opengl.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER \"opengl.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER => "opengl.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER \"SDL.texture.create.opengl.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_UV_NUMBER => "SDL.texture.create.opengl.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER \"opengles2.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER => "opengles2.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER \"SDL.texture.create.opengl.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_U_NUMBER => "SDL.texture.create.opengl.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER \"opengles2.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER => "opengles2.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER \"SDL.texture.create.opengl.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGL_TEXTURE_V_NUMBER => "SDL.texture.create.opengl.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER \"opengles2.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER => "opengles2.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER \"SDL.texture.create.opengles2.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_NUMBER => "SDL.texture.create.opengles2.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER \"opengles2.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER => "opengles2.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER \"SDL.texture.create.opengles2.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_UV_NUMBER => "SDL.texture.create.opengles2.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER \"vulkan.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => "vulkan.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER \"SDL.texture.create.opengles2.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_U_NUMBER => "SDL.texture.create.opengles2.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER \"SDL.texture.create.opengles2.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_OPENGLES2_TEXTURE_V_NUMBER => "SDL.texture.create.opengles2.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER \"SDL.texture.create.vulkan.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_VULKAN_TEXTURE_NUMBER => "SDL.texture.create.vulkan.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER \"SDL.texture.create.gpu.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER => "SDL.texture.create.gpu.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER \"SDL.texture.create.gpu.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_POINTER => "SDL.texture.create.gpu.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER \"SDL.texture.create.gpu.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_POINTER => "SDL.texture.create.gpu.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER \"SDL.texture.create.gpu.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_POINTER => "SDL.texture.create.gpu.texture_v"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_COLORSPACE_NUMBER \"SDL.texture.colorspace\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_COLORSPACE_NUMBER => "SDL.texture.colorspace"u8;
@ -577,10 +781,25 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER \"SDL.texture.vulkan.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBER => "SDL.texture.vulkan.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER \"SDL.texture.gpu.texture\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_POINTER => "SDL.texture.gpu.texture"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER \"SDL.texture.gpu.texture_uv\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTER => "SDL.texture.gpu.texture_uv"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER \"SDL.texture.gpu.texture_u\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTER => "SDL.texture.gpu.texture_u"u8;
[NativeTypeName("#define SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER \"SDL.texture.gpu.texture_v\"")]
public static ReadOnlySpan<byte> SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER => "SDL.texture.gpu.texture_v"u8;
[NativeTypeName("#define SDL_RENDERER_VSYNC_DISABLED 0")]
public const int SDL_RENDERER_VSYNC_DISABLED = 0;
[NativeTypeName("#define SDL_RENDERER_VSYNC_ADAPTIVE (-1)")]
public const int SDL_RENDERER_VSYNC_ADAPTIVE = (-1);
[NativeTypeName("#define SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE 8")]
public const int SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE = 8;
}
}

View File

@ -275,6 +275,6 @@ namespace SDL
SDL_SCANCODE_CALL = 289,
SDL_SCANCODE_ENDCALL = 290,
SDL_SCANCODE_RESERVED = 400,
SDL_NUM_SCANCODES = 512,
SDL_SCANCODE_COUNT = 512,
}
}

View File

@ -41,6 +41,7 @@ namespace SDL
SDL_SENSOR_GYRO_L,
SDL_SENSOR_ACCEL_R,
SDL_SENSOR_GYRO_R,
SDL_SENSOR_COUNT,
}
public static unsafe partial class SDL3
@ -81,7 +82,8 @@ namespace SDL
public static extern SDL_SensorID SDL_GetSensorID(SDL_Sensor* sensor);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSensorData(SDL_Sensor* sensor, float* data, int num_values);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSensorData(SDL_Sensor* sensor, float* data, int num_values);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_CloseSensor(SDL_Sensor* sensor);

View File

@ -28,11 +28,24 @@ using System.Runtime.InteropServices;
namespace SDL
{
public partial struct SDL_alignment_test
{
[NativeTypeName("Uint8")]
public byte a;
[NativeTypeName("void*")]
public IntPtr b;
}
public enum SDL_DUMMY_ENUM
{
DUMMY_ENUM_VALUE,
}
public partial struct SDL_Environment
{
}
public partial struct SDL_iconv_data_t
{
}
@ -61,7 +74,8 @@ namespace SDL
public static extern void SDL_GetMemoryFunctions([NativeTypeName("SDL_malloc_func *")] delegate* unmanaged[Cdecl]<nuint, IntPtr>* malloc_func, [NativeTypeName("SDL_calloc_func *")] delegate* unmanaged[Cdecl]<nuint, nuint, IntPtr>* calloc_func, [NativeTypeName("SDL_realloc_func *")] delegate* unmanaged[Cdecl]<IntPtr, nuint, IntPtr>* realloc_func, [NativeTypeName("SDL_free_func *")] delegate* unmanaged[Cdecl]<IntPtr, void>* free_func);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl]<nuint, IntPtr> malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl]<nuint, nuint, IntPtr> calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl]<IntPtr, nuint, IntPtr> realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl]<IntPtr, void> free_func);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetMemoryFunctions([NativeTypeName("SDL_malloc_func")] delegate* unmanaged[Cdecl]<nuint, IntPtr> malloc_func, [NativeTypeName("SDL_calloc_func")] delegate* unmanaged[Cdecl]<nuint, nuint, IntPtr> calloc_func, [NativeTypeName("SDL_realloc_func")] delegate* unmanaged[Cdecl]<IntPtr, nuint, IntPtr> realloc_func, [NativeTypeName("SDL_free_func")] delegate* unmanaged[Cdecl]<IntPtr, void> free_func);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
@ -73,15 +87,44 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetNumAllocations();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Environment* SDL_GetEnvironment();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Environment* SDL_CreateEnvironment([NativeTypeName("bool")] SDLBool populated);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetEnvironmentVariable", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_GetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("char **")]
public static extern byte** SDL_GetEnvironmentVariables(SDL_Environment* env);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, [NativeTypeName("bool")] SDLBool overwrite);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_UnsetEnvironmentVariable(SDL_Environment* env, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_DestroyEnvironment(SDL_Environment* env);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_getenv", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_getenv([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_setenv([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, int overwrite);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_getenv_unsafe", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern byte* Unsafe_SDL_getenv_unsafe([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_unsetenv([NativeTypeName("const char *")] byte* name);
public static extern int SDL_setenv_unsafe([NativeTypeName("const char *")] byte* name, [NativeTypeName("const char *")] byte* value, int overwrite);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_unsetenv_unsafe([NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_qsort([NativeTypeName("void*")] IntPtr @base, [NativeTypeName("size_t")] nuint nmemb, [NativeTypeName("size_t")] nuint size, [NativeTypeName("SDL_CompareCallback")] delegate* unmanaged[Cdecl]<IntPtr, IntPtr, int> compare);
@ -150,6 +193,10 @@ namespace SDL
[return: NativeTypeName("Uint32")]
public static extern uint SDL_crc32([NativeTypeName("Uint32")] uint crc, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint len);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_murmur3_32([NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint len, [NativeTypeName("Uint32")] uint seed);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("void*")]
public static extern IntPtr SDL_memcpy([NativeTypeName("void*")] IntPtr dst, [NativeTypeName("const void *")] IntPtr src, [NativeTypeName("size_t")] nuint len);
@ -275,7 +322,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strtok_r", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_strtok_r([NativeTypeName("char *")] byte* s1, [NativeTypeName("const char *")] byte* s2, [NativeTypeName("char **")] byte** saveptr);
public static extern byte* Unsafe_SDL_strtok_r([NativeTypeName("char *")] byte* str, [NativeTypeName("const char *")] byte* delim, [NativeTypeName("char **")] byte** saveptr);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("size_t")]
@ -291,7 +338,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_uitoa", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_uitoa([NativeTypeName("unsigned int")] uint value, [NativeTypeName("char *")] byte* str, int radix);
public static extern byte* Unsafe_SDL_uitoa(uint value, [NativeTypeName("char *")] byte* str, int radix);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ltoa", ExactSpelling = true)]
[return: NativeTypeName("char *")]
@ -303,11 +350,11 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_lltoa", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_lltoa([NativeTypeName("Sint64")] long value, [NativeTypeName("char *")] byte* str, int radix);
public static extern byte* Unsafe_SDL_lltoa([NativeTypeName("long long")] long value, [NativeTypeName("char *")] byte* str, int radix);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_ulltoa", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_ulltoa([NativeTypeName("Uint64")] ulong value, [NativeTypeName("char *")] byte* str, int radix);
public static extern byte* Unsafe_SDL_ulltoa([NativeTypeName("unsigned long long")] ulong value, [NativeTypeName("char *")] byte* str, int radix);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_atoi([NativeTypeName("const char *")] byte* str);
@ -324,11 +371,11 @@ namespace SDL
public static extern uint SDL_strtoul([NativeTypeName("const char *")] byte* str, [NativeTypeName("char **")] byte** endp, int @base);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Sint64")]
[return: NativeTypeName("long long")]
public static extern long SDL_strtoll([NativeTypeName("const char *")] byte* str, [NativeTypeName("char **")] byte** endp, int @base);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint64")]
[return: NativeTypeName("unsigned long long")]
public static extern ulong SDL_strtoull([NativeTypeName("const char *")] byte* str, [NativeTypeName("char **")] byte** endp, int @base);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
@ -346,10 +393,18 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_strncasecmp([NativeTypeName("const char *")] byte* str1, [NativeTypeName("const char *")] byte* str2, [NativeTypeName("size_t")] nuint maxlen);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_strpbrk", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_strpbrk([NativeTypeName("const char *")] byte* str, [NativeTypeName("const char *")] byte* breakset);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_StepUTF8([NativeTypeName("const char **")] byte** pstr, [NativeTypeName("size_t *")] nuint* pslen);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
public static extern uint SDL_StepBackUTF8([NativeTypeName("const char *")] byte* start, [NativeTypeName("const char **")] byte** pstr);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_UCS4ToUTF8", ExactSpelling = true)]
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_UCS4ToUTF8([NativeTypeName("Uint32")] uint codepoint, [NativeTypeName("char *")] byte* dst);
@ -564,37 +619,6 @@ namespace SDL
[return: NativeTypeName("char *")]
public static extern byte* Unsafe_SDL_iconv_string([NativeTypeName("const char *")] byte* tocode, [NativeTypeName("const char *")] byte* fromcode, [NativeTypeName("const char *")] byte* inbuf, [NativeTypeName("size_t")] nuint inbytesleft);
public static int SDL_size_mul_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret)
{
if (a != 0 && b > 0xffffffffffffffffUL / a)
{
return -1;
}
*ret = a * b;
return 0;
}
public static int SDL_size_add_overflow([NativeTypeName("size_t")] nuint a, [NativeTypeName("size_t")] nuint b, [NativeTypeName("size_t *")] nuint* ret)
{
if (b > 0xffffffffffffffffUL - a)
{
return -1;
}
*ret = a + b;
return 0;
}
[NativeTypeName("#define SDL_SIZE_MAX SIZE_MAX")]
public const ulong SDL_SIZE_MAX = 0xffffffffffffffffUL;
[NativeTypeName("#define SDL_FALSE (SDL_bool)0")]
public const SDL_bool SDL_FALSE = (SDL_bool)(0);
[NativeTypeName("#define SDL_TRUE (SDL_bool)1")]
public const SDL_bool SDL_TRUE = (SDL_bool)(1);
[NativeTypeName("#define SDL_MAX_SINT8 ((Sint8)0x7F)")]
public const sbyte SDL_MAX_SINT8 = ((sbyte)(0x7F));
@ -632,38 +656,26 @@ namespace SDL
public const uint SDL_MIN_UINT32 = ((uint)(0x00000000));
[NativeTypeName("#define SDL_MAX_SINT64 SDL_SINT64_C(0x7FFFFFFFFFFFFFFF)")]
public const long SDL_MAX_SINT64 = (0x7FFFFFFFFFFFFFFFL);
public const long SDL_MAX_SINT64 = 0x7FFFFFFFFFFFFFFFL;
[NativeTypeName("#define SDL_MIN_SINT64 ~SDL_SINT64_C(0x7FFFFFFFFFFFFFFF)")]
public const long SDL_MIN_SINT64 = ~(0x7FFFFFFFFFFFFFFFL);
public const long SDL_MIN_SINT64 = ~0x7FFFFFFFFFFFFFFFL;
[NativeTypeName("#define SDL_MAX_UINT64 SDL_UINT64_C(0xFFFFFFFFFFFFFFFF)")]
public const ulong SDL_MAX_UINT64 = (0xFFFFFFFFFFFFFFFFUL);
public const ulong SDL_MAX_UINT64 = 0xFFFFFFFFFFFFFFFFUL;
[NativeTypeName("#define SDL_MIN_UINT64 SDL_UINT64_C(0x0000000000000000)")]
public const ulong SDL_MIN_UINT64 = (0x0000000000000000UL);
public const ulong SDL_MIN_UINT64 = 0x0000000000000000UL;
[NativeTypeName("#define SDL_MAX_TIME SDL_MAX_SINT64")]
public const long SDL_MAX_TIME = (0x7FFFFFFFFFFFFFFFL);
public const long SDL_MAX_TIME = 0x7FFFFFFFFFFFFFFFL;
[NativeTypeName("#define SDL_MIN_TIME SDL_MIN_SINT64")]
public const long SDL_MIN_TIME = ~(0x7FFFFFFFFFFFFFFFL);
public const long SDL_MIN_TIME = ~0x7FFFFFFFFFFFFFFFL;
[NativeTypeName("#define SDL_FLT_EPSILON 1.1920928955078125e-07F")]
public const float SDL_FLT_EPSILON = 1.1920928955078125e-07F;
[NativeTypeName("#define SDL_PRIs64 \"lld\"")]
public static ReadOnlySpan<byte> SDL_PRIs64 => "lld"u8;
[NativeTypeName("#define SDL_PRIu64 \"llu\"")]
public static ReadOnlySpan<byte> SDL_PRIu64 => "llu"u8;
[NativeTypeName("#define SDL_PRIx64 \"llx\"")]
public static ReadOnlySpan<byte> SDL_PRIx64 => "llx"u8;
[NativeTypeName("#define SDL_PRIX64 \"llX\"")]
public static ReadOnlySpan<byte> SDL_PRIX64 => "llX"u8;
[NativeTypeName("#define SDL_PRIs32 \"d\"")]
public static ReadOnlySpan<byte> SDL_PRIs32 => "d"u8;
@ -676,6 +688,21 @@ namespace SDL
[NativeTypeName("#define SDL_PRIX32 \"X\"")]
public static ReadOnlySpan<byte> SDL_PRIX32 => "X"u8;
[NativeTypeName("#define SDL_PRILL_PREFIX \"ll\"")]
public static ReadOnlySpan<byte> SDL_PRILL_PREFIX => "ll"u8;
[NativeTypeName("#define SDL_PRILLd SDL_PRILL_PREFIX \"d\"")]
public static ReadOnlySpan<byte> SDL_PRILLd => "lld"u8;
[NativeTypeName("#define SDL_PRILLu SDL_PRILL_PREFIX \"u\"")]
public static ReadOnlySpan<byte> SDL_PRILLu => "llu"u8;
[NativeTypeName("#define SDL_PRILLx SDL_PRILL_PREFIX \"x\"")]
public static ReadOnlySpan<byte> SDL_PRILLx => "llx"u8;
[NativeTypeName("#define SDL_PRILLX SDL_PRILL_PREFIX \"X\"")]
public static ReadOnlySpan<byte> SDL_PRILLX => "llX"u8;
[NativeTypeName("#define SDL_INVALID_UNICODE_CODEPOINT 0xFFFD")]
public const int SDL_INVALID_UNICODE_CODEPOINT = 0xFFFD;

View File

@ -30,35 +30,38 @@ namespace SDL
{
public unsafe partial struct SDL_StorageInterface
{
[NativeTypeName("int (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, int> close;
[NativeTypeName("Uint32")]
public uint version;
[NativeTypeName("SDL_bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDL_bool> ready;
[NativeTypeName("bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool> close;
[NativeTypeName("int (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int>, IntPtr, int> enumerate;
[NativeTypeName("bool (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, SDLBool> ready;
[NativeTypeName("int (*)(void *, const char *, SDL_PathInfo *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_PathInfo*, int> info;
[NativeTypeName("bool (*)(void *, const char *, SDL_EnumerateDirectoryCallback, void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDL_EnumerationResult>, IntPtr, SDLBool> enumerate;
[NativeTypeName("int (*)(void *, const char *, void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, int> read_file;
[NativeTypeName("bool (*)(void *, const char *, SDL_PathInfo *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_PathInfo*, SDLBool> info;
[NativeTypeName("int (*)(void *, const char *, const void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, int> write_file;
[NativeTypeName("bool (*)(void *, const char *, void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, SDLBool> read_file;
[NativeTypeName("int (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, int> mkdir;
[NativeTypeName("bool (*)(void *, const char *, const void *, Uint64)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, IntPtr, ulong, SDLBool> write_file;
[NativeTypeName("int (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, int> remove;
[NativeTypeName("bool (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDLBool> mkdir;
[NativeTypeName("int (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> rename;
[NativeTypeName("bool (*)(void *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, SDLBool> remove;
[NativeTypeName("int (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> copy;
[NativeTypeName("bool (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDLBool> rename;
[NativeTypeName("bool (*)(void *, const char *, const char *)")]
public delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDLBool> copy;
[NativeTypeName("Uint64 (*)(void *)")]
public delegate* unmanaged[Cdecl]<IntPtr, ulong> space_remaining;
@ -83,37 +86,48 @@ namespace SDL
public static extern SDL_Storage* SDL_OpenStorage([NativeTypeName("const SDL_StorageInterface *")] SDL_StorageInterface* iface, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CloseStorage(SDL_Storage* storage);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CloseStorage(SDL_Storage* storage);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_StorageReady(SDL_Storage* storage);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StorageReady(SDL_Storage* storage);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetStorageFileSize(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("Uint64 *")] ulong* length);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetStorageFileSize(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("Uint64 *")] ulong* length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReadStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("void*")] IntPtr destination, [NativeTypeName("Uint64")] ulong length);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("void*")] IntPtr destination, [NativeTypeName("Uint64")] ulong length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WriteStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("const void *")] IntPtr source, [NativeTypeName("Uint64")] ulong length);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("const void *")] IntPtr source, [NativeTypeName("Uint64")] ulong length);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CreateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CreateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_EnumerateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, int> callback, [NativeTypeName("void*")] IntPtr userdata);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_EnumerateStorageDirectory(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, [NativeTypeName("SDL_EnumerateDirectoryCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, byte*, SDL_EnumerationResult> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RemoveStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RemoveStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_RenameStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_RenameStoragePath(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_CopyStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_CopyStorageFile(SDL_Storage* storage, [NativeTypeName("const char *")] byte* oldpath, [NativeTypeName("const char *")] byte* newpath);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetStoragePathInfo(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetStoragePathInfo(SDL_Storage* storage, [NativeTypeName("const char *")] byte* path, SDL_PathInfo* info);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint64")]

View File

@ -30,9 +30,10 @@ namespace SDL
{
public enum SDL_ScaleMode
{
SDL_SCALEMODE_INVALID = -1,
SDL_SCALEMODE_NEAREST,
SDL_SCALEMODE_LINEAR,
SDL_SCALEMODE_BEST,
SDL_SCALEMODE_PIXELART,
}
public enum SDL_FlipMode
@ -40,13 +41,10 @@ namespace SDL
SDL_FLIP_NONE,
SDL_FLIP_HORIZONTAL,
SDL_FLIP_VERTICAL,
SDL_FLIP_HORIZONTAL_AND_VERTICAL = (SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL),
}
public partial struct SDL_SurfaceData
{
}
public unsafe partial struct SDL_Surface
public partial struct SDL_Surface
{
public SDL_SurfaceFlags flags;
@ -63,7 +61,8 @@ namespace SDL
public int refcount;
public SDL_SurfaceData* @internal;
[NativeTypeName("void*")]
public IntPtr reserved;
}
public static unsafe partial class SDL3
@ -81,7 +80,8 @@ namespace SDL
public static extern SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceColorspace(SDL_Surface* surface, SDL_Colorspace colorspace);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface* surface);
@ -90,16 +90,19 @@ namespace SDL
public static extern SDL_Palette* SDL_CreateSurfacePalette(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfacePalette(SDL_Surface* surface, SDL_Palette* palette);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Palette* SDL_GetSurfacePalette(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_AddSurfaceAlternateImage(SDL_Surface* surface, SDL_Surface* image);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_AddSurfaceAlternateImage(SDL_Surface* surface, SDL_Surface* image);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasAlternateImages(SDL_Surface* surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SurfaceHasAlternateImages(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface** SDL_GetSurfaceImages(SDL_Surface* surface, int* count);
@ -108,64 +111,104 @@ namespace SDL
public static extern void SDL_RemoveSurfaceAlternateImages(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_LockSurface(SDL_Surface* surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_LockSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnlockSurface(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, SDL_bool closeio);
public static extern SDL_Surface* SDL_LoadSurface_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadSurface([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadBMP_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_LoadBMP([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, SDL_bool closeio);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveBMP_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SaveBMP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceRLE(SDL_Surface* surface, SDL_bool enabled);
public static extern SDL_Surface* SDL_LoadPNG_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasRLE(SDL_Surface* surface);
public static extern SDL_Surface* SDL_LoadPNG([NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceColorKey(SDL_Surface* surface, SDL_bool enabled, [NativeTypeName("Uint32")] uint key);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SavePNG_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SurfaceHasColorKey(SDL_Surface* surface);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SavePNG(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceRLE(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool enabled);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SurfaceHasRLE(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool enabled, [NativeTypeName("Uint32")] uint key);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SurfaceHasColorKey(SDL_Surface* surface);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceColorKey(SDL_Surface* surface, [NativeTypeName("Uint32 *")] uint* key);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceColorMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_bool SDL_SetSurfaceClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8")] byte alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceAlphaMod(SDL_Surface* surface, [NativeTypeName("Uint8 *")] byte* alpha);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceBlendMode(SDL_Surface* surface, SDL_BlendMode* blendMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_SetSurfaceClipRect(SDL_Surface* surface, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_GetSurfaceClipRect(SDL_Surface* surface, SDL_Rect* rect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FlipSurface(SDL_Surface* surface, SDL_FlipMode flip);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_RotateSurface(SDL_Surface* surface, float angle);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern SDL_Surface* SDL_DuplicateSurface(SDL_Surface* surface);
@ -180,46 +223,64 @@ namespace SDL
public static extern SDL_Surface* SDL_ConvertSurfaceAndColorspace(SDL_Surface* surface, SDL_PixelFormat format, SDL_Palette* palette, SDL_Colorspace colorspace, SDL_PropertiesID props);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, [NativeTypeName("void*")] IntPtr dst, int dst_pitch);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch, SDL_bool linear);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, [NativeTypeName("const void *")] IntPtr src, int src_pitch, SDL_PixelFormat dst_format, [NativeTypeName("void*")] IntPtr dst, int dst_pitch, [NativeTypeName("bool")] SDLBool linear);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, SDL_bool linear);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_PremultiplySurfaceAlpha(SDL_Surface* surface, [NativeTypeName("bool")] SDLBool linear);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ClearSurface(SDL_Surface* surface, float r, float g, float b, float a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FillSurfaceRect(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rect, [NativeTypeName("Uint32")] uint color);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_FillSurfaceRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_FillSurfaceRects(SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* rects, int count, [NativeTypeName("Uint32")] uint color);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurface(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurface(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceUnchecked(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurfaceUnchecked(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurfaceScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurfaceUncheckedScaled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceTiled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_StretchSurface(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect, SDL_ScaleMode scaleMode);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurfaceTiledWithScale(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurfaceTiled(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_BlitSurface9Grid(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurfaceTiledWithScale(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_BlitSurface9Grid(SDL_Surface* src, [NativeTypeName("const SDL_Rect *")] SDL_Rect* srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface* dst, [NativeTypeName("const SDL_Rect *")] SDL_Rect* dstrect);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("Uint32")]
@ -230,16 +291,20 @@ namespace SDL
public static extern uint SDL_MapSurfaceRGBA(SDL_Surface* surface, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8 *")] byte* r, [NativeTypeName("Uint8 *")] byte* g, [NativeTypeName("Uint8 *")] byte* b, [NativeTypeName("Uint8 *")] byte* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_ReadSurfacePixelFloat(SDL_Surface* surface, int x, int y, float* r, float* g, float* b, float* a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_ReadSurfacePixelFloat(SDL_Surface* surface, int x, int y, float* r, float* g, float* b, float* a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WriteSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteSurfacePixel(SDL_Surface* surface, int x, int y, [NativeTypeName("Uint8")] byte r, [NativeTypeName("Uint8")] byte g, [NativeTypeName("Uint8")] byte b, [NativeTypeName("Uint8")] byte a);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int SDL_WriteSurfacePixelFloat(SDL_Surface* surface, int x, int y, float r, float g, float b, float a);
[return: NativeTypeName("bool")]
public static extern SDLBool SDL_WriteSurfacePixelFloat(SDL_Surface* surface, int x, int y, float r, float g, float b, float a);
[NativeTypeName("#define SDL_SURFACE_PREALLOCATED 0x00000001u")]
public const uint SDL_SURFACE_PREALLOCATED = 0x00000001U;
@ -261,5 +326,11 @@ namespace SDL
[NativeTypeName("#define SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING \"SDL.surface.tonemap\"")]
public static ReadOnlySpan<byte> SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING => "SDL.surface.tonemap"u8;
[NativeTypeName("#define SDL_PROP_SURFACE_HOTSPOT_X_NUMBER \"SDL.surface.hotspot.x\"")]
public static ReadOnlySpan<byte> SDL_PROP_SURFACE_HOTSPOT_X_NUMBER => "SDL.surface.hotspot.x"u8;
[NativeTypeName("#define SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER \"SDL.surface.hotspot.y\"")]
public static ReadOnlySpan<byte> SDL_PROP_SURFACE_HOTSPOT_Y_NUMBER => "SDL.surface.hotspot.y"u8;
}
}

View File

@ -46,16 +46,14 @@ namespace SDL
public static extern int SDL_GetAndroidSDKVersion();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_IsAndroidTV();
public static extern SDLBool SDL_IsChromebook();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_IsChromebook();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Android")]
public static extern SDL_bool SDL_IsDeXMode();
public static extern SDLBool SDL_IsDeXMode();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Android")]
@ -82,16 +80,19 @@ namespace SDL
public static extern byte* Unsafe_SDL_GetAndroidCachePath();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern int SDL_RequestAndroidPermission([NativeTypeName("const char *")] byte* permission, [NativeTypeName("SDL_RequestAndroidPermissionCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, SDL_bool, void> cb, [NativeTypeName("void*")] IntPtr userdata);
public static extern SDLBool SDL_RequestAndroidPermission([NativeTypeName("const char *")] byte* permission, [NativeTypeName("SDL_RequestAndroidPermissionCallback")] delegate* unmanaged[Cdecl]<IntPtr, byte*, SDLBool, void> cb, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern int SDL_ShowAndroidToast([NativeTypeName("const char *")] byte* message, int duration, int gravity, int xoffset, int yoffset);
public static extern SDLBool SDL_ShowAndroidToast([NativeTypeName("const char *")] byte* message, int duration, int gravity, int xoffset, int yoffset);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Android")]
public static extern int SDL_SendAndroidMessage([NativeTypeName("Uint32")] uint command, int param1);
public static extern SDLBool SDL_SendAndroidMessage([NativeTypeName("Uint32")] uint command, int param1);
[NativeTypeName("#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01")]
public const int SDL_ANDROID_EXTERNAL_STORAGE_READ = 0x01;

View File

@ -28,31 +28,24 @@ using System.Runtime.Versioning;
namespace SDL
{
public enum SDL_WinRT_Path
public partial struct XTaskQueueObject
{
SDL_WINRT_PATH_INSTALLED_LOCATION,
SDL_WINRT_PATH_LOCAL_FOLDER,
SDL_WINRT_PATH_ROAMING_FOLDER,
SDL_WINRT_PATH_TEMP_FOLDER,
}
public enum SDL_WinRT_DeviceFamily
public partial struct XUser
{
SDL_WINRT_DEVICEFAMILY_UNKNOWN,
SDL_WINRT_DEVICEFAMILY_DESKTOP,
SDL_WINRT_DEVICEFAMILY_MOBILE,
SDL_WINRT_DEVICEFAMILY_XBOX,
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetWinRTFSPath", ExactSpelling = true)]
[return: NativeTypeName("const char *")]
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern byte* Unsafe_SDL_GetWinRTFSPath(SDL_WinRT_Path pathType);
public static extern SDLBool SDL_GetGDKTaskQueue([NativeTypeName("XTaskQueueHandle *")] XTaskQueueObject** outTaskQueue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern SDL_WinRT_DeviceFamily SDL_GetWinRTDeviceFamily();
public static extern SDLBool SDL_GetGDKDefaultUser([NativeTypeName("XUserHandle *")] XUser** outUserHandle);
}
}

View File

@ -31,11 +31,13 @@ namespace SDL
public static partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Linux")]
public static extern int SDL_SetLinuxThreadPriority([NativeTypeName("Sint64")] long threadID, int priority);
public static extern SDLBool SDL_SetLinuxThreadPriority([NativeTypeName("Sint64")] long threadID, int priority);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Linux")]
public static extern int SDL_SetLinuxThreadPriorityAndPolicy([NativeTypeName("Sint64")] long threadID, int sdlPriority, int schedPolicy);
public static extern SDLBool SDL_SetLinuxThreadPriorityAndPolicy([NativeTypeName("Sint64")] long threadID, int sdlPriority, int schedPolicy);
}
}

View File

@ -29,34 +29,19 @@ using System.Runtime.Versioning;
namespace SDL
{
public partial struct XTaskQueueObject
{
}
public partial struct XUser
{
}
public static unsafe partial class SDL3
{
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl]<IntPtr, MSG*, SDL_bool> callback, [NativeTypeName("void*")] IntPtr userdata);
public static extern void SDL_SetWindowsMessageHook([NativeTypeName("SDL_WindowsMessageHook")] delegate* unmanaged[Cdecl]<IntPtr, MSG*, SDLBool> callback, [NativeTypeName("void*")] IntPtr userdata);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
[SupportedOSPlatform("Windows")]
public static extern int SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int* adapterIndex, int* outputIndex);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern int SDL_GetGDKTaskQueue([NativeTypeName("XTaskQueueHandle *")] XTaskQueueObject** outTaskQueue);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[SupportedOSPlatform("Windows")]
public static extern int SDL_GetGDKDefaultUser([NativeTypeName("XUserHandle *")] XUser** outUserHandle);
public static extern SDLBool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int* adapterIndex, int* outputIndex);
}
}

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