daily update on 20230511 by nitlod youmu
This commit is contained in:
@@ -0,0 +1,494 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
//rename types in style of GLFW
|
||||
|
||||
using GLFWbool = Boolean;
|
||||
using _glfw = _GLFWlibrary;
|
||||
|
||||
public unsafe static partial class GLFW
|
||||
{
|
||||
internal static _glfw glfw = new _glfw();
|
||||
|
||||
//these are consts defined in GLFW3.h
|
||||
|
||||
public const int GLFW_VERSION_MAJOR = 3;
|
||||
public const int GLFW_VERSION_MINOR = 4;
|
||||
public const int GLFW_VERSION_REVISION = 0;
|
||||
public const int GLFW_TRUE = 1;
|
||||
public const int GLFW_FALSE = 0;
|
||||
public const int GLFW_RELEASE = 0;
|
||||
public const int GLFW_PRESS = 1;
|
||||
public const int GLFW_REPEAT = 2;
|
||||
public const int GLFW_HAT_CENTERED = 0;
|
||||
public const int GLFW_HAT_UP = 1;
|
||||
public const int GLFW_HAT_RIGHT = 2;
|
||||
public const int GLFW_HAT_DOWN = 4;
|
||||
public const int GLFW_HAT_LEFT = 8;
|
||||
public const int GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT | GLFW_HAT_UP);
|
||||
public const int GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN);
|
||||
public const int GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT | GLFW_HAT_UP);
|
||||
public const int GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT | GLFW_HAT_DOWN);
|
||||
public const int GLFW_KEY_UNKNOWN = -1;
|
||||
public const int GLFW_KEY_SPACE = 32;
|
||||
public const int GLFW_KEY_APOSTROPHE = 39/*'*/;
|
||||
public const int GLFW_KEY_COMMA = 44/*,*/;
|
||||
public const int GLFW_KEY_MINUS = 45/*-*/;
|
||||
public const int GLFW_KEY_PERIOD = 46/*.*/;
|
||||
public const int GLFW_KEY_SLASH = 47/*/*/;
|
||||
public const int GLFW_KEY_0 = 48;
|
||||
public const int GLFW_KEY_1 = 49;
|
||||
public const int GLFW_KEY_2 = 50;
|
||||
public const int GLFW_KEY_3 = 51;
|
||||
public const int GLFW_KEY_4 = 52;
|
||||
public const int GLFW_KEY_5 = 53;
|
||||
public const int GLFW_KEY_6 = 54;
|
||||
public const int GLFW_KEY_7 = 55;
|
||||
public const int GLFW_KEY_8 = 56;
|
||||
public const int GLFW_KEY_9 = 57;
|
||||
public const int GLFW_KEY_SEMICOLON = 59/*;*/;
|
||||
public const int GLFW_KEY_EQUAL = 61/*=*/;
|
||||
public const int GLFW_KEY_A = 65;
|
||||
public const int GLFW_KEY_B = 66;
|
||||
public const int GLFW_KEY_C = 67;
|
||||
public const int GLFW_KEY_D = 68;
|
||||
public const int GLFW_KEY_E = 69;
|
||||
public const int GLFW_KEY_F = 70;
|
||||
public const int GLFW_KEY_G = 71;
|
||||
public const int GLFW_KEY_H = 72;
|
||||
public const int GLFW_KEY_I = 73;
|
||||
public const int GLFW_KEY_J = 74;
|
||||
public const int GLFW_KEY_K = 75;
|
||||
public const int GLFW_KEY_L = 76;
|
||||
public const int GLFW_KEY_M = 77;
|
||||
public const int GLFW_KEY_N = 78;
|
||||
public const int GLFW_KEY_O = 79;
|
||||
public const int GLFW_KEY_P = 80;
|
||||
public const int GLFW_KEY_Q = 81;
|
||||
public const int GLFW_KEY_R = 82;
|
||||
public const int GLFW_KEY_S = 83;
|
||||
public const int GLFW_KEY_T = 84;
|
||||
public const int GLFW_KEY_U = 85;
|
||||
public const int GLFW_KEY_V = 86;
|
||||
public const int GLFW_KEY_W = 87;
|
||||
public const int GLFW_KEY_X = 88;
|
||||
public const int GLFW_KEY_Y = 89;
|
||||
public const int GLFW_KEY_Z = 90;
|
||||
public const int GLFW_KEY_LEFT_BRACKET = 91/*[*/;
|
||||
public const int GLFW_KEY_BACKSLASH = 92/*\*/;
|
||||
public const int GLFW_KEY_RIGHT_BRACKET = 93/*]*/;
|
||||
public const int GLFW_KEY_GRAVE_ACCENT = 96/*`*/;
|
||||
public const int GLFW_KEY_WORLD_1 = 161/*non-US#1*/;
|
||||
public const int GLFW_KEY_WORLD_2 = 162/*non-US#2*/;
|
||||
public const int GLFW_KEY_ESCAPE = 256;
|
||||
public const int GLFW_KEY_ENTER = 257;
|
||||
public const int GLFW_KEY_TAB = 258;
|
||||
public const int GLFW_KEY_BACKSPACE = 259;
|
||||
public const int GLFW_KEY_INSERT = 260;
|
||||
public const int GLFW_KEY_DELETE = 261;
|
||||
public const int GLFW_KEY_RIGHT = 262;
|
||||
public const int GLFW_KEY_LEFT = 263;
|
||||
public const int GLFW_KEY_DOWN = 264;
|
||||
public const int GLFW_KEY_UP = 265;
|
||||
public const int GLFW_KEY_PAGE_UP = 266;
|
||||
public const int GLFW_KEY_PAGE_DOWN = 267;
|
||||
public const int GLFW_KEY_HOME = 268;
|
||||
public const int GLFW_KEY_END = 269;
|
||||
public const int GLFW_KEY_CAPS_LOCK = 280;
|
||||
public const int GLFW_KEY_SCROLL_LOCK = 281;
|
||||
public const int GLFW_KEY_NUM_LOCK = 282;
|
||||
public const int GLFW_KEY_PRINT_SCREEN = 283;
|
||||
public const int GLFW_KEY_PAUSE = 284;
|
||||
public const int GLFW_KEY_F1 = 290;
|
||||
public const int GLFW_KEY_F2 = 291;
|
||||
public const int GLFW_KEY_F3 = 292;
|
||||
public const int GLFW_KEY_F4 = 293;
|
||||
public const int GLFW_KEY_F5 = 294;
|
||||
public const int GLFW_KEY_F6 = 295;
|
||||
public const int GLFW_KEY_F7 = 296;
|
||||
public const int GLFW_KEY_F8 = 297;
|
||||
public const int GLFW_KEY_F9 = 298;
|
||||
public const int GLFW_KEY_F10 = 299;
|
||||
public const int GLFW_KEY_F11 = 300;
|
||||
public const int GLFW_KEY_F12 = 301;
|
||||
public const int GLFW_KEY_F13 = 302;
|
||||
public const int GLFW_KEY_F14 = 303;
|
||||
public const int GLFW_KEY_F15 = 304;
|
||||
public const int GLFW_KEY_F16 = 305;
|
||||
public const int GLFW_KEY_F17 = 306;
|
||||
public const int GLFW_KEY_F18 = 307;
|
||||
public const int GLFW_KEY_F19 = 308;
|
||||
public const int GLFW_KEY_F20 = 309;
|
||||
public const int GLFW_KEY_F21 = 310;
|
||||
public const int GLFW_KEY_F22 = 311;
|
||||
public const int GLFW_KEY_F23 = 312;
|
||||
public const int GLFW_KEY_F24 = 313;
|
||||
public const int GLFW_KEY_F25 = 314;
|
||||
public const int GLFW_KEY_KP_0 = 320;
|
||||
public const int GLFW_KEY_KP_1 = 321;
|
||||
public const int GLFW_KEY_KP_2 = 322;
|
||||
public const int GLFW_KEY_KP_3 = 323;
|
||||
public const int GLFW_KEY_KP_4 = 324;
|
||||
public const int GLFW_KEY_KP_5 = 325;
|
||||
public const int GLFW_KEY_KP_6 = 326;
|
||||
public const int GLFW_KEY_KP_7 = 327;
|
||||
public const int GLFW_KEY_KP_8 = 328;
|
||||
public const int GLFW_KEY_KP_9 = 329;
|
||||
public const int GLFW_KEY_KP_DECIMAL = 330;
|
||||
public const int GLFW_KEY_KP_DIVIDE = 331;
|
||||
public const int GLFW_KEY_KP_MULTIPLY = 332;
|
||||
public const int GLFW_KEY_KP_SUBTRACT = 333;
|
||||
public const int GLFW_KEY_KP_ADD = 334;
|
||||
public const int GLFW_KEY_KP_ENTER = 335;
|
||||
public const int GLFW_KEY_KP_EQUAL = 336;
|
||||
public const int GLFW_KEY_LEFT_SHIFT = 340;
|
||||
public const int GLFW_KEY_LEFT_CONTROL = 341;
|
||||
public const int GLFW_KEY_LEFT_ALT = 342;
|
||||
public const int GLFW_KEY_LEFT_SUPER = 343;
|
||||
public const int GLFW_KEY_RIGHT_SHIFT = 344;
|
||||
public const int GLFW_KEY_RIGHT_CONTROL = 345;
|
||||
public const int GLFW_KEY_RIGHT_ALT = 346;
|
||||
public const int GLFW_KEY_RIGHT_SUPER = 347;
|
||||
public const int GLFW_KEY_MENU = 348;
|
||||
public const int GLFW_KEY_LAST = GLFW_KEY_MENU;
|
||||
public const int GLFW_MOD_SHIFT = 0x0001;
|
||||
public const int GLFW_MOD_CONTROL = 0x0002;
|
||||
public const int GLFW_MOD_ALT = 0x0004;
|
||||
public const int GLFW_MOD_SUPER = 0x0008;
|
||||
public const int GLFW_MOD_CAPS_LOCK = 0x0010;
|
||||
public const int GLFW_MOD_NUM_LOCK = 0x0020;
|
||||
public const int GLFW_MOUSE_BUTTON_1 = 0;
|
||||
public const int GLFW_MOUSE_BUTTON_2 = 1;
|
||||
public const int GLFW_MOUSE_BUTTON_3 = 2;
|
||||
public const int GLFW_MOUSE_BUTTON_4 = 3;
|
||||
public const int GLFW_MOUSE_BUTTON_5 = 4;
|
||||
public const int GLFW_MOUSE_BUTTON_6 = 5;
|
||||
public const int GLFW_MOUSE_BUTTON_7 = 6;
|
||||
public const int GLFW_MOUSE_BUTTON_8 = 7;
|
||||
public const int GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8;
|
||||
public const int GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1;
|
||||
public const int GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2;
|
||||
public const int GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3;
|
||||
public const int GLFW_JOYSTICK_1 = 0;
|
||||
public const int GLFW_JOYSTICK_2 = 1;
|
||||
public const int GLFW_JOYSTICK_3 = 2;
|
||||
public const int GLFW_JOYSTICK_4 = 3;
|
||||
public const int GLFW_JOYSTICK_5 = 4;
|
||||
public const int GLFW_JOYSTICK_6 = 5;
|
||||
public const int GLFW_JOYSTICK_7 = 6;
|
||||
public const int GLFW_JOYSTICK_8 = 7;
|
||||
public const int GLFW_JOYSTICK_9 = 8;
|
||||
public const int GLFW_JOYSTICK_10 = 9;
|
||||
public const int GLFW_JOYSTICK_11 = 10;
|
||||
public const int GLFW_JOYSTICK_12 = 11;
|
||||
public const int GLFW_JOYSTICK_13 = 12;
|
||||
public const int GLFW_JOYSTICK_14 = 13;
|
||||
public const int GLFW_JOYSTICK_15 = 14;
|
||||
public const int GLFW_JOYSTICK_16 = 15;
|
||||
public const int GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16;
|
||||
public const int GLFW_GAMEPAD_BUTTON_A = 0;
|
||||
public const int GLFW_GAMEPAD_BUTTON_B = 1;
|
||||
public const int GLFW_GAMEPAD_BUTTON_X = 2;
|
||||
public const int GLFW_GAMEPAD_BUTTON_Y = 3;
|
||||
public const int GLFW_GAMEPAD_BUTTON_LEFT_BUMPER = 4;
|
||||
public const int GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER = 5;
|
||||
public const int GLFW_GAMEPAD_BUTTON_BACK = 6;
|
||||
public const int GLFW_GAMEPAD_BUTTON_START = 7;
|
||||
public const int GLFW_GAMEPAD_BUTTON_GUIDE = 8;
|
||||
public const int GLFW_GAMEPAD_BUTTON_LEFT_THUMB = 9;
|
||||
public const int GLFW_GAMEPAD_BUTTON_RIGHT_THUMB = 10;
|
||||
public const int GLFW_GAMEPAD_BUTTON_DPAD_UP = 11;
|
||||
public const int GLFW_GAMEPAD_BUTTON_DPAD_RIGHT = 12;
|
||||
public const int GLFW_GAMEPAD_BUTTON_DPAD_DOWN = 13;
|
||||
public const int GLFW_GAMEPAD_BUTTON_DPAD_LEFT = 14;
|
||||
public const int GLFW_GAMEPAD_BUTTON_LAST = GLFW_GAMEPAD_BUTTON_DPAD_LEFT;
|
||||
public const int GLFW_GAMEPAD_BUTTON_CROSS = GLFW_GAMEPAD_BUTTON_A;
|
||||
public const int GLFW_GAMEPAD_BUTTON_CIRCLE = GLFW_GAMEPAD_BUTTON_B;
|
||||
public const int GLFW_GAMEPAD_BUTTON_SQUARE = GLFW_GAMEPAD_BUTTON_X;
|
||||
public const int GLFW_GAMEPAD_BUTTON_TRIANGLE = GLFW_GAMEPAD_BUTTON_Y;
|
||||
public const int GLFW_GAMEPAD_AXIS_LEFT_X = 0;
|
||||
public const int GLFW_GAMEPAD_AXIS_LEFT_Y = 1;
|
||||
public const int GLFW_GAMEPAD_AXIS_RIGHT_X = 2;
|
||||
public const int GLFW_GAMEPAD_AXIS_RIGHT_Y = 3;
|
||||
public const int GLFW_GAMEPAD_AXIS_LEFT_TRIGGER = 4;
|
||||
public const int GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER = 5;
|
||||
public const int GLFW_GAMEPAD_AXIS_LAST = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER;
|
||||
public const int GLFW_NO_ERROR = 0;
|
||||
public const int GLFW_NOT_INITIALIZED = 0x00010001;
|
||||
public const int GLFW_NO_CURRENT_CONTEXT = 0x00010002;
|
||||
public const int GLFW_INVALID_ENUM = 0x00010003;
|
||||
public const int GLFW_INVALID_VALUE = 0x00010004;
|
||||
public const int GLFW_OUT_OF_MEMORY = 0x00010005;
|
||||
public const int GLFW_API_UNAVAILABLE = 0x00010006;
|
||||
public const int GLFW_VERSION_UNAVAILABLE = 0x00010007;
|
||||
public const int GLFW_PLATFORM_ERROR = 0x00010008;
|
||||
public const int GLFW_FORMAT_UNAVAILABLE = 0x00010009;
|
||||
public const int GLFW_NO_WINDOW_CONTEXT = 0x0001000A;
|
||||
public const int GLFW_CURSOR_UNAVAILABLE = 0x0001000B;
|
||||
public const int GLFW_FEATURE_UNAVAILABLE = 0x0001000C;
|
||||
public const int GLFW_FEATURE_UNIMPLEMENTED = 0x0001000D;
|
||||
public const int GLFW_PLATFORM_UNAVAILABLE = 0x0001000E;
|
||||
public const int GLFW_FOCUSED = 0x00020001;
|
||||
public const int GLFW_ICONIFIED = 0x00020002;
|
||||
public const int GLFW_RESIZABLE = 0x00020003;
|
||||
public const int GLFW_VISIBLE = 0x00020004;
|
||||
public const int GLFW_DECORATED = 0x00020005;
|
||||
public const int GLFW_AUTO_ICONIFY = 0x00020006;
|
||||
public const int GLFW_FLOATING = 0x00020007;
|
||||
public const int GLFW_MAXIMIZED = 0x00020008;
|
||||
public const int GLFW_CENTER_CURSOR = 0x00020009;
|
||||
public const int GLFW_TRANSPARENT_FRAMEBUFFER = 0x0002000A;
|
||||
public const int GLFW_HOVERED = 0x0002000B;
|
||||
public const int GLFW_FOCUS_ON_SHOW = 0x0002000C;
|
||||
public const int GLFW_MOUSE_PASSTHROUGH = 0x0002000D;
|
||||
public const int GLFW_POSITION_X = 0x0002000E;
|
||||
public const int GLFW_POSITION_Y = 0x0002000F;
|
||||
public const int GLFW_RED_BITS = 0x00021001;
|
||||
public const int GLFW_GREEN_BITS = 0x00021002;
|
||||
public const int GLFW_BLUE_BITS = 0x00021003;
|
||||
public const int GLFW_ALPHA_BITS = 0x00021004;
|
||||
public const int GLFW_DEPTH_BITS = 0x00021005;
|
||||
public const int GLFW_STENCIL_BITS = 0x00021006;
|
||||
public const int GLFW_ACCUM_RED_BITS = 0x00021007;
|
||||
public const int GLFW_ACCUM_GREEN_BITS = 0x00021008;
|
||||
public const int GLFW_ACCUM_BLUE_BITS = 0x00021009;
|
||||
public const int GLFW_ACCUM_ALPHA_BITS = 0x0002100A;
|
||||
public const int GLFW_AUX_BUFFERS = 0x0002100B;
|
||||
public const int GLFW_STEREO = 0x0002100C;
|
||||
public const int GLFW_SAMPLES = 0x0002100D;
|
||||
public const int GLFW_SRGB_CAPABLE = 0x0002100E;
|
||||
public const int GLFW_REFRESH_RATE = 0x0002100F;
|
||||
public const int GLFW_DOUBLEBUFFER = 0x00021010;
|
||||
public const int GLFW_CLIENT_API = 0x00022001;
|
||||
public const int GLFW_CONTEXT_VERSION_MAJOR = 0x00022002;
|
||||
public const int GLFW_CONTEXT_VERSION_MINOR = 0x00022003;
|
||||
public const int GLFW_CONTEXT_REVISION = 0x00022004;
|
||||
public const int GLFW_CONTEXT_ROBUSTNESS = 0x00022005;
|
||||
public const int GLFW_OPENGL_FORWARD_COMPAT = 0x00022006;
|
||||
public const int GLFW_CONTEXT_DEBUG = 0x00022007;
|
||||
public const int GLFW_OPENGL_DEBUG_CONTEXT = GLFW_CONTEXT_DEBUG;
|
||||
public const int GLFW_OPENGL_PROFILE = 0x00022008;
|
||||
public const int GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x00022009;
|
||||
public const int GLFW_CONTEXT_NO_ERROR = 0x0002200A;
|
||||
public const int GLFW_CONTEXT_CREATION_API = 0x0002200B;
|
||||
public const int GLFW_SCALE_TO_MONITOR = 0x0002200C;
|
||||
public const int GLFW_COCOA_RETINA_FRAMEBUFFER = 0x00023001;
|
||||
public const int GLFW_COCOA_FRAME_NAME = 0x00023002;
|
||||
public const int GLFW_COCOA_GRAPHICS_SWITCHING = 0x00023003;
|
||||
public const int GLFW_X11_CLASS_NAME = 0x00024001;
|
||||
public const int GLFW_X11_INSTANCE_NAME = 0x00024002;
|
||||
public const int GLFW_WIN32_KEYBOARD_MENU = 0x00025001;
|
||||
public const int GLFW_WAYLAND_APP_ID = 0x00026001;
|
||||
public const int GLFW_NO_API = 0;
|
||||
public const int GLFW_OPENGL_API = 0x00030001;
|
||||
public const int GLFW_OPENGL_ES_API = 0x00030002;
|
||||
public const int GLFW_NO_ROBUSTNESS = 0;
|
||||
public const int GLFW_NO_RESET_NOTIFICATION = 0x00031001;
|
||||
public const int GLFW_LOSE_CONTEXT_ON_RESET = 0x00031002;
|
||||
public const int GLFW_OPENGL_ANY_PROFILE = 0;
|
||||
public const int GLFW_OPENGL_CORE_PROFILE = 0x00032001;
|
||||
public const int GLFW_OPENGL_COMPAT_PROFILE = 0x00032002;
|
||||
public const int GLFW_CURSOR = 0x00033001;
|
||||
public const int GLFW_STICKY_KEYS = 0x00033002;
|
||||
public const int GLFW_STICKY_MOUSE_BUTTONS = 0x00033003;
|
||||
public const int GLFW_LOCK_KEY_MODS = 0x00033004;
|
||||
public const int GLFW_RAW_MOUSE_MOTION = 0x00033005;
|
||||
public const int GLFW_CURSOR_NORMAL = 0x00034001;
|
||||
public const int GLFW_CURSOR_HIDDEN = 0x00034002;
|
||||
public const int GLFW_CURSOR_DISABLED = 0x00034003;
|
||||
public const int GLFW_CURSOR_CAPTURED = 0x00034004;
|
||||
public const int GLFW_ANY_RELEASE_BEHAVIOR = 0;
|
||||
public const int GLFW_RELEASE_BEHAVIOR_FLUSH = 0x00035001;
|
||||
public const int GLFW_RELEASE_BEHAVIOR_NONE = 0x00035002;
|
||||
public const int GLFW_NATIVE_CONTEXT_API = 0x00036001;
|
||||
public const int GLFW_EGL_CONTEXT_API = 0x00036002;
|
||||
public const int GLFW_OSMESA_CONTEXT_API = 0x00036003;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_NONE = 0x00037001;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_OPENGL = 0x00037002;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_OPENGLES = 0x00037003;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_D3D9 = 0x00037004;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_D3D11 = 0x00037005;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_VULKAN = 0x00037007;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE_METAL = 0x00037008;
|
||||
public const int GLFW_WAYLAND_PREFER_LIBDECOR = 0x00038001;
|
||||
public const int GLFW_WAYLAND_DISABLE_LIBDECOR = 0x00038002;
|
||||
public const uint GLFW_ANY_POSITION = 0x80000000;
|
||||
public const int GLFW_ARROW_CURSOR = 0x00036001;
|
||||
public const int GLFW_IBEAM_CURSOR = 0x00036002;
|
||||
public const int GLFW_CROSSHAIR_CURSOR = 0x00036003;
|
||||
public const int GLFW_POINTING_HAND_CURSOR = 0x00036004;
|
||||
public const int GLFW_RESIZE_EW_CURSOR = 0x00036005;
|
||||
public const int GLFW_RESIZE_NS_CURSOR = 0x00036006;
|
||||
public const int GLFW_RESIZE_NWSE_CURSOR = 0x00036007;
|
||||
public const int GLFW_RESIZE_NESW_CURSOR = 0x00036008;
|
||||
public const int GLFW_RESIZE_ALL_CURSOR = 0x00036009;
|
||||
public const int GLFW_NOT_ALLOWED_CURSOR = 0x0003600A;
|
||||
public const int GLFW_HRESIZE_CURSOR = GLFW_RESIZE_EW_CURSOR;
|
||||
public const int GLFW_VRESIZE_CURSOR = GLFW_RESIZE_NS_CURSOR;
|
||||
public const int GLFW_HAND_CURSOR = GLFW_POINTING_HAND_CURSOR;
|
||||
public const int GLFW_CONNECTED = 0x00040001;
|
||||
public const int GLFW_DISCONNECTED = 0x00040002;
|
||||
public const int GLFW_JOYSTICK_HAT_BUTTONS = 0x00050001;
|
||||
public const int GLFW_ANGLE_PLATFORM_TYPE = 0x00050002;
|
||||
public const int GLFW_PLATFORM = 0x00050003;
|
||||
public const int GLFW_COCOA_CHDIR_RESOURCES = 0x00051001;
|
||||
public const int GLFW_COCOA_MENUBAR = 0x00051002;
|
||||
public const int GLFW_X11_XCB_VULKAN_SURFACE = 0x00052001;
|
||||
public const int GLFW_WAYLAND_LIBDECOR = 0x00053001;
|
||||
public const int GLFW_ANY_PLATFORM = 0x00060000;
|
||||
public const int GLFW_PLATFORM_WIN32 = 0x00060001;
|
||||
public const int GLFW_PLATFORM_COCOA = 0x00060002;
|
||||
public const int GLFW_PLATFORM_WAYLAND = 0x00060003;
|
||||
public const int GLFW_PLATFORM_X11 = 0x00060004;
|
||||
public const int GLFW_PLATFORM_NULL = 0x00060005;
|
||||
public const int GLFW_DONT_CARE = -1;
|
||||
|
||||
|
||||
|
||||
//consts in internal.h
|
||||
|
||||
internal const uint _GLFW_INSERT_FIRST = 0;
|
||||
internal const uint _GLFW_INSERT_LAST = 1;
|
||||
internal const uint _GLFW_POLL_PRESENCE = 0;
|
||||
internal const uint _GLFW_POLL_AXES = 1;
|
||||
internal const uint _GLFW_POLL_BUTTONS = 2;
|
||||
internal const uint _GLFW_POLL_ALL = (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS);
|
||||
internal const uint _GLFW_MESSAGE_SIZE = 1024;
|
||||
internal const uint GL_VERSION = 0x1f02;
|
||||
internal const uint GL_NONE = 0;
|
||||
internal const uint GL_COLOR_BUFFER_BIT = 0x00004000;
|
||||
internal const uint GL_UNSIGNED_BYTE = 0x1401;
|
||||
internal const uint GL_EXTENSIONS = 0x1f03;
|
||||
internal const uint GL_NUM_EXTENSIONS = 0x821d;
|
||||
internal const uint GL_CONTEXT_FLAGS = 0x821e;
|
||||
internal const uint GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001;
|
||||
internal const uint GL_CONTEXT_FLAG_DEBUG_BIT = 0x00000002;
|
||||
internal const uint GL_CONTEXT_PROFILE_MASK = 0x9126;
|
||||
internal const uint GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002;
|
||||
internal const uint GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001;
|
||||
internal const uint GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256;
|
||||
internal const uint GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252;
|
||||
internal const uint GL_NO_RESET_NOTIFICATION_ARB = 0x8261;
|
||||
internal const uint GL_CONTEXT_RELEASE_BEHAVIOR = 0x82fb;
|
||||
internal const uint GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82fc;
|
||||
internal const uint GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008;
|
||||
internal const uint EGL_SUCCESS = 0x3000;
|
||||
internal const uint EGL_NOT_INITIALIZED = 0x3001;
|
||||
internal const uint EGL_BAD_ACCESS = 0x3002;
|
||||
internal const uint EGL_BAD_ALLOC = 0x3003;
|
||||
internal const uint EGL_BAD_ATTRIBUTE = 0x3004;
|
||||
internal const uint EGL_BAD_CONFIG = 0x3005;
|
||||
internal const uint EGL_BAD_CONTEXT = 0x3006;
|
||||
internal const uint EGL_BAD_CURRENT_SURFACE = 0x3007;
|
||||
internal const uint EGL_BAD_DISPLAY = 0x3008;
|
||||
internal const uint EGL_BAD_MATCH = 0x3009;
|
||||
internal const uint EGL_BAD_NATIVE_PIXMAP = 0x300a;
|
||||
internal const uint EGL_BAD_NATIVE_WINDOW = 0x300b;
|
||||
internal const uint EGL_BAD_PARAMETER = 0x300c;
|
||||
internal const uint EGL_BAD_SURFACE = 0x300d;
|
||||
internal const uint EGL_CONTEXT_LOST = 0x300e;
|
||||
internal const uint EGL_COLOR_BUFFER_TYPE = 0x303f;
|
||||
internal const uint EGL_RGB_BUFFER = 0x308e;
|
||||
internal const uint EGL_SURFACE_TYPE = 0x3033;
|
||||
internal const uint EGL_WINDOW_BIT = 0x0004;
|
||||
internal const uint EGL_RENDERABLE_TYPE = 0x3040;
|
||||
internal const uint EGL_OPENGL_ES_BIT = 0x0001;
|
||||
internal const uint EGL_OPENGL_ES2_BIT = 0x0004;
|
||||
internal const uint EGL_OPENGL_BIT = 0x0008;
|
||||
internal const uint EGL_ALPHA_SIZE = 0x3021;
|
||||
internal const uint EGL_BLUE_SIZE = 0x3022;
|
||||
internal const uint EGL_GREEN_SIZE = 0x3023;
|
||||
internal const uint EGL_RED_SIZE = 0x3024;
|
||||
internal const uint EGL_DEPTH_SIZE = 0x3025;
|
||||
internal const uint EGL_STENCIL_SIZE = 0x3026;
|
||||
internal const uint EGL_SAMPLES = 0x3031;
|
||||
internal const uint EGL_OPENGL_ES_API = 0x30a0;
|
||||
internal const uint EGL_OPENGL_API = 0x30a2;
|
||||
internal const uint EGL_NONE = 0x3038;
|
||||
internal const uint EGL_RENDER_BUFFER = 0x3086;
|
||||
internal const uint EGL_SINGLE_BUFFER = 0x3085;
|
||||
internal const uint EGL_EXTENSIONS = 0x3055;
|
||||
internal const uint EGL_CONTEXT_CLIENT_VERSION = 0x3098;
|
||||
internal const uint EGL_NATIVE_VISUAL_ID = 0x302e;
|
||||
//internal const uint EGL_NO_SURFACE = ((EGLSurface)0);
|
||||
internal static void* EGL_NO_SURFACE = ((void*)0);
|
||||
//internal const uint EGL_NO_DISPLAY = ((EGLDisplay)0);
|
||||
internal static void* EGL_NO_DISPLAY = ((void*)0);
|
||||
//internal const uint EGL_NO_CONTEXT = ((EGLContext)0);
|
||||
internal static void* EGL_NO_CONTEXT = ((void*)0);
|
||||
//internal const uint EGL_DEFAULT_DISPLAY = ((EGLNativeDisplayType)0);
|
||||
internal static void* EGL_DEFAULT_DISPLAY = ((void*)0);
|
||||
internal const uint EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR = 0x00000002;
|
||||
internal const uint EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR = 0x00000001;
|
||||
internal const uint EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR = 0x00000002;
|
||||
internal const uint EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR = 0x00000001;
|
||||
internal const uint EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR = 0x31bd;
|
||||
internal const uint EGL_NO_RESET_NOTIFICATION_KHR = 0x31be;
|
||||
internal const uint EGL_LOSE_CONTEXT_ON_RESET_KHR = 0x31bf;
|
||||
internal const uint EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR = 0x00000004;
|
||||
internal const uint EGL_CONTEXT_MAJOR_VERSION_KHR = 0x3098;
|
||||
internal const uint EGL_CONTEXT_MINOR_VERSION_KHR = 0x30fb;
|
||||
internal const uint EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR = 0x30fd;
|
||||
internal const uint EGL_CONTEXT_FLAGS_KHR = 0x30fc;
|
||||
internal const uint EGL_CONTEXT_OPENGL_NO_ERROR_KHR = 0x31b3;
|
||||
internal const uint EGL_GL_COLORSPACE_KHR = 0x309d;
|
||||
internal const uint EGL_GL_COLORSPACE_SRGB_KHR = 0x3089;
|
||||
internal const uint EGL_CONTEXT_RELEASE_BEHAVIOR_KHR = 0x2097;
|
||||
internal const uint EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR = 0;
|
||||
internal const uint EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR = 0x2098;
|
||||
internal const uint EGL_PLATFORM_X11_EXT = 0x31d5;
|
||||
internal const uint EGL_PLATFORM_WAYLAND_EXT = 0x31d8;
|
||||
internal const uint EGL_PRESENT_OPAQUE_EXT = 0x31df;
|
||||
internal const uint EGL_PLATFORM_ANGLE_ANGLE = 0x3202;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_ANGLE = 0x3203;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE = 0x320d;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE = 0x320e;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE = 0x3207;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE = 0x3450;
|
||||
internal const uint EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE = 0x3489;
|
||||
internal const uint EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE = 0x348f;
|
||||
internal static IntPtr eglGetConfigAttrib = glfw.egl.GetConfigAttrib;
|
||||
internal static IntPtr eglGetConfigs = glfw.egl.GetConfigs;
|
||||
internal static IntPtr eglGetDisplay = glfw.egl.GetDisplay;
|
||||
internal static IntPtr eglGetError = glfw.egl.GetError;
|
||||
internal static IntPtr eglInitialize = glfw.egl.Initialize;
|
||||
internal static IntPtr eglTerminate = glfw.egl.Terminate;
|
||||
internal static IntPtr eglBindAPI = glfw.egl.BindAPI;
|
||||
internal static IntPtr eglCreateContext = glfw.egl.CreateContext;
|
||||
internal static IntPtr eglDestroySurface = glfw.egl.DestroySurface;
|
||||
internal static IntPtr eglDestroyContext = glfw.egl.DestroyContext;
|
||||
internal static IntPtr eglCreateWindowSurface = glfw.egl.CreateWindowSurface;
|
||||
internal static IntPtr eglMakeCurrent = glfw.egl.MakeCurrent;
|
||||
internal static IntPtr eglSwapBuffers = glfw.egl.SwapBuffers;
|
||||
internal static IntPtr eglSwapInterval = glfw.egl.SwapInterval;
|
||||
internal static IntPtr eglQueryString = glfw.egl.QueryString;
|
||||
internal static IntPtr eglGetProcAddress = glfw.egl.GetProcAddress;
|
||||
internal static IntPtr eglGetPlatformDisplayEXT = glfw.egl.GetPlatformDisplayEXT;
|
||||
internal static IntPtr eglCreatePlatformWindowSurfaceEXT = glfw.egl.CreatePlatformWindowSurfaceEXT;
|
||||
internal const uint OSMESA_RGBA = 0x1908;
|
||||
internal const uint OSMESA_FORMAT = 0x22;
|
||||
internal const uint OSMESA_DEPTH_BITS = 0x30;
|
||||
internal const uint OSMESA_STENCIL_BITS = 0x31;
|
||||
internal const uint OSMESA_ACCUM_BITS = 0x32;
|
||||
internal const uint OSMESA_PROFILE = 0x33;
|
||||
internal const uint OSMESA_CORE_PROFILE = 0x34;
|
||||
internal const uint OSMESA_COMPAT_PROFILE = 0x35;
|
||||
internal const uint OSMESA_CONTEXT_MAJOR_VERSION = 0x36;
|
||||
internal const uint OSMESA_CONTEXT_MINOR_VERSION = 0x37;
|
||||
internal static IntPtr OSMesaCreateContextExt;
|
||||
internal static IntPtr OSMesaCreateContextAttribs;
|
||||
internal static IntPtr OSMesaDestroyContext;
|
||||
internal static IntPtr OSMesaMakeCurrent;
|
||||
internal static IntPtr OSMesaGetColorBuffer;
|
||||
internal static IntPtr OSMesaGetDepthBuffer;
|
||||
internal static IntPtr OSMesaGetProcAddress;
|
||||
internal const uint VK_NULL_HANDLE = 0;
|
||||
internal static IntPtr vkGetInstanceProcAddr;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal enum VkStructureType:uint
|
||||
{
|
||||
VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
|
||||
VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
|
||||
VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
|
||||
VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
|
||||
VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000,
|
||||
VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000,
|
||||
VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
|
||||
}
|
||||
|
||||
internal enum VkResult
|
||||
{
|
||||
VK_SUCCESS = 0,
|
||||
VK_NOT_READY = 1,
|
||||
VK_TIMEOUT = 2,
|
||||
VK_EVENT_SET = 3,
|
||||
VK_EVENT_RESET = 4,
|
||||
VK_INCOMPLETE = 5,
|
||||
VK_ERROR_OUT_OF_HOST_MEMORY = -1,
|
||||
VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
|
||||
VK_ERROR_INITIALIZATION_FAILED = -3,
|
||||
VK_ERROR_DEVICE_LOST = -4,
|
||||
VK_ERROR_MEMORY_MAP_FAILED = -5,
|
||||
VK_ERROR_LAYER_NOT_PRESENT = -6,
|
||||
VK_ERROR_EXTENSION_NOT_PRESENT = -7,
|
||||
VK_ERROR_FEATURE_NOT_PRESENT = -8,
|
||||
VK_ERROR_INCOMPATIBLE_DRIVER = -9,
|
||||
VK_ERROR_TOO_MANY_OBJECTS = -10,
|
||||
VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
|
||||
VK_ERROR_SURFACE_LOST_KHR = -1000000000,
|
||||
VK_SUBOPTIMAL_KHR = 1000001003,
|
||||
VK_ERROR_OUT_OF_DATE_KHR = -1000001004,
|
||||
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
|
||||
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
|
||||
VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
|
||||
VK_RESULT_MAX_ENUM = 0x7FFFFFFF
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,782 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
//rename types in style of GLFW
|
||||
|
||||
using GLFWbool = Boolean;
|
||||
using _glfw = _GLFWlibrary;
|
||||
|
||||
//strucs defined in glfw3.h
|
||||
|
||||
|
||||
public unsafe struct GLFWcontext
|
||||
{
|
||||
int client;
|
||||
int source;
|
||||
int major, minor, revision;
|
||||
GLFWbool forward, debug, noerror;
|
||||
int profile;
|
||||
int robustness;
|
||||
int release;
|
||||
|
||||
//PFNGLGETSTRINGIPROC GetStringi;
|
||||
IntPtr GetStringi;
|
||||
//PFNGLGETINTEGERVPROC GetIntegerv;
|
||||
IntPtr GetIntegerv;
|
||||
//PFNGLGETSTRINGPROC GetString;
|
||||
IntPtr GetString;
|
||||
|
||||
/*
|
||||
void (* makeCurrent) (_GLFWwindow*);
|
||||
void (* swapBuffers) (_GLFWwindow*);
|
||||
void (* swapInterval) (int);
|
||||
int (* extensionSupported) (const char*);
|
||||
GLFWglproc(*getProcAddress)(const char*);
|
||||
void (* destroy) (_GLFWwindow*);
|
||||
*/
|
||||
|
||||
IntPtr makeCurrent;
|
||||
IntPtr swapBuffer;
|
||||
IntPtr swapInterval;
|
||||
IntPtr extensionSupported;
|
||||
IntPtr getProcAddress;
|
||||
IntPtr destroy;
|
||||
|
||||
internal struct egl
|
||||
{
|
||||
/*
|
||||
EGLConfig config;
|
||||
EGLContext handle;
|
||||
EGLSurface surface;
|
||||
*/
|
||||
void* config;
|
||||
void* handle;
|
||||
void* surface;
|
||||
void* client;
|
||||
}
|
||||
|
||||
internal struct osmesa
|
||||
{
|
||||
//OSMesaContext handle;
|
||||
void* handle;
|
||||
int width;
|
||||
int height;
|
||||
void* buffer;
|
||||
}
|
||||
|
||||
// This is defined in platform.h
|
||||
//GLFW_PLATFORM_CONTEXT_STATE
|
||||
}
|
||||
|
||||
|
||||
public unsafe struct GLFWvidmode
|
||||
{
|
||||
/*! The width, in screen coordinates, of the video mode.
|
||||
*/
|
||||
public int width;
|
||||
/*! The height, in screen coordinates, of the video mode.
|
||||
*/
|
||||
public int height;
|
||||
/*! The bit depth of the red channel of the video mode.
|
||||
*/
|
||||
public int redBits;
|
||||
/*! The bit depth of the green channel of the video mode.
|
||||
*/
|
||||
public int greenBits;
|
||||
/*! The bit depth of the blue channel of the video mode.
|
||||
*/
|
||||
public int blueBits;
|
||||
/*! The refresh rate, in Hz, of the video mode.
|
||||
*/
|
||||
int refreshRate;
|
||||
}
|
||||
|
||||
public unsafe struct GLFWgammaramp
|
||||
{
|
||||
|
||||
/*! An array of value describing the response of the red channel.
|
||||
*/
|
||||
ushort* red;
|
||||
/*! An array of value describing the response of the green channel.
|
||||
*/
|
||||
ushort* green;
|
||||
/*! An array of value describing the response of the blue channel.
|
||||
*/
|
||||
ushort* blue;
|
||||
/*! The number of elements in each array.
|
||||
*/
|
||||
uint size;
|
||||
}
|
||||
|
||||
public unsafe struct GLFWimage
|
||||
{
|
||||
|
||||
/*! The width, in pixels, of this image.
|
||||
*/
|
||||
int width;
|
||||
/*! The height, in pixels, of this image.
|
||||
*/
|
||||
int height;
|
||||
/*! The pixel data of this image, arranged left-to-right, top-to-bottom.
|
||||
*/
|
||||
byte* pixels;
|
||||
}
|
||||
|
||||
public struct GLFWgamepadstate
|
||||
{
|
||||
|
||||
/*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
|
||||
* or `GLFW_RELEASE`.
|
||||
*/
|
||||
byte[] buttons = new byte[15];
|
||||
/*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0
|
||||
* to 1.0 inclusive.
|
||||
*/
|
||||
float[] axes = new float[6];
|
||||
|
||||
public GLFWgamepadstate()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct GLFWallocator
|
||||
{
|
||||
//GLFWallocatefun allocate;
|
||||
IntPtr allocate;
|
||||
//GLFWreallocatefun reallocate;
|
||||
IntPtr reallocate;
|
||||
//GLFWdeallocatefun deallocate;
|
||||
IntPtr deallocate;
|
||||
void* user;
|
||||
}
|
||||
|
||||
public unsafe struct GLFWmonitor
|
||||
{
|
||||
|
||||
char[] name = new char[128];
|
||||
void* userPointer;
|
||||
|
||||
// Physical dimensions in millimeters.
|
||||
int widthMM, heightMM;
|
||||
|
||||
// The window whose video mode is current on this monitor
|
||||
//_GLFWwindow* window;
|
||||
IntPtr window;
|
||||
|
||||
//GLFWvidmode* modes;
|
||||
IntPtr modes;
|
||||
int modeCount;
|
||||
GLFWvidmode currentMode;
|
||||
|
||||
GLFWgammaramp originalRamp;
|
||||
GLFWgammaramp currentRamp;
|
||||
|
||||
// not transformed
|
||||
//GLFW_PLATFORM_MONITOR_STATE;
|
||||
|
||||
public GLFWmonitor() { }
|
||||
}
|
||||
|
||||
public unsafe struct _GLFWwindow
|
||||
{
|
||||
//struct _GLFWwindow* next in GLFW
|
||||
public IntPtr next;
|
||||
|
||||
public bool resizable;
|
||||
public bool decorated;
|
||||
public bool autoIconify;
|
||||
public bool floating;
|
||||
public bool focusOnShow;
|
||||
public bool mousePassthrough;
|
||||
public bool shouldClose;
|
||||
public void* userPointer;
|
||||
public bool doublebuffer;
|
||||
public GLFWvidmode videoMode;
|
||||
//public GLFWmonitor* monitor;
|
||||
public IntPtr monitor;
|
||||
public GLFWcursor* cursor;
|
||||
|
||||
public int minwidth, minheight;
|
||||
public int maxwidth, maxheight;
|
||||
public int numer, denom;
|
||||
|
||||
public bool stickyKeys;
|
||||
public bool stickyMouseButtons;
|
||||
public bool lockKeyMods;
|
||||
public int cursorMode;
|
||||
public char[] mouseButtons = new char[8];
|
||||
public char[] keys = new char[349];
|
||||
// Virtual cursor position when cursor is disabled
|
||||
public double virtualCursorPosX, virtualCursorPosY;
|
||||
public bool rawMouseMotion;
|
||||
|
||||
public GLFWcontext context;
|
||||
|
||||
public _GLFWwindow()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public struct GLFWcursor
|
||||
{
|
||||
//_GLFWcursor* next;
|
||||
IntPtr next;
|
||||
|
||||
// This is defined in platform.h
|
||||
// not completed in tranformation
|
||||
// GLFW_PLATFORM_CURSOR_STATE;
|
||||
}
|
||||
|
||||
public unsafe struct GLFWerror
|
||||
{
|
||||
|
||||
//_GLFWerror* next;
|
||||
IntPtr next;
|
||||
int code;
|
||||
char[] description = new char[GLFW._GLFW_MESSAGE_SIZE];
|
||||
|
||||
public GLFWerror()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct GLFWinitconfig
|
||||
{
|
||||
|
||||
GLFWbool hatButtons;
|
||||
int angleType;
|
||||
int platformID;
|
||||
//PFN_vkGetInstanceProcAddr vulkanLoader;
|
||||
IntPtr vulkanLoader;
|
||||
struct ns
|
||||
{
|
||||
GLFWbool menubar;
|
||||
GLFWbool chdir;
|
||||
}
|
||||
struct x11
|
||||
{
|
||||
GLFWbool xcbVulkanSurface;
|
||||
}
|
||||
struct wl
|
||||
{
|
||||
int libdecorMode;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct GLFWwndconfig
|
||||
{
|
||||
|
||||
int xpos;
|
||||
int ypos;
|
||||
int width;
|
||||
int height;
|
||||
char* title;
|
||||
GLFWbool resizable;
|
||||
GLFWbool visible;
|
||||
GLFWbool decorated;
|
||||
GLFWbool focused;
|
||||
GLFWbool autoIconify;
|
||||
GLFWbool floating;
|
||||
GLFWbool maximized;
|
||||
GLFWbool centerCursor;
|
||||
GLFWbool focusOnShow;
|
||||
GLFWbool mousePassthrough;
|
||||
GLFWbool scaleToMonitor;
|
||||
internal struct Ns
|
||||
{
|
||||
GLFWbool retina;
|
||||
char[] frameName = new char[256];
|
||||
|
||||
public Ns()
|
||||
{
|
||||
}
|
||||
}
|
||||
internal Ns ns = new Ns();
|
||||
|
||||
internal struct X11
|
||||
{
|
||||
char[] className = new char[256];
|
||||
char[] instanceName = new char[256];
|
||||
|
||||
public X11()
|
||||
{
|
||||
}
|
||||
}
|
||||
internal X11 x11 = new X11();
|
||||
|
||||
internal struct Win32
|
||||
{
|
||||
GLFWbool keymenu;
|
||||
}
|
||||
internal Win32 win32 = new Win32();
|
||||
|
||||
internal struct Wl
|
||||
{
|
||||
char[] appId = new char[256];
|
||||
|
||||
public Wl()
|
||||
{
|
||||
}
|
||||
}
|
||||
internal Wl wl = new Wl();
|
||||
|
||||
public GLFWwndconfig()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct GLFWctxconfig
|
||||
{
|
||||
int client;
|
||||
int source;
|
||||
int major;
|
||||
int minor;
|
||||
GLFWbool forward;
|
||||
GLFWbool debug;
|
||||
GLFWbool noerror;
|
||||
int profile;
|
||||
int robustness;
|
||||
int release;
|
||||
//_GLFWwindow* share;
|
||||
IntPtr share;
|
||||
internal struct Nsgl
|
||||
{
|
||||
GLFWbool offline;
|
||||
}
|
||||
internal Nsgl nsgl = new Nsgl();
|
||||
|
||||
public GLFWctxconfig()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe struct GLFWfbconfig
|
||||
{
|
||||
|
||||
int redBits;
|
||||
int greenBits;
|
||||
int blueBits;
|
||||
int alphaBits;
|
||||
int depthBits;
|
||||
int stencilBits;
|
||||
int accumRedBits;
|
||||
int accumGreenBits;
|
||||
int accumBlueBits;
|
||||
int accumAlphaBits;
|
||||
int auxBuffers;
|
||||
GLFWbool stereo;
|
||||
int samples;
|
||||
GLFWbool sRGB;
|
||||
GLFWbool doublebuffer;
|
||||
GLFWbool transparent;
|
||||
uintptr_t handle;
|
||||
}
|
||||
|
||||
|
||||
internal unsafe struct _GLFWlibrary
|
||||
{
|
||||
GLFWbool initialized;
|
||||
GLFWallocator allocator;
|
||||
|
||||
GLFWplatform platform;
|
||||
|
||||
internal unsafe struct Hints
|
||||
{
|
||||
GLFWinitconfig init;
|
||||
GLFWfbconfig framebuffer;
|
||||
GLFWwndconfig window;
|
||||
GLFWctxconfig context;
|
||||
int refreshRate;
|
||||
}
|
||||
internal Hints hints = new Hints();
|
||||
|
||||
//_GLFWerror* errorListHead;
|
||||
IntPtr errorListHead;
|
||||
//_GLFWcursor* cursorListHead;
|
||||
IntPtr cursorListHead;
|
||||
//_GLFWwindow* windowListHead;
|
||||
IntPtr windowListHead;
|
||||
//_GLFWmonitor** monitors;
|
||||
IntPtr monitors;
|
||||
int monitorCount;
|
||||
|
||||
|
||||
|
||||
GLFWbool joysticksInitialized;
|
||||
_GLFWjoystick[] joysticks = new _GLFWjoystick[GLFW.GLFW_JOYSTICK_LAST + 1];
|
||||
//_GLFWmapping* mappings;
|
||||
IntPtr mappings;
|
||||
int mappingCount;
|
||||
|
||||
_GLFWtls errorSlot;
|
||||
_GLFWtls contextSlot;
|
||||
_GLFWmutex errorLock;
|
||||
|
||||
internal unsafe struct timer
|
||||
{
|
||||
ulong offset;
|
||||
// This is defined in platform.h
|
||||
|
||||
|
||||
//not transformed function defination
|
||||
//GLFW_PLATFORM_LIBRARY_TIMER_STATE
|
||||
}
|
||||
|
||||
|
||||
internal unsafe struct Egl
|
||||
{
|
||||
internal int platform;
|
||||
internal void* display;
|
||||
internal int major, minor;
|
||||
internal bool prefix;
|
||||
|
||||
internal bool KHR_create_context;
|
||||
internal bool KHR_create_context_no_error;
|
||||
internal bool KHR_gl_colorspace;
|
||||
internal bool KHR_get_all_proc_addresses;
|
||||
internal bool KHR_context_flush_control;
|
||||
internal bool EXT_client_extensions;
|
||||
internal bool EXT_platform_base;
|
||||
internal bool EXT_platform_x11;
|
||||
internal bool EXT_platform_wayland;
|
||||
internal bool EXT_present_opaque;
|
||||
internal bool ANGLE_platform_angle;
|
||||
internal bool ANGLE_platform_angle_opengl;
|
||||
internal bool ANGLE_platform_angle_d3d;
|
||||
internal bool ANGLE_platform_angle_vulkan;
|
||||
internal bool ANGLE_platform_angle_metal;
|
||||
|
||||
internal void* handle;
|
||||
|
||||
internal IntPtr GetConfigAttrib;
|
||||
internal IntPtr GetConfigs;
|
||||
internal IntPtr GetDisplay;
|
||||
internal IntPtr GetError;
|
||||
internal IntPtr Initialize;
|
||||
internal IntPtr Terminate;
|
||||
internal IntPtr BindAPI;
|
||||
internal IntPtr CreateContext;
|
||||
internal IntPtr DestroySurface;
|
||||
internal IntPtr DestroyContext;
|
||||
internal IntPtr CreateWindowSurface;
|
||||
internal IntPtr MakeCurrent;
|
||||
internal IntPtr SwapBuffers;
|
||||
internal IntPtr SwapInterval;
|
||||
internal IntPtr QueryString;
|
||||
internal IntPtr GetProcAddress;
|
||||
|
||||
internal IntPtr GetPlatformDisplayEXT;
|
||||
internal IntPtr CreatePlatformWindowSurfaceEXT;
|
||||
}
|
||||
internal Egl egl = new Egl();
|
||||
|
||||
internal unsafe struct Osmesa
|
||||
{
|
||||
void* handle;
|
||||
|
||||
IntPtr CreateContextExt;
|
||||
IntPtr CreateContextAttribs;
|
||||
IntPtr DestroyContext;
|
||||
IntPtr MakeCurrent;
|
||||
IntPtr GetColorBuffer;
|
||||
IntPtr GetDepthBuffer;
|
||||
IntPtr GetProcAddress;
|
||||
}
|
||||
internal Osmesa osmesa = new Osmesa();
|
||||
|
||||
internal unsafe struct vk
|
||||
{
|
||||
GLFWbool available;
|
||||
void* handle;
|
||||
char*[] extensions = new char*[2];
|
||||
IntPtr GetInstanceProcAddr;
|
||||
GLFWbool KHR_surface;
|
||||
GLFWbool KHR_win32_surface;
|
||||
GLFWbool MVK_macos_surface;
|
||||
GLFWbool EXT_metal_surface;
|
||||
GLFWbool KHR_xlib_surface;
|
||||
GLFWbool KHR_xcb_surface;
|
||||
GLFWbool KHR_wayland_surface;
|
||||
|
||||
public vk()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal unsafe struct Callbacks
|
||||
{
|
||||
IntPtr monitor;
|
||||
IntPtr joystick;
|
||||
}
|
||||
internal Callbacks callbacks = new Callbacks();
|
||||
|
||||
public _GLFWlibrary()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public unsafe struct _GLFWmapelement
|
||||
{
|
||||
byte type;
|
||||
byte index;
|
||||
sbyte axisScale;
|
||||
sbyte axisOffset;
|
||||
}
|
||||
|
||||
public unsafe struct _GLFWmapping
|
||||
{
|
||||
|
||||
char[] name = new char[128];
|
||||
char[] guid = new char[33];
|
||||
_GLFWmapelement[] buttons = new _GLFWmapelement[15];
|
||||
_GLFWmapelement[] axes = new _GLFWmapelement[6];
|
||||
|
||||
public _GLFWmapping() { }
|
||||
}
|
||||
|
||||
public unsafe struct _GLFWjoystick
|
||||
{
|
||||
|
||||
GLFWbool allocated;
|
||||
GLFWbool connected;
|
||||
float* axes;
|
||||
int axisCount;
|
||||
byte* buttons;
|
||||
int buttonCount;
|
||||
byte* hats;
|
||||
int hatCount;
|
||||
char[] name = new char[128];
|
||||
void* userPointer;
|
||||
char[] guid = new char[33];
|
||||
//_GLFWmapping* mapping;
|
||||
IntPtr mapping;
|
||||
|
||||
// This is defined in platform.h
|
||||
// not completed in transforming
|
||||
// GLFW_PLATFORM_JOYSTICK_STATE;
|
||||
|
||||
public _GLFWjoystick() { }
|
||||
}
|
||||
|
||||
public unsafe struct _GLFWtls
|
||||
{
|
||||
// This is defined in platform.h
|
||||
|
||||
//GLFW_PLATFORM_TLS_STATE
|
||||
}
|
||||
|
||||
|
||||
public unsafe struct GLFWplatform
|
||||
{
|
||||
|
||||
int platformID;
|
||||
// init
|
||||
//GLFWbool(*init)(void);
|
||||
IntPtr init;
|
||||
//void (* terminate) (void);
|
||||
IntPtr terminate;
|
||||
|
||||
// input
|
||||
/* void (* getCursorPos) (_GLFWwindow*, double*, double*);
|
||||
void (* setCursorPos) (_GLFWwindow*, double, double);
|
||||
void (* setCursorMode) (_GLFWwindow*, int);
|
||||
void (* setRawMouseMotion) (_GLFWwindow*, GLFWbool);
|
||||
GLFWbool(*rawMouseMotionSupported)(void);
|
||||
GLFWbool(*createCursor)(_GLFWcursor*,const GLFWimage*,int,int);
|
||||
GLFWbool(*createStandardCursor)(_GLFWcursor*, int);
|
||||
void (* destroyCursor) (_GLFWcursor*);
|
||||
void (* setCursor) (_GLFWwindow*, _GLFWcursor*);
|
||||
const char* (*getScancodeName)(int);
|
||||
int (* getKeyScancode) (int);
|
||||
void (* setClipboardString) (const char*);
|
||||
const char* (*getClipboardString)(void);
|
||||
GLFWbool(*initJoysticks)(void);
|
||||
void (* terminateJoysticks) (void);
|
||||
GLFWbool(*pollJoystick)(_GLFWjoystick*, int);
|
||||
const char* (*getMappingName)(void);
|
||||
void (* updateGamepadGUID) (char*);
|
||||
// monitor
|
||||
void (* freeMonitor) (_GLFWmonitor*);
|
||||
void (* getMonitorPos) (_GLFWmonitor*, int*, int*);
|
||||
void (* getMonitorContentScale) (_GLFWmonitor*, float*, float*);
|
||||
void (* getMonitorWorkarea) (_GLFWmonitor*, int*, int*, int*, int*);
|
||||
GLFWvidmode* (* getVideoModes) (_GLFWmonitor*, int*);
|
||||
void (* getVideoMode) (_GLFWmonitor*, GLFWvidmode*);
|
||||
GLFWbool(*getGammaRamp)(_GLFWmonitor*, GLFWgammaramp*);
|
||||
void (* setGammaRamp) (_GLFWmonitor*,const GLFWgammaramp*);
|
||||
// window
|
||||
GLFWbool(*createWindow)(_GLFWwindow*,const _GLFWwndconfig*,const _GLFWctxconfig*,const _GLFWfbconfig*);
|
||||
void (* destroyWindow) (_GLFWwindow*);
|
||||
void (* setWindowTitle) (_GLFWwindow*,const char*);
|
||||
void (* setWindowIcon) (_GLFWwindow*, int,const GLFWimage*);
|
||||
void (* getWindowPos) (_GLFWwindow*, int*, int*);
|
||||
void (* setWindowPos) (_GLFWwindow*, int, int);
|
||||
void (* getWindowSize) (_GLFWwindow*, int*, int*);
|
||||
void (* setWindowSize) (_GLFWwindow*, int, int);
|
||||
void (* setWindowSizeLimits) (_GLFWwindow*, int, int, int, int);
|
||||
void (* setWindowAspectRatio) (_GLFWwindow*, int, int);
|
||||
void (* getFramebufferSize) (_GLFWwindow*, int*, int*);
|
||||
void (* getWindowFrameSize) (_GLFWwindow*, int*, int*, int*, int*);
|
||||
void (* getWindowContentScale) (_GLFWwindow*, float*, float*);
|
||||
void (* iconifyWindow) (_GLFWwindow*);
|
||||
void (* restoreWindow) (_GLFWwindow*);
|
||||
void (* maximizeWindow) (_GLFWwindow*);
|
||||
void (* showWindow) (_GLFWwindow*);
|
||||
void (* hideWindow) (_GLFWwindow*);
|
||||
void (* requestWindowAttention) (_GLFWwindow*);
|
||||
void (* focusWindow) (_GLFWwindow*);
|
||||
void (* setWindowMonitor) (_GLFWwindow*, _GLFWmonitor*, int, int, int, int, int);
|
||||
GLFWbool(*windowFocused)(_GLFWwindow*);
|
||||
GLFWbool(*windowIconified)(_GLFWwindow*);
|
||||
GLFWbool(*windowVisible)(_GLFWwindow*);
|
||||
GLFWbool(*windowMaximized)(_GLFWwindow*);
|
||||
GLFWbool(*windowHovered)(_GLFWwindow*);
|
||||
GLFWbool(*framebufferTransparent)(_GLFWwindow*);
|
||||
float (* getWindowOpacity) (_GLFWwindow*);
|
||||
void (* setWindowResizable) (_GLFWwindow*, GLFWbool);
|
||||
void (* setWindowDecorated) (_GLFWwindow*, GLFWbool);
|
||||
void (* setWindowFloating) (_GLFWwindow*, GLFWbool);
|
||||
void (* setWindowOpacity) (_GLFWwindow*, float);
|
||||
void (* setWindowMousePassthrough) (_GLFWwindow*, GLFWbool);
|
||||
void (* pollEvents) (void);
|
||||
void (* waitEvents) (void);
|
||||
void (* waitEventsTimeout) (double);
|
||||
void (* postEmptyEvent) (void);
|
||||
*/
|
||||
internal IntPtr setCursorPos;
|
||||
internal IntPtr setCursorMode;
|
||||
internal IntPtr setRawMouseMotion;
|
||||
internal IntPtr rawMouseMotionSupported;
|
||||
internal IntPtr createCursor;
|
||||
internal IntPtr createStandardCursor;
|
||||
internal IntPtr destroyCursor;
|
||||
internal IntPtr setCursor;
|
||||
internal IntPtr getScancodeName;
|
||||
internal IntPtr getKeyScancode;
|
||||
internal IntPtr setClipboardString;
|
||||
internal IntPtr getClipboardString;
|
||||
internal IntPtr initJoysticks;
|
||||
internal IntPtr terminateJoysticks;
|
||||
internal IntPtr pollJoystick;
|
||||
internal IntPtr getMappingName;
|
||||
internal IntPtr updateGamepadGUID;
|
||||
// monitor
|
||||
internal IntPtr freeMonitor;
|
||||
internal IntPtr getMonitorPos;
|
||||
internal IntPtr getMonitorContentScale;
|
||||
internal IntPtr getMonitorWorkarea;
|
||||
internal IntPtr getVideoModes;
|
||||
internal IntPtr getVideoMode;
|
||||
internal IntPtr getGammaRamp;
|
||||
internal IntPtr setGammaRamp;
|
||||
// window
|
||||
internal IntPtr createWindow;
|
||||
internal IntPtr destroyWindow;
|
||||
internal IntPtr setWindowTitle;
|
||||
internal IntPtr setWindowIcon;
|
||||
internal IntPtr getWindowPos;
|
||||
internal IntPtr setWindowPos;
|
||||
internal IntPtr getWindowSize;
|
||||
internal IntPtr setWindowSize;
|
||||
internal IntPtr setWindowSizeLimits;
|
||||
internal IntPtr setWindowAspectRatio;
|
||||
internal IntPtr getFramebufferSize;
|
||||
internal IntPtr getWindowFrameSize;
|
||||
internal IntPtr getWindowContentScale;
|
||||
internal IntPtr iconifyWindow;
|
||||
internal IntPtr restoreWindow;
|
||||
internal IntPtr maximizeWindow;
|
||||
internal IntPtr showWindow;
|
||||
internal IntPtr hideWindow;
|
||||
internal IntPtr requestWindowAttention;
|
||||
internal IntPtr focusWindow;
|
||||
internal IntPtr setWindowMonitor;
|
||||
internal IntPtr windowFocused;
|
||||
internal IntPtr windowIconified;
|
||||
internal IntPtr windowVisible;
|
||||
internal IntPtr windowMaximized;
|
||||
internal IntPtr windowHovered;
|
||||
internal IntPtr framebufferTransparent;
|
||||
internal IntPtr getWindowOpacity;
|
||||
internal IntPtr setWindowResizable;
|
||||
internal IntPtr setWindowDecorated;
|
||||
internal IntPtr setWindowFloating;
|
||||
internal IntPtr setWindowOpacity;
|
||||
internal IntPtr setWindowMousePassthrough;
|
||||
internal IntPtr pollEvents;
|
||||
internal IntPtr waitEvents;
|
||||
internal IntPtr waitEventsTimeout;
|
||||
internal IntPtr postEmptyEvent;
|
||||
|
||||
|
||||
// EGL
|
||||
//EGLenum(*getEGLPlatform)(EGLint**);
|
||||
//EGLNativeDisplayType(*getEGLNativeDisplay)(void);
|
||||
//EGLNativeWindowType(*getEGLNativeWindow)(_GLFWwindow*);
|
||||
internal IntPtr getEGLPlatform;
|
||||
internal IntPtr getEGLNativeDisplay;
|
||||
internal IntPtr getEGLNativeWindow;
|
||||
|
||||
|
||||
|
||||
// vulkan
|
||||
//void (* getRequiredInstanceExtensions) (char**);
|
||||
//GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t);
|
||||
//VkResult(*createWindowSurface)(VkInstance, _GLFWwindow*,const VkAllocationCallbacks*, VkSurfaceKHR*);
|
||||
internal IntPtr getRequiredInstanceExtensions;
|
||||
internal IntPtr VkPhysicalDevice;
|
||||
internal IntPtr _GLFWwindow;
|
||||
|
||||
}
|
||||
|
||||
public unsafe struct _GLFWmutex
|
||||
{
|
||||
// This is defined in platform.h
|
||||
//GLFW_PLATFORM_MUTEX_STATE
|
||||
}
|
||||
|
||||
//public unsafe struct VkAllocationCallbacks { }
|
||||
|
||||
internal unsafe struct VkExtensionProperties
|
||||
{
|
||||
char[] extensionName = new char[256];
|
||||
uint specVersion;
|
||||
|
||||
public VkExtensionProperties()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
internal unsafe struct _GLFWerror
|
||||
{
|
||||
IntPtr next;
|
||||
int code;
|
||||
char[] description = new char[1024];
|
||||
|
||||
public _GLFWerror()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Explicit,Size = 16)]
|
||||
public struct uintptr_t
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
long part1;
|
||||
[FieldOffset(8)]
|
||||
long part2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user