commit
f42d304eff
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bin/
|
||||||
|
*.userprefs
|
@ -155,6 +155,7 @@
|
|||||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLDelegates.cs" />
|
<Compile Include="src\MiniTK\Graphics\OpenGL\GLDelegates.cs" />
|
||||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLEnums.cs" />
|
<Compile Include="src\MiniTK\Graphics\OpenGL\GLEnums.cs" />
|
||||||
<Compile Include="src\MiniTK\Graphics\OpenGL\GLHelper.cs" />
|
<Compile Include="src\MiniTK\Graphics\OpenGL\GLHelper.cs" />
|
||||||
|
<Compile Include="src\LPUtf8StrMarshaler.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="SDL2#.dll.config">
|
<None Include="SDL2#.dll.config">
|
||||||
|
106
src/LPUtf8StrMarshaler.cs
Normal file
106
src/LPUtf8StrMarshaler.cs
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
/* SDL2# - C# Wrapper for SDL2
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 Ethan Lee.
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or implied warranty.
|
||||||
|
* In no event will the authors be held liable for any damages arising from
|
||||||
|
* the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute it
|
||||||
|
* freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented; you must not
|
||||||
|
* claim that you wrote the original software. If you use this software in a
|
||||||
|
* product, an acknowledgment in the product documentation would be
|
||||||
|
* appreciated but is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*
|
||||||
|
* Ethan "flibitijibibo" Lee <flibitijibibo@flibitijibibo.com>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace SDL2
|
||||||
|
{
|
||||||
|
internal unsafe class LPUtf8StrMarshaler : ICustomMarshaler
|
||||||
|
{
|
||||||
|
public const string LeaveAllocated = "LeaveAllocated";
|
||||||
|
|
||||||
|
private static ICustomMarshaler
|
||||||
|
_leaveAllocatedInstance = new LPUtf8StrMarshaler(true),
|
||||||
|
_defaultInstance = new LPUtf8StrMarshaler(false);
|
||||||
|
|
||||||
|
private static ICustomMarshaler GetInstance(string cookie)
|
||||||
|
{
|
||||||
|
switch (cookie)
|
||||||
|
{
|
||||||
|
case "LeaveAllocated":
|
||||||
|
return _leaveAllocatedInstance;
|
||||||
|
default:
|
||||||
|
return _defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _leaveAllocated;
|
||||||
|
|
||||||
|
public LPUtf8StrMarshaler(bool leaveAllocated)
|
||||||
|
{
|
||||||
|
_leaveAllocated = leaveAllocated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object MarshalNativeToManaged(IntPtr pNativeData)
|
||||||
|
{
|
||||||
|
if (pNativeData == IntPtr.Zero)
|
||||||
|
return null;
|
||||||
|
var ptr = (byte*)pNativeData;
|
||||||
|
while (*ptr != 0)
|
||||||
|
{
|
||||||
|
ptr++;
|
||||||
|
}
|
||||||
|
var bytes = new byte[ptr - (byte*)pNativeData];
|
||||||
|
Marshal.Copy(pNativeData, bytes, 0, bytes.Length);
|
||||||
|
return Encoding.UTF8.GetString(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntPtr MarshalManagedToNative(object ManagedObj)
|
||||||
|
{
|
||||||
|
if (ManagedObj == null)
|
||||||
|
return IntPtr.Zero;
|
||||||
|
var str = ManagedObj as string;
|
||||||
|
if (str == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("ManagedObj must be a string.", "ManagedObj");
|
||||||
|
}
|
||||||
|
var bytes = Encoding.UTF8.GetBytes(str);
|
||||||
|
var mem = Marshal.AllocHGlobal(bytes.Length + 1);
|
||||||
|
Marshal.Copy(bytes, 0, mem, bytes.Length);
|
||||||
|
((byte*)mem)[bytes.Length] = 0;
|
||||||
|
return mem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CleanUpManagedData(object ManagedObj)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CleanUpNativeData(IntPtr pNativeData)
|
||||||
|
{
|
||||||
|
if (!_leaveAllocated)
|
||||||
|
{
|
||||||
|
Marshal.FreeHGlobal(pNativeData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetNativeDataSize ()
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
353
src/SDL2.cs
353
src/SDL2.cs
@ -70,9 +70,9 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_RWFromFile", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, EntryPoint = "SDL_RWFromFile", CallingConvention = CallingConvention.Cdecl)]
|
||||||
internal static extern IntPtr INTERNAL_SDL_RWFromFile(
|
internal static extern IntPtr INTERNAL_SDL_RWFromFile(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string file,
|
string file,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string mode
|
string mode
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -158,31 +158,26 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_ClearHints();
|
public static extern void SDL_ClearHints();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetHint", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetHint(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
public static extern string SDL_GetHint(
|
||||||
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string name
|
string name
|
||||||
);
|
);
|
||||||
public static string SDL_GetHint(string name)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetHint(name)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_bool SDL_SetHint(
|
public static extern SDL_bool SDL_SetHint(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string name,
|
string name,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string value
|
string value
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_bool SDL_SetHintWithPriority(
|
public static extern SDL_bool SDL_SetHintWithPriority(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string name,
|
string name,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string value,
|
string value,
|
||||||
SDL_HintPriority priority
|
SDL_HintPriority priority
|
||||||
);
|
);
|
||||||
@ -194,16 +189,13 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_ClearError();
|
public static extern void SDL_ClearError();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetError", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetError();
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_GetError()
|
public static extern string SDL_GetError();
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(INTERNAL_SDL_GetError());
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_SetError(
|
public static extern void SDL_SetError(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -267,7 +259,7 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_Log(
|
public static extern void SDL_Log(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -275,7 +267,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_LogVerbose(
|
public static extern void SDL_LogVerbose(
|
||||||
int category,
|
int category,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -283,7 +275,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_LogDebug(
|
public static extern void SDL_LogDebug(
|
||||||
int category,
|
int category,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -291,7 +283,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_LogInfo(
|
public static extern void SDL_LogInfo(
|
||||||
int category,
|
int category,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -299,7 +291,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_LogWarn(
|
public static extern void SDL_LogWarn(
|
||||||
int category,
|
int category,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -307,7 +299,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_LogError(
|
public static extern void SDL_LogError(
|
||||||
int category,
|
int category,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -315,7 +307,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_LogCritical(
|
public static extern void SDL_LogCritical(
|
||||||
int category,
|
int category,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -324,7 +316,7 @@ namespace SDL2
|
|||||||
public static extern void SDL_LogMessage(
|
public static extern void SDL_LogMessage(
|
||||||
int category,
|
int category,
|
||||||
SDL_LogPriority priority,
|
SDL_LogPriority priority,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -333,7 +325,7 @@ namespace SDL2
|
|||||||
public static extern void SDL_LogMessageV(
|
public static extern void SDL_LogMessageV(
|
||||||
int category,
|
int category,
|
||||||
SDL_LogPriority priority,
|
SDL_LogPriority priority,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string fmt,
|
string fmt,
|
||||||
__arglist
|
__arglist
|
||||||
);
|
);
|
||||||
@ -417,15 +409,10 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern void SDL_GetVersion(ref SDL_version ver);
|
private static extern void SDL_GetVersion(ref SDL_version ver);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetRevision", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetRevision();
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_GetRevision()
|
public static extern string SDL_GetRevision();
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetRevision()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_GetRevisionNumber();
|
public static extern int SDL_GetRevisionNumber();
|
||||||
|
|
||||||
@ -546,7 +533,7 @@ namespace SDL2
|
|||||||
/* IntPtr refers to an SDL_Window* */
|
/* IntPtr refers to an SDL_Window* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr SDL_CreateWindow(
|
public static extern IntPtr SDL_CreateWindow(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string title,
|
string title,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
@ -593,15 +580,10 @@ namespace SDL2
|
|||||||
ref SDL_DisplayMode mode
|
ref SDL_DisplayMode mode
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetCurrentVideoDriver", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetCurrentVideoDriver();
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_GetCurrentVideoDriver()
|
public static extern string SDL_GetCurrentVideoDriver();
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetCurrentVideoDriver()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_GetDesktopDisplayMode(
|
public static extern int SDL_GetDesktopDisplayMode(
|
||||||
int displayIndex,
|
int displayIndex,
|
||||||
@ -632,17 +614,12 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_GetNumVideoDrivers();
|
public static extern int SDL_GetNumVideoDrivers();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetVideoDriver", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetVideoDriver(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GetVideoDriver(
|
||||||
int index
|
int index
|
||||||
);
|
);
|
||||||
public static string SDL_GetVideoDriver(int index)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetVideoDriver(index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* window refers to an SDL_Window* */
|
/* window refers to an SDL_Window* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float SDL_GetWindowBrightness(
|
public static extern float SDL_GetWindowBrightness(
|
||||||
@ -653,7 +630,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr SDL_GetWindowData(
|
public static extern IntPtr SDL_GetWindowData(
|
||||||
IntPtr window,
|
IntPtr window,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string name
|
string name
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -722,17 +699,12 @@ namespace SDL2
|
|||||||
public static extern IntPtr SDL_GetWindowSurface(IntPtr window);
|
public static extern IntPtr SDL_GetWindowSurface(IntPtr window);
|
||||||
|
|
||||||
/* window refers to an SDL_Window* */
|
/* window refers to an SDL_Window* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetWindowTitle", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetWindowTitle(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GetWindowTitle(
|
||||||
IntPtr window
|
IntPtr window
|
||||||
);
|
);
|
||||||
public static string SDL_GetWindowTitle(IntPtr window)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetWindowTitle(window)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* texture refers to an SDL_Texture* */
|
/* texture refers to an SDL_Texture* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_GL_BindTexture(
|
public static extern int SDL_GL_BindTexture(
|
||||||
@ -752,13 +724,13 @@ namespace SDL2
|
|||||||
/* IntPtr refers to a function pointer */
|
/* IntPtr refers to a function pointer */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr SDL_GL_GetProcAddress(
|
public static extern IntPtr SDL_GL_GetProcAddress(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string proc
|
string proc
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_bool SDL_GL_ExtensionSupported(
|
public static extern SDL_bool SDL_GL_ExtensionSupported(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string extension
|
string extension
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -829,7 +801,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr SDL_SetWindowData(
|
public static extern IntPtr SDL_SetWindowData(
|
||||||
IntPtr window,
|
IntPtr window,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string name,
|
string name,
|
||||||
IntPtr userdata
|
IntPtr userdata
|
||||||
);
|
);
|
||||||
@ -898,7 +870,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_SetWindowTitle(
|
public static extern void SDL_SetWindowTitle(
|
||||||
IntPtr window,
|
IntPtr window,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string title
|
string title
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -920,7 +892,7 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_VideoInit(
|
public static extern int SDL_VideoInit(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string driver_name
|
string driver_name
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1725,17 +1697,12 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_FreePalette(IntPtr palette);
|
public static extern void SDL_FreePalette(IntPtr palette);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetPixelFormatName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetPixelFormatName(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GetPixelFormatName(
|
||||||
uint format
|
uint format
|
||||||
);
|
);
|
||||||
public static string SDL_GetPixelFormatName(uint format)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetPixelFormatName(format)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* format refers to an SDL_PixelFormat* */
|
/* format refers to an SDL_PixelFormat* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_GetRGB(
|
public static extern void SDL_GetRGB(
|
||||||
@ -2181,18 +2148,13 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_bool SDL_HasClipboardText();
|
public static extern SDL_bool SDL_HasClipboardText();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetClipboardText", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetClipboardText();
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_GetClipboardText(string name)
|
public static extern string SDL_GetClipboardText();
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetClipboardText()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_SetClipboardText(
|
public static extern int SDL_SetClipboardText(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text
|
string text
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -3357,37 +3319,25 @@ namespace SDL2
|
|||||||
public static extern void SDL_GetScancodeFromKey(SDL_Keycode key);
|
public static extern void SDL_GetScancodeFromKey(SDL_Keycode key);
|
||||||
|
|
||||||
/* Wrapper for SDL_GetScancodeName */
|
/* Wrapper for SDL_GetScancodeName */
|
||||||
[DllImport(nativeLibName, EntryPoint="SDL_GetScancodeName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetScancodeName(SDL_Scancode scancode);
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
/* Get a human-readable name for a scancode */
|
public static extern string SDL_GetScancodeName(SDL_Scancode scancode);
|
||||||
public static string SDL_GetScancodeName(SDL_Scancode scancode)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetScancodeName(scancode)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get a scancode from a human-readable name */
|
/* Get a scancode from a human-readable name */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_Scancode SDL_GetScancodeFromName(
|
public static extern SDL_Scancode SDL_GetScancodeFromName(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)] string name
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string name
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Wrapper for SDL_GetKeyName */
|
/* Wrapper for SDL_GetKeyName */
|
||||||
[DllImport(nativeLibName, EntryPoint="SDL_GetKeyName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetKeyName(SDL_Keycode key);
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
/* Get a human-readable name for a key */
|
public static extern string SDL_GetKeyName(SDL_Keycode key);
|
||||||
public static string SDL_GetKeyName(SDL_Keycode key)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetKeyName(key)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get a key code from a human-readable name */
|
/* Get a key code from a human-readable name */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_Keycode SDL_GetKeyFromName(
|
public static extern SDL_Keycode SDL_GetKeyFromName(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)] string name
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string name
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Start accepting Unicode text input events, show keyboard */
|
/* Start accepting Unicode text input events, show keyboard */
|
||||||
@ -3593,28 +3543,18 @@ namespace SDL2
|
|||||||
public static extern int SDL_JoystickIndex(IntPtr joystick);
|
public static extern int SDL_JoystickIndex(IntPtr joystick);
|
||||||
|
|
||||||
/* joystick refers to an SDL_Joystick* */
|
/* joystick refers to an SDL_Joystick* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_JoystickName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_JoystickName(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_JoystickName(
|
||||||
IntPtr joystick
|
IntPtr joystick
|
||||||
);
|
);
|
||||||
public static string SDL_JoystickName(IntPtr joystick)
|
|
||||||
{
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
return Marshal.PtrToStringAnsi(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
INTERNAL_SDL_JoystickName(joystick)
|
public static extern string SDL_JoystickNameForIndex(
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_JoystickNameForIndex", CallingConvention = CallingConvention.Cdecl)]
|
|
||||||
private static extern IntPtr INTERNAL_SDL_JoystickNameForIndex(
|
|
||||||
int device_index
|
int device_index
|
||||||
);
|
);
|
||||||
public static string SDL_JoystickNameForIndex(int device_index)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_JoystickNameForIndex(device_index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* joystick refers to an SDL_Joystick* */
|
/* joystick refers to an SDL_Joystick* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_JoystickNumAxes(IntPtr joystick);
|
public static extern int SDL_JoystickNumAxes(IntPtr joystick);
|
||||||
@ -3661,14 +3601,14 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_JoystickGetGUIDString(
|
public static extern void SDL_JoystickGetGUIDString(
|
||||||
SDL_JoystickGUID guid,
|
SDL_JoystickGUID guid,
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
System.Text.StringBuilder pszGUID,
|
System.Text.StringBuilder pszGUID,
|
||||||
int cbGUID
|
int cbGUID
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_JoystickGUID SDL_JoystickGetGUIDFromString(
|
public static extern SDL_JoystickGUID SDL_JoystickGetGUIDFromString(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string pchGUID
|
string pchGUID
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -3750,65 +3690,42 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_GameControllerAddMapping(
|
public static extern int SDL_GameControllerAddMapping(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string mappingString
|
string mappingString
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMappingForGUID", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMappingForGUID", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GameControllerMappingForGUID(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GameControllerMappingForGUID(
|
||||||
SDL_JoystickGUID guid
|
SDL_JoystickGUID guid
|
||||||
);
|
);
|
||||||
public static string SDL_GameControllerMappingForGUID(
|
|
||||||
SDL_JoystickGUID guid
|
|
||||||
) {
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GameControllerMappingForGUID(guid)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* gamecontroller refers to an SDL_GameController* */
|
/* gamecontroller refers to an SDL_GameController* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMapping", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GameControllerMapping(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GameControllerMapping(
|
||||||
IntPtr gamecontroller
|
IntPtr gamecontroller
|
||||||
);
|
);
|
||||||
public static string SDL_GameControllerMapping(
|
|
||||||
IntPtr gamecontroller
|
|
||||||
) {
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GameControllerMapping(gamecontroller)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_bool SDL_IsGameController(int joystick_index);
|
public static extern SDL_bool SDL_IsGameController(int joystick_index);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerNameForIndex", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GameControllerNameForIndex(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GameControllerNameForIndex(
|
||||||
int joystick_index
|
int joystick_index
|
||||||
);
|
);
|
||||||
public static string SDL_GameControllerNameForIndex(int joystick_index)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GameControllerNameForIndex(joystick_index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* IntPtr refers to an SDL_GameController* */
|
/* IntPtr refers to an SDL_GameController* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr SDL_GameControllerOpen(int joystick_index);
|
public static extern IntPtr SDL_GameControllerOpen(int joystick_index);
|
||||||
|
|
||||||
/* gamecontroller refers to an SDL_GameController* */
|
/* gamecontroller refers to an SDL_GameController* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GameControllerName(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GameControllerName(
|
||||||
IntPtr gamecontroller
|
IntPtr gamecontroller
|
||||||
);
|
);
|
||||||
public static string SDL_GameControllerName(IntPtr gamecontroller)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GameControllerName(gamecontroller)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* gamecontroller refers to an SDL_GameController* */
|
/* gamecontroller refers to an SDL_GameController* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_bool SDL_GameControllerGetAttached(
|
public static extern SDL_bool SDL_GameControllerGetAttached(
|
||||||
@ -3831,22 +3748,16 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(
|
public static extern SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string pchString
|
string pchString
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetStringForAxis", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GameControllerGetStringForAxis(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GameControllerGetStringForAxis(
|
||||||
SDL_GameControllerAxis axis
|
SDL_GameControllerAxis axis
|
||||||
);
|
);
|
||||||
public static string SDL_GameControllerGetStringForAxis(
|
|
||||||
SDL_GameControllerAxis axis
|
|
||||||
) {
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GameControllerGetStringForAxis(axis)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* gamecontroller refers to an SDL_GameController* */
|
/* gamecontroller refers to an SDL_GameController* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(
|
public static extern SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(
|
||||||
@ -3863,22 +3774,16 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_GameControllerButton SDL_GameControllerGetButtonFromString(
|
public static extern SDL_GameControllerButton SDL_GameControllerGetButtonFromString(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string pchString
|
string pchString
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetStringForButton", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GameControllerGetStringForButton(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GameControllerGetStringForButton(
|
||||||
SDL_GameControllerButton button
|
SDL_GameControllerButton button
|
||||||
);
|
);
|
||||||
public static string SDL_GameControllerGetStringForButton(
|
|
||||||
SDL_GameControllerButton button
|
|
||||||
) {
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GameControllerGetStringForButton(button)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* gamecontroller refers to an SDL_GameController* */
|
/* gamecontroller refers to an SDL_GameController* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(
|
public static extern SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(
|
||||||
@ -4094,15 +3999,10 @@ namespace SDL2
|
|||||||
public static extern int SDL_HapticIndex(IntPtr haptic);
|
public static extern int SDL_HapticIndex(IntPtr haptic);
|
||||||
|
|
||||||
/* haptic refers to an SDL_Haptic* */
|
/* haptic refers to an SDL_Haptic* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_HapticName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_HapticName(int device_index);
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_HapticName(int device_index)
|
public static extern string SDL_HapticName(int device_index);
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_HapticName(device_index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* haptic refers to an SDL_Haptic* */
|
/* haptic refers to an SDL_Haptic* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_HapticNewEffect(
|
public static extern int SDL_HapticNewEffect(
|
||||||
@ -4335,7 +4235,7 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_AudioInit(
|
public static extern int SDL_AudioInit(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string driver_name
|
string driver_name
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -4353,47 +4253,30 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void SDL_FreeWAV(IntPtr audio_buf);
|
public static extern void SDL_FreeWAV(IntPtr audio_buf);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetAudioDeviceName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetAudioDeviceName(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string SDL_GetAudioDeviceName(
|
||||||
int index,
|
int index,
|
||||||
int iscapture
|
int iscapture
|
||||||
);
|
);
|
||||||
public static string SDL_GetAudioDeviceName(
|
|
||||||
int index,
|
|
||||||
int iscapture
|
|
||||||
) {
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetAudioDeviceName(index, iscapture)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* dev refers to an SDL_AudioDeviceID */
|
/* dev refers to an SDL_AudioDeviceID */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_AudioStatus SDL_GetAudioDeviceStatus(
|
public static extern SDL_AudioStatus SDL_GetAudioDeviceStatus(
|
||||||
uint dev
|
uint dev
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetAudioDriver", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetAudioDriver(int index);
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_GetAudioDriver(int index)
|
public static extern string SDL_GetAudioDriver(int index);
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetAudioDriver(index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern SDL_AudioStatus SDL_GetAudioStatus();
|
public static extern SDL_AudioStatus SDL_GetAudioStatus();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "SDL_GetCurrentAudioDriver", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_SDL_GetCurrentAudioDriver();
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string SDL_GetCurrentAudioDriver()
|
public static extern string SDL_GetCurrentAudioDriver();
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_SDL_GetCurrentAudioDriver()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int SDL_GetNumAudioDevices(int iscapture);
|
public static extern int SDL_GetNumAudioDevices(int iscapture);
|
||||||
|
|
||||||
@ -4466,7 +4349,7 @@ namespace SDL2
|
|||||||
/* uint refers to an SDL_AudioDeviceID */
|
/* uint refers to an SDL_AudioDeviceID */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern uint SDL_OpenAudioDevice(
|
public static extern uint SDL_OpenAudioDevice(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string device,
|
string device,
|
||||||
int iscapture,
|
int iscapture,
|
||||||
ref SDL_AudioSpec desired,
|
ref SDL_AudioSpec desired,
|
||||||
|
@ -90,7 +90,7 @@ namespace SDL2
|
|||||||
/* IntPtr refers to an SDL_Surface* */
|
/* IntPtr refers to an SDL_Surface* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr IMG_Load(
|
public static extern IntPtr IMG_Load(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string file
|
string file
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr IMG_LoadTexture(
|
public static extern IntPtr IMG_LoadTexture(
|
||||||
IntPtr renderer,
|
IntPtr renderer,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string file
|
string file
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ namespace SDL2
|
|||||||
/* IntPtr refers to a Mix_Music* */
|
/* IntPtr refers to a Mix_Music* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr Mix_LoadMUS(
|
public static extern IntPtr Mix_LoadMUS(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string file
|
string file
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -222,27 +222,17 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int Mix_GetNumChunkDecoders();
|
public static extern int Mix_GetNumChunkDecoders();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "Mix_GetChunkDecoder", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_Mix_GetChunkDecoder(int index);
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string Mix_GetChunkDecoder(int index)
|
public static extern string Mix_GetChunkDecoder(int index);
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_Mix_GetChunkDecoder(index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int Mix_GetNumMusicDecoders();
|
public static extern int Mix_GetNumMusicDecoders();
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "Mix_GetMusicDecoder", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_Mix_GetMusicDecoder(int index);
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string Mix_GetMusicDecoder(int index)
|
public static extern string Mix_GetMusicDecoder(int index);
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_Mix_GetMusicDecoder(index)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* music refers to a Mix_Music* */
|
/* music refers to a Mix_Music* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern Mix_MusicType Mix_GetMusicType(IntPtr music);
|
public static extern Mix_MusicType Mix_GetMusicType(IntPtr music);
|
||||||
@ -462,7 +452,7 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int Mix_SetMusicCMD(
|
public static extern int Mix_SetMusicCMD(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string command
|
string command
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -474,17 +464,14 @@ namespace SDL2
|
|||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int Mix_SetSoundFonts(
|
public static extern int Mix_SetSoundFonts(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string paths
|
string paths
|
||||||
);
|
);
|
||||||
|
|
||||||
[DllImport(nativeLibName, EntryPoint = "Mix_GetSoundFonts", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_Mix_GetSoundFonts();
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
public static string Mix_GetSoundFonts()
|
public static extern string Mix_GetSoundFonts();
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(INTERNAL_Mix_GetSoundFonts());
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int Mix_EachSoundFont(
|
public static extern int Mix_EachSoundFont(
|
||||||
SoundFontDelegate function,
|
SoundFontDelegate function,
|
||||||
|
@ -95,7 +95,7 @@ namespace SDL2
|
|||||||
/* IntPtr refers to a TTF_Font* */
|
/* IntPtr refers to a TTF_Font* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_OpenFont(
|
public static extern IntPtr TTF_OpenFont(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string file,
|
string file,
|
||||||
int ptsize
|
int ptsize
|
||||||
);
|
);
|
||||||
@ -103,7 +103,7 @@ namespace SDL2
|
|||||||
/* IntPtr refers to a TTF_Font* */
|
/* IntPtr refers to a TTF_Font* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_OpenFontIndex(
|
public static extern IntPtr TTF_OpenFontIndex(
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string file,
|
string file,
|
||||||
int ptsize,
|
int ptsize,
|
||||||
long index
|
long index
|
||||||
@ -166,29 +166,19 @@ namespace SDL2
|
|||||||
public static extern int TTF_FontFaceIsFixedWidth(IntPtr font);
|
public static extern int TTF_FontFaceIsFixedWidth(IntPtr font);
|
||||||
|
|
||||||
/* font refers to a TTF_Font* */
|
/* font refers to a TTF_Font* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "TTF_FontFaceFamilyName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_TTF_FontFaceFamilyName(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string TTF_FontFaceFamilyName(
|
||||||
IntPtr font
|
IntPtr font
|
||||||
);
|
);
|
||||||
public static string TTF_FontFaceFamily(IntPtr font)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_TTF_FontFaceFamilyName(font)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* font refers to a TTF_Font* */
|
/* font refers to a TTF_Font* */
|
||||||
[DllImport(nativeLibName, EntryPoint = "TTF_FontFaceStyleName", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr INTERNAL_TTF_FontFaceStyleName(
|
[return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)]
|
||||||
|
public static extern string TTF_FontFaceStyleName(
|
||||||
IntPtr font
|
IntPtr font
|
||||||
);
|
);
|
||||||
public static string TTF_FontFaceStyleName(IntPtr font)
|
|
||||||
{
|
|
||||||
return Marshal.PtrToStringAnsi(
|
|
||||||
INTERNAL_TTF_FontFaceStyleName(font)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* font refers to a TTF_Font* */
|
/* font refers to a TTF_Font* */
|
||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int TTF_GlyphIsProvided(IntPtr font, ushort ch);
|
public static extern int TTF_GlyphIsProvided(IntPtr font, ushort ch);
|
||||||
@ -209,7 +199,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int TTF_SizeText(
|
public static extern int TTF_SizeText(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
ref int w,
|
ref int w,
|
||||||
ref int h
|
ref int h
|
||||||
@ -219,7 +209,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int TTF_SizeUTF8(
|
public static extern int TTF_SizeUTF8(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
ref int w,
|
ref int w,
|
||||||
ref int h
|
ref int h
|
||||||
@ -238,7 +228,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderText_Solid(
|
public static extern IntPtr TTF_RenderText_Solid(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg
|
SDL.SDL_Color fg
|
||||||
);
|
);
|
||||||
@ -247,7 +237,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderUTF8_Solid(
|
public static extern IntPtr TTF_RenderUTF8_Solid(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg
|
SDL.SDL_Color fg
|
||||||
);
|
);
|
||||||
@ -272,7 +262,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderText_Shaded(
|
public static extern IntPtr TTF_RenderText_Shaded(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg,
|
SDL.SDL_Color fg,
|
||||||
SDL.SDL_Color bg
|
SDL.SDL_Color bg
|
||||||
@ -282,7 +272,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderUTF8_Shaded(
|
public static extern IntPtr TTF_RenderUTF8_Shaded(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg,
|
SDL.SDL_Color fg,
|
||||||
SDL.SDL_Color bg
|
SDL.SDL_Color bg
|
||||||
@ -310,7 +300,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderText_Blended(
|
public static extern IntPtr TTF_RenderText_Blended(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg
|
SDL.SDL_Color fg
|
||||||
);
|
);
|
||||||
@ -319,7 +309,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderUTF8_Blended(
|
public static extern IntPtr TTF_RenderUTF8_Blended(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg
|
SDL.SDL_Color fg
|
||||||
);
|
);
|
||||||
@ -336,7 +326,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderText_Blended_Wrapped(
|
public static extern IntPtr TTF_RenderText_Blended_Wrapped(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg,
|
SDL.SDL_Color fg,
|
||||||
uint wrapped
|
uint wrapped
|
||||||
@ -346,7 +336,7 @@ namespace SDL2
|
|||||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr TTF_RenderUTF8_Blended_Wrapped(
|
public static extern IntPtr TTF_RenderUTF8_Blended_Wrapped(
|
||||||
IntPtr font,
|
IntPtr font,
|
||||||
[In()] [MarshalAs(UnmanagedType.LPStr)]
|
[In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))]
|
||||||
string text,
|
string text,
|
||||||
SDL.SDL_Color fg,
|
SDL.SDL_Color fg,
|
||||||
uint wrapped
|
uint wrapped
|
||||||
|
Loading…
x
Reference in New Issue
Block a user