mirror of https://github.com/ppy/SDL3-CS.git
179 lines
8.0 KiB
C#
179 lines
8.0 KiB
C#
/*
|
|
<auto-generated/>
|
|
C# bindings for Simple DirectMedia Layer.
|
|
Original copyright notice of input files:
|
|
|
|
Simple DirectMedia Layer
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
|
|
|
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.
|
|
*/
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace SDL
|
|
{
|
|
public partial struct SDL_Cursor
|
|
{
|
|
}
|
|
|
|
public enum SDL_SystemCursor
|
|
{
|
|
SDL_SYSTEM_CURSOR_DEFAULT,
|
|
SDL_SYSTEM_CURSOR_TEXT,
|
|
SDL_SYSTEM_CURSOR_WAIT,
|
|
SDL_SYSTEM_CURSOR_CROSSHAIR,
|
|
SDL_SYSTEM_CURSOR_PROGRESS,
|
|
SDL_SYSTEM_CURSOR_NWSE_RESIZE,
|
|
SDL_SYSTEM_CURSOR_NESW_RESIZE,
|
|
SDL_SYSTEM_CURSOR_EW_RESIZE,
|
|
SDL_SYSTEM_CURSOR_NS_RESIZE,
|
|
SDL_SYSTEM_CURSOR_MOVE,
|
|
SDL_SYSTEM_CURSOR_NOT_ALLOWED,
|
|
SDL_SYSTEM_CURSOR_POINTER,
|
|
SDL_SYSTEM_CURSOR_NW_RESIZE,
|
|
SDL_SYSTEM_CURSOR_N_RESIZE,
|
|
SDL_SYSTEM_CURSOR_NE_RESIZE,
|
|
SDL_SYSTEM_CURSOR_E_RESIZE,
|
|
SDL_SYSTEM_CURSOR_SE_RESIZE,
|
|
SDL_SYSTEM_CURSOR_S_RESIZE,
|
|
SDL_SYSTEM_CURSOR_SW_RESIZE,
|
|
SDL_SYSTEM_CURSOR_W_RESIZE,
|
|
SDL_SYSTEM_CURSOR_COUNT,
|
|
}
|
|
|
|
public enum SDL_MouseWheelDirection
|
|
{
|
|
SDL_MOUSEWHEEL_NORMAL,
|
|
SDL_MOUSEWHEEL_FLIPPED,
|
|
}
|
|
|
|
public static unsafe partial class SDL3
|
|
{
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_HasMouse();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_MouseID* SDL_GetMice(int* count);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_GetMouseNameForID", ExactSpelling = true)]
|
|
[return: NativeTypeName("const char *")]
|
|
public static extern byte* Unsafe_SDL_GetMouseNameForID(SDL_MouseID instance_id);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_Window* SDL_GetMouseFocus();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_MouseButtonFlags SDL_GetMouseState(float* x, float* y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_MouseButtonFlags SDL_GetGlobalMouseState(float* x, float* y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_MouseButtonFlags SDL_GetRelativeMouseState(float* x, float* y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern void SDL_WarpMouseInWindow(SDL_Window* window, float x, float y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_WarpMouseGlobal(float x, float y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_SetRelativeMouseTransform([NativeTypeName("SDL_MouseMotionTransformCallback")] delegate* unmanaged[Cdecl]<IntPtr, ulong, SDL_Window*, SDL_MouseID, float*, float*, void> callback, [NativeTypeName("void*")] IntPtr userdata);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_SetWindowRelativeMouseMode(SDL_Window* window, [NativeTypeName("bool")] SDLBool enabled);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_GetWindowRelativeMouseMode(SDL_Window* window);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_CaptureMouse([NativeTypeName("bool")] SDLBool enabled);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_Cursor* SDL_CreateCursor([NativeTypeName("const Uint8 *")] byte* data, [NativeTypeName("const Uint8 *")] byte* mask, int w, int h, int hot_x, int hot_y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_Cursor* SDL_CreateColorCursor(SDL_Surface* surface, int hot_x, int hot_y);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_Cursor* SDL_CreateSystemCursor(SDL_SystemCursor id);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_SetCursor(SDL_Cursor* cursor);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_Cursor* SDL_GetCursor();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_Cursor* SDL_GetDefaultCursor();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern void SDL_DestroyCursor(SDL_Cursor* cursor);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_ShowCursor();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_HideCursor();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("bool")]
|
|
public static extern SDLBool SDL_CursorVisible();
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_LEFT 1")]
|
|
public const int SDL_BUTTON_LEFT = 1;
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_MIDDLE 2")]
|
|
public const int SDL_BUTTON_MIDDLE = 2;
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_RIGHT 3")]
|
|
public const int SDL_BUTTON_RIGHT = 3;
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_X1 4")]
|
|
public const int SDL_BUTTON_X1 = 4;
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_X2 5")]
|
|
public const int SDL_BUTTON_X2 = 5;
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_LMASK SDL_BUTTON_MASK(SDL_BUTTON_LEFT)")]
|
|
public const uint SDL_BUTTON_LMASK = (1U << ((1) - 1));
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_MMASK SDL_BUTTON_MASK(SDL_BUTTON_MIDDLE)")]
|
|
public const uint SDL_BUTTON_MMASK = (1U << ((2) - 1));
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_RMASK SDL_BUTTON_MASK(SDL_BUTTON_RIGHT)")]
|
|
public const uint SDL_BUTTON_RMASK = (1U << ((3) - 1));
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_X1MASK SDL_BUTTON_MASK(SDL_BUTTON_X1)")]
|
|
public const uint SDL_BUTTON_X1MASK = (1U << ((4) - 1));
|
|
|
|
[NativeTypeName("#define SDL_BUTTON_X2MASK SDL_BUTTON_MASK(SDL_BUTTON_X2)")]
|
|
public const uint SDL_BUTTON_X2MASK = (1U << ((5) - 1));
|
|
}
|
|
}
|