mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
parent
1c6419ff10
commit
fd8b38932b
2 changed files with 27 additions and 7 deletions
|
@ -58,4 +58,16 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EditorConfigFiles Remove="C:\Users\Alex\source\repos\Capy64\Capy64\Capy64\.editorconfig" />
|
<EditorConfigFiles Remove="C:\Users\Alex\source\repos\Capy64\Capy64\Capy64\.editorconfig" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
|
||||||
|
<DefineConstants>_WINDOWS</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' ">
|
||||||
|
<DefineConstants>_LINUX</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' ">
|
||||||
|
<DefineConstants>_OSX</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -20,32 +20,40 @@ namespace Capy64.Extensions.Bindings;
|
||||||
|
|
||||||
public partial class SDL2
|
public partial class SDL2
|
||||||
{
|
{
|
||||||
private const string SDL = "SDL2";
|
#if _WINDOWS
|
||||||
|
private const string LibraryName = "SDL2.dll";
|
||||||
|
#elif _LINUX
|
||||||
|
private const string LibraryName = "libSDL2-2.0.so.0";
|
||||||
|
#elif _OSX
|
||||||
|
private const string LibraryName = "libSDL2.dylib";
|
||||||
|
#else
|
||||||
|
private const string LibraryName = "SDL2";
|
||||||
|
#endif
|
||||||
|
|
||||||
[LibraryImport(SDL)]
|
[LibraryImport(LibraryName)]
|
||||||
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
||||||
internal static partial void SDL_MaximizeWindow(IntPtr window);
|
internal static partial void SDL_MaximizeWindow(IntPtr window);
|
||||||
|
|
||||||
[LibraryImport(SDL)]
|
[LibraryImport(LibraryName)]
|
||||||
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
||||||
internal static partial uint SDL_GetWindowFlags(IntPtr window);
|
internal static partial uint SDL_GetWindowFlags(IntPtr window);
|
||||||
|
|
||||||
[LibraryImport(SDL, EntryPoint = "SDL_GetClipboardText")]
|
[LibraryImport(LibraryName, EntryPoint = "SDL_GetClipboardText")]
|
||||||
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
||||||
internal static partial IntPtr Native_SDL_GetClipboardText();
|
internal static partial IntPtr Native_SDL_GetClipboardText();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>0 is false; 1 is true</returns>
|
/// <returns>0 is false; 1 is true</returns>
|
||||||
[LibraryImport(SDL)]
|
[LibraryImport(LibraryName)]
|
||||||
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
||||||
internal static partial int SDL_HasClipboardText();
|
internal static partial int SDL_HasClipboardText();
|
||||||
|
|
||||||
[LibraryImport(SDL, EntryPoint = "SDL_SetClipboardText", StringMarshalling = StringMarshalling.Utf8)]
|
[LibraryImport(LibraryName, EntryPoint = "SDL_SetClipboardText", StringMarshalling = StringMarshalling.Utf8)]
|
||||||
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
||||||
internal static partial int Native_SDL_SetClipboardText(string contents);
|
internal static partial int Native_SDL_SetClipboardText(string contents);
|
||||||
|
|
||||||
[LibraryImport(SDL)]
|
[LibraryImport(LibraryName)]
|
||||||
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
|
||||||
internal static partial void SDL_free(IntPtr memblock);
|
internal static partial void SDL_free(IntPtr memblock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue