mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2024-12-22 18:15:35 +00:00
Add multiple missing pointer overloads
THis adds some missing overloads that Ryujinx uses. Changelog: - Add a new overload of SDL_MixAudioFormat to allow passing raw pointers as dest and src (useful for usage with SDL_AudioSpec's callback). - Add a new overload of SDL_OpenAudioDevice to allow passing null for the device parameter. - Add a new overload of SDL_Vulkan_GetInstanceExtensions to allow passing null for the pName parameter.
This commit is contained in:
parent
09716fcbc2
commit
16e15fdb2d
33
src/SDL2.cs
33
src/SDL2.cs
|
@ -2277,6 +2277,17 @@ namespace SDL2
|
|||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_Vulkan_UnloadLibrary();
|
||||
|
||||
/* window refers to an SDL_Window*, pNames to a const char**.
|
||||
* Only available in 2.0.6 or higher.
|
||||
* This overload allows for IntPtr.Zero (null) to be passed for pNames.
|
||||
*/
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern SDL_bool SDL_Vulkan_GetInstanceExtensions(
|
||||
IntPtr window,
|
||||
out uint pCount,
|
||||
IntPtr pNames
|
||||
);
|
||||
|
||||
/* window refers to an SDL_Window*, pNames to a const char**.
|
||||
* Only available in 2.0.6 or higher.
|
||||
*/
|
||||
|
@ -7777,6 +7788,17 @@ namespace SDL2
|
|||
int volume
|
||||
);
|
||||
|
||||
/* format refers to an SDL_AudioFormat */
|
||||
/* This overload allows raw pointers to be passed for dst and src. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_MixAudioFormat(
|
||||
IntPtr dst,
|
||||
IntPtr src,
|
||||
ushort format,
|
||||
uint len,
|
||||
int volume
|
||||
);
|
||||
|
||||
/* format refers to an SDL_AudioFormat */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SDL_MixAudioFormat(
|
||||
|
@ -7801,6 +7823,17 @@ namespace SDL2
|
|||
IntPtr obtained
|
||||
);
|
||||
|
||||
/* uint refers to an SDL_AudioDeviceID */
|
||||
/* This overload allows for IntPtr.Zero (null) to be passed for device. */
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsafe uint SDL_OpenAudioDevice(
|
||||
IntPtr device,
|
||||
int iscapture,
|
||||
ref SDL_AudioSpec desired,
|
||||
out SDL_AudioSpec obtained,
|
||||
int allowed_changes
|
||||
);
|
||||
|
||||
/* uint refers to an SDL_AudioDeviceID */
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_OpenAudioDevice", CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern unsafe uint INTERNAL_SDL_OpenAudioDevice(
|
||||
|
|
Loading…
Reference in a new issue