We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, macro functions need to be manually updated (and added), see 2590a72.
The manually written C# code would be the following, placed in the usual SDL_{name}.cs file:
SDL_{name}.cs
public static partial class SDL3 { [Macro] [return: CastFrom("int")] public static partial SDL_PixelType SDL_PIXELTYPE([Cast("int")] SDL_PixelFormat X); }
This will cause the source gen to generate the following code (this may be unnecessary):
public static partial SDL_PixelType SDL_PIXELTYPE(SDL_PixelFormat X) => (SDL_PixelType)Unsafe_SDL_PIXELTYPE((int)X);
The python script would generate this C header file and add it to ClangSharp (the file is not saved to disk/repo):
#include <SDL3/SDL.h> // | taken from [CastFrom("int")] // ↓ ↓ taken from [Cast("int")] inline int Unsafe_SDL_PIXELTYPE(int X) { return SDL_PIXELTYPE(X); }
ClangSharp can convert inline functions to C# code, so calling the macro functions inside inline functions should work.
The generated C# code will be horrible, as it'll resolve all macros (and SDL code sometime nests a lot of macros).
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, macro functions need to be manually updated (and added), see 2590a72.
My idea for this
The manually written C# code would be the following, placed in the usual
SDL_{name}.cs
file:This will cause the source gen to generate the following code (this may be unnecessary):
The python script would generate this C header file and add it to ClangSharp (the file is not saved to disk/repo):
ClangSharp can convert inline functions to C# code, so calling the macro functions inside inline functions should work.
The generated C# code will be horrible, as it'll resolve all macros (and SDL code sometime nests a lot of macros).
The text was updated successfully, but these errors were encountered: