Define `SDL_FUNCTION_POINTER_IS_VOID_POINTER`

This commit is contained in:
Susko3 2024-04-06 13:38:13 +02:00
parent caa48201d3
commit 37da786af0
4 changed files with 8 additions and 4 deletions

View File

@ -36,7 +36,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
public static extern delegate* unmanaged[Cdecl]<void> SDL_LoadFunction([NativeTypeName("void*")] IntPtr handle, [NativeTypeName("const char *")] byte* name);
public static extern IntPtr SDL_LoadFunction([NativeTypeName("void*")] IntPtr handle, [NativeTypeName("const char *")] byte* name);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_UnloadObject([NativeTypeName("void*")] IntPtr handle);

View File

@ -414,11 +414,11 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
public static extern delegate* unmanaged[Cdecl]<void> SDL_GL_GetProcAddress([NativeTypeName("const char *")] byte* proc);
public static extern IntPtr SDL_GL_GetProcAddress([NativeTypeName("const char *")] byte* proc);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
public static extern delegate* unmanaged[Cdecl]<void> SDL_EGL_GetProcAddress([NativeTypeName("const char *")] byte* proc);
public static extern IntPtr SDL_EGL_GetProcAddress([NativeTypeName("const char *")] byte* proc);
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_GL_UnloadLibrary();

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
@ -46,7 +47,7 @@ namespace SDL
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("SDL_FunctionPointer")]
public static extern delegate* unmanaged[Cdecl]<void> SDL_Vulkan_GetVkGetInstanceProcAddr();
public static extern IntPtr SDL_Vulkan_GetVkGetInstanceProcAddr();
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void SDL_Vulkan_UnloadLibrary();

View File

@ -217,6 +217,9 @@ base_command = [
"char=byte",
"wchar_t *=IntPtr", # wchar_t has a platform-defined size
"--define-macro",
"SDL_FUNCTION_POINTER_IS_VOID_POINTER",
"--additional",
"--undefine-macro=_WIN32",
]