Commit Graph

66 Commits

Author SHA1 Message Date
Dean Herbert 23e045ca14
Merge remote-tracking branch 'origin/update-win-x86-binaries' into update-ios-binaries 2024-04-07 16:41:30 +08:00
Dean Herbert 121f437cf0
Merge remote-tracking branch 'origin/update-win-x64-binaries' into update-ios-binaries 2024-04-07 16:41:29 +08:00
Dean Herbert 76ee0de52d
Merge remote-tracking branch 'origin/update-win-arm64-binaries' into update-ios-binaries 2024-04-07 16:41:28 +08:00
Dean Herbert 8a34fc207f
Merge remote-tracking branch 'origin/update-osx-x64-binaries' into update-ios-binaries 2024-04-07 16:41:27 +08:00
Dean Herbert 62720dfe2b
Merge remote-tracking branch 'origin/update-osx-arm64-binaries' into update-ios-binaries 2024-04-07 16:41:26 +08:00
Dean Herbert 1dd197aefb
Merge remote-tracking branch 'origin/update-linux-x86-binaries' into update-ios-binaries 2024-04-07 16:41:25 +08:00
Dean Herbert 0e5981e3d4
Merge remote-tracking branch 'origin/update-linux-x64-binaries' into update-ios-binaries 2024-04-07 16:41:22 +08:00
smoogipoo e6abd3a36c Update iOS SDL binaries 2024-04-07 08:38:21 +00:00
smoogipoo 1fa5779e3c Update win-x86 SDL binaries 2024-04-07 08:36:01 +00:00
smoogipoo 141ccbe6a7 Update win-arm64 SDL binaries 2024-04-07 08:35:38 +00:00
smoogipoo 5e654de21f Update win-x64 SDL binaries 2024-04-07 08:35:35 +00:00
smoogipoo 337c36db68 Update osx-x64 SDL binaries 2024-04-07 08:34:24 +00:00
smoogipoo 62e00e37f6 Update osx-arm64 SDL binaries 2024-04-07 08:34:18 +00:00
smoogipoo b925f48fed Update linux-x86 SDL binaries 2024-04-07 08:33:36 +00:00
smoogipoo 92989c1c5b Update linux-x64 SDL binaries 2024-04-07 08:32:14 +00:00
Dean Herbert 7aedf33f64
Merge pull request #2 from smoogipoo/add-native-build-workflow 2024-04-07 15:52:31 +08:00
Dean Herbert 5502cddbce
Merge pull request #4 from smoogipoo/add-run-config 2024-04-07 15:50:30 +08:00
Dean Herbert 6eca12f6fd
Merge pull request #3 from smoogipoo/add-deploy-workflow 2024-04-07 15:49:06 +08:00
Dan Balasescu 6a66ca0056
Add run configuration for Tests project 2024-04-07 15:46:49 +09:00
Dan Balasescu cea0afa404
Upload as artifact 2024-04-07 15:44:46 +09:00
Dan Balasescu 2872d65428
Fix native library path 2024-04-07 15:22:10 +09:00
Dan Balasescu ba77deb43d
Move NuGet config to final csproj 2024-04-07 15:17:29 +09:00
Dan Balasescu 2ce6387767
Adjust workflow name 2024-04-07 15:12:39 +09:00
Dan Balasescu 9631ba1327
Add deploy workflow 2024-04-07 15:09:45 +09:00
Dan Balasescu 45c8152b47
Add org prefix to package name 2024-04-07 15:07:17 +09:00
Dan Balasescu 4c72dd4cbb
Include native artifacts in package 2024-04-07 14:46:27 +09:00
Dan Balasescu 64ee7ceed5
Add native build workflow 2024-04-07 14:46:16 +09:00
Dan Balasescu 07a8cd9cc7
Merge pull request #1 from Susko3/initial
Add SDL3 bindings for C headers with support for all platforms
2024-04-07 12:51:49 +09:00
Dan Balasescu 913afa5b4f
Refactorings + auto styling 2024-04-07 12:47:29 +09:00
Dan Balasescu 8003b85aa2
Add DotSettings 2024-04-07 12:28:18 +09:00
Susko3 3edde48072 Add [MustDisposeResource] annoations to array helpers 2024-04-06 15:37:29 +02:00
Susko3 bb9834d0a9 Add sample/tests project
Just a playground to see how the string/type/array friendly overloads work.
You'll have to provide the SDL3 library manually.
2024-04-06 14:47:39 +02:00
Susko3 e85349e3fa Change SDL sources to use more proper types
This helps consumers avoid having to do ugly casts
as was previously done in `SDL_quit.cs`.

