(3dc4135ce) v0.9.5.1

This commit is contained in:
Regalis
2019-11-21 18:22:25 +01:00
parent b39922a074
commit 5c95c53118
287 changed files with 12655 additions and 5048 deletions
@@ -255,12 +255,26 @@ internal static class Sdl
public static void SetClipboardText(string text)
{
byte[] bytes = Encoding.UTF8.GetBytes(text);
byte[] bytes = Encoding.UTF8.GetBytes(text+"\0");
GCHandle handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
GetError(SDL_SetClipboardText(handle.AddrOfPinnedObject()));
handle.Free();
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int d_sdl_showsimplemessagebox(uint flags, IntPtr title, IntPtr msg, IntPtr window);
public static d_sdl_showsimplemessagebox SDL_ShowSimpleMessageBox = FuncLoader.LoadFunction<d_sdl_showsimplemessagebox>(NativeLibrary, "SDL_ShowSimpleMessageBox");
public static void ShowSimpleMessageBox(uint flags, string title, string message, IntPtr window)
{
byte[] bytesTitle = Encoding.UTF8.GetBytes(title + "\0");
GCHandle handleTitle = GCHandle.Alloc(bytesTitle, GCHandleType.Pinned);
byte[] bytesMessage = Encoding.UTF8.GetBytes(message + "\0");
GCHandle handleMessage = GCHandle.Alloc(bytesMessage, GCHandleType.Pinned);
GetError(SDL_ShowSimpleMessageBox(flags, handleTitle.AddrOfPinnedObject(), handleMessage.AddrOfPinnedObject(), window));
handleTitle.Free();
handleMessage.Free();
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate IntPtr d_sdl_gethint(string name);
public static d_sdl_gethint SDL_GetHint = FuncLoader.LoadFunction<d_sdl_gethint>(NativeLibrary, "SDL_GetHint");