Commit Graph

67 Commits

Author SHA1 Message Date
smoogipoo fa7836905a Update linux-x86 SDL binaries 2024-04-12 18:17:27 +00:00
Dean Herbert eab6e97231 Merge remote-tracking branch 'origin/update-win-x86-binaries' into update-ios-binaries 2024-04-07 16:41:30 +08:00
Dean Herbert 0851b65c8a Merge remote-tracking branch 'origin/update-win-x64-binaries' into update-ios-binaries 2024-04-07 16:41:29 +08:00
Dean Herbert 9a03ea1df5 Merge remote-tracking branch 'origin/update-win-arm64-binaries' into update-ios-binaries 2024-04-07 16:41:28 +08:00
Dean Herbert e90fcf0380 Merge remote-tracking branch 'origin/update-osx-x64-binaries' into update-ios-binaries 2024-04-07 16:41:27 +08:00
Dean Herbert 7e41c4840f Merge remote-tracking branch 'origin/update-osx-arm64-binaries' into update-ios-binaries 2024-04-07 16:41:26 +08:00
Dean Herbert 07cfc2cbe8 Merge remote-tracking branch 'origin/update-linux-x86-binaries' into update-ios-binaries 2024-04-07 16:41:25 +08:00
Dean Herbert 46122c8c11 Merge remote-tracking branch 'origin/update-linux-x64-binaries' into update-ios-binaries 2024-04-07 16:41:22 +08:00
smoogipoo e676a823a6 Update iOS SDL binaries 2024-04-07 08:38:21 +00:00
smoogipoo e8f87d0621 Update win-x86 SDL binaries 2024-04-07 08:36:01 +00:00
smoogipoo a4ce432610 Update win-arm64 SDL binaries 2024-04-07 08:35:38 +00:00
smoogipoo df7e7b5893 Update win-x64 SDL binaries 2024-04-07 08:35:35 +00:00
smoogipoo 47cd83008c Update osx-x64 SDL binaries 2024-04-07 08:34:24 +00:00
smoogipoo 515dd45bff Update osx-arm64 SDL binaries 2024-04-07 08:34:18 +00:00
smoogipoo db79f1be40 Update linux-x86 SDL binaries 2024-04-07 08:33:36 +00:00
smoogipoo 3859de2f85 Update linux-x64 SDL binaries 2024-04-07 08:32:14 +00:00
Dean Herbert 31ada83091 Merge pull request #2 from smoogipoo/add-native-build-workflow 2024-04-07 15:52:31 +08:00
Dean Herbert 18ab093ed0 Merge pull request #4 from smoogipoo/add-run-config 2024-04-07 15:50:30 +08:00
Dean Herbert 03cbac9113 Merge pull request #3 from smoogipoo/add-deploy-workflow 2024-04-07 15:49:06 +08:00
Dan Balasescu a898349df3 Add run configuration for Tests project 2024-04-07 15:46:49 +09:00
Dan Balasescu 85a9ed8060 Upload as artifact 2024-04-07 15:44:46 +09:00
Dan Balasescu 5a14fe0b28 Fix native library path 2024-04-07 15:22:10 +09:00
Dan Balasescu 657e22bb00 Move NuGet config to final csproj 2024-04-07 15:17:29 +09:00
Dan Balasescu 873059a07e Adjust workflow name 2024-04-07 15:12:39 +09:00
Dan Balasescu d21c7d3b00 Add deploy workflow 2024-04-07 15:09:45 +09:00
Dan Balasescu 40562e5ffd Add org prefix to package name 2024-04-07 15:07:17 +09:00
Dan Balasescu 7021e3b3ef Include native artifacts in package 2024-04-07 14:46:27 +09:00
Dan Balasescu da55038adc Add native build workflow 2024-04-07 14:46:16 +09:00
Dan Balasescu 6fbcbef70a 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 a4519330e5 Refactorings + auto styling 2024-04-07 12:47:29 +09:00
Dan Balasescu 9605d1e6cf Add DotSettings 2024-04-07 12:28:18 +09:00
Susko3 d919dacea8 Add [MustDisposeResource] annoations to array helpers 2024-04-06 15:37:29 +02:00
Susko3 99d90c0fb6 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 a19e75b298 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 95056ef317 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 bad4e097ae Add source generator for `ReadOnlySpan<byte>` overloads of C `const char *` functions 2024-04-06 14:24:33 +02:00
Susko3 a8f1d7f1ba 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 f3d13fe6dc Add C# type-friendly properties/getters to some structs 2024-04-06 14:12:44 +02:00
Susko3 8a2f47fd97 Add `PtrToStringUTF8()` for `byte *` 2024-04-06 14:08:42 +02:00
Susko3 8624db0eae 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 77ab7fed42 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 182482217d Move `SDL_Keycode` typdef to global python script to avoid duplicate definition 2024-04-06 13:47:08 +02:00
Susko3 7d9502ee82 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 7b8ea9767f Manually implement endianness-specific audio formats 2024-04-06 13:42:10 +02:00
Susko3 c9c9782e48 Define `SDL_FUNCTION_POINTER_IS_VOID_POINTER` 2024-04-06 13:38:13 +02:00
Susko3 d2bc4e7605 Manually define broken constants 2024-04-06 13:33:00 +02:00
Susko3 a4ecfd1c75 Fix invalid `int` -> `SDL_bool` conversion by manually changing SDL headers 2024-04-06 13:33:00 +02:00
Susko3 556c6cd1a3 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 0b0906bfea Add `[Flags]` attribute to mask/flags enums 2024-04-06 12:58:35 +02:00
Susko3 0196aeb249 Add [UnsupportedOSPlatform("windows")] to `SDL_CreateThread()` functions
See commit: 72353a8ab9
2024-04-06 12:54:12 +02:00