It's very important that the underlying type doesn't change
as that might break ABI compat.
2024-04-06 14:43:18 +02:00
Susko3 91cef07624 Add friendly `string?` overloads to C `(const) char *` functions
This is done by adding a `Unsafe_` prefix to `(const) char *` (C# `byte*`) functions.
I am using `string?` instead of `ReadOnlyMemory<byte>?` because the returned pointer can
get invalidated and cause memory-safety issues.

The returned pointer is automatically freed if the return type is `char *`.
I've checked that the documentation for all functions (except in SDL_stdinc.h)
requires calling `SDL_free()` on the pointer.
2024-04-06 14:36:36 +02:00
Susko3 c5e3181962 Add source generator for `ReadOnlySpan<byte>` overloads of C `const char *` functions 2024-04-06 14:24:33 +02:00
Susko3 75db9b16c1 Add memory safe IDisposable overloads to array-returning functions
This could be done with a source generator, but this is simpler.
2024-04-06 14:20:08 +02:00
Susko3 9a5d2e4dbc Add C# type-friendly properties/getters to some structs 2024-04-06 14:12:44 +02:00
Susko3 711e004ecd Add `PtrToStringUTF8()` for `byte *` 2024-04-06 14:08:42 +02:00
Susko3 702dc06a03 Add `void *` overload for `SDL_free()`
Useful as any pointer type can implicitly covert to void *.
2024-04-06 14:07:38 +02:00
Susko3 42b196611d Manually implement macro functions
All of these get "Function like macro definition records are not supported: [...] Generated bindings may be incomplete."
warnings when running ClangSharp.
2024-04-06 14:05:52 +02:00
Susko3 4b1a1e2102 Move `SDL_Keycode` typdef to global python script to avoid duplicate definition 2024-04-06 13:47:08 +02:00
Susko3 b97a553ed4 Remap `SDL_KeyCode` enum to `SDL_Keycode` typedef
This doesn't compile because of duplicate `SDL_Keycode` definition
2024-04-06 13:45:49 +02:00
Susko3 5747f163ac Manually implement endianness-specific audio formats 2024-04-06 13:42:10 +02:00
Susko3 37da786af0 Define `SDL_FUNCTION_POINTER_IS_VOID_POINTER` 2024-04-06 13:38:13 +02:00
Susko3 caa48201d3 Manually define broken constants 2024-04-06 13:33:00 +02:00
Susko3 9e44316535 Fix invalid `int` -> `SDL_bool` conversion by manually changing SDL headers 2024-04-06 13:33:00 +02:00
Susko3 409ecf7536 Add C# enum "typedefs" for C typedefs
This doesn't compile as ClangSharp fails to emit `unchecked`
in `SDL_pen.g.cs` and `SDL_touch.g.cs`.
And `(SDL_bool)` casts in `SDL_rect.g.cs`.
2024-04-06 13:32:55 +02:00
Susko3 dfe0d2533c Add `[Flags]` attribute to mask/flags enums 2024-04-06 12:58:35 +02:00
Susko3 a25b4be3b2 Add [UnsupportedOSPlatform("windows")] to `SDL_CreateThread()` functions
See commit: 72353a8ab9
2024-04-06 12:54:12 +02:00
Susko3 75a9cde3f8 Don't log potential typedef remappings
Produces a lot of noise about unused remappings (as we're processing a header at a time).
All remappings (except `SDL_JoystickGUID`) have been added.

`SDL_JoystickGUID` is a remapping of a struct, so it's harded to do programatically.
2024-04-06 12:37:14 +02:00