mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2025-01-03 20:45:42 +00:00
Allow DropEvent users to access UTF8_ToManaged
This commit is contained in:
parent
0cd8f85918
commit
65d719a058
10
src/SDL2.cs
10
src/SDL2.cs
|
@ -54,7 +54,8 @@ namespace SDL2
|
||||||
return System.Text.Encoding.UTF8.GetBytes(s + '\0');
|
return System.Text.Encoding.UTF8.GetBytes(s + '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static unsafe string UTF8_ToManaged(IntPtr s, bool freePtr = false)
|
/* This is public because SDL_DropEvent needs it! */
|
||||||
|
public static unsafe string UTF8_ToManaged(IntPtr s, bool freePtr = false)
|
||||||
{
|
{
|
||||||
if (s == IntPtr.Zero)
|
if (s == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
|
@ -3967,7 +3968,12 @@ namespace SDL2
|
||||||
{
|
{
|
||||||
public SDL_EventType type;
|
public SDL_EventType type;
|
||||||
public UInt32 timestamp;
|
public UInt32 timestamp;
|
||||||
public IntPtr file; /* char* filename, to be freed */
|
|
||||||
|
/* char* filename, to be freed.
|
||||||
|
* Access the variable EXACTLY ONCE like this:
|
||||||
|
* string s = SDL.UTF8_ToManaged(evt.drop.file, true);
|
||||||
|
*/
|
||||||
|
public IntPtr file;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
|
Loading…
Reference in a new issue