Commit Graph

14 Commits

Author SHA1 Message Date
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
hwsmm 03f3773985 Update bindings to b15fab0207004282aaf0ab0643fd08579121c88a 2024-09-12 12:32:58 +09:00
hwsmm 15e2c5442d Update bindings to ace6920d4433599e99083892fc12495239ee3d61 2024-08-28 22:04:50 +09:00
hwsmm 1b1c59046b Update bindings to 35e42d0a254f230bb736cf993a9c3855ea1680a1 2024-07-28 14:32:21 +09:00
hwsmm 8fc87afcec Update bindings to e1aa99573270eac053b428cc899eebf499b44eca 2024-07-20 17:46:58 +09:00
Susko3 99d1c0f9fa Update bindings to 661f2fc1fca76f79f536919fefe5887a875b6afb
Not too happy with the manually defined enums, but it'll do for now.
2024-05-15 20:05:52 +02:00
Susko3 f1b7b2caf6 Update bindings to SDL commit 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82 2024-04-15 19:37:01 +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 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 dfe2b5b251 Remap C `void *` to C# `IntPtr` 2024-04-06 12:34:11 +02:00
Susko3 53f98fece1 Map C `char` to C# `byte` instead of `sbyte`
This matches .NET's UTF-8 `ReadOnlySpan<byte>` (see `SDL_hints.g.cs`).
2024-04-06 12:31:32 +02:00
Susko3 72353a8ab9 Undefine _WIN32 to generate only platform-agnostic APIs
Probably needs similar undefines on Linux and macOS.

Notice that the signatures of `SDL_CreateThread` and `SDL_CreateThreadWithStackSize`
have changed.
2024-04-06 01:00:29 +02:00
Susko3 1512bef026 Initial SDL3-CS binding project with ClangSharp
The bindings don't yet compile. There are errors in SDL_pixels.g.cs, SDL_stdinc.g.cs and SDL_thread.g.cs,
a bunch of warnings about "Function like macro definition records are not supported",
and a few "Info: Potential missing remapping".

Built on SDL commit:
6ad390fc50
2024-04-06 00:57:07 +02:00