Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*************************************************************************
- * GLFW - An OpenGL library
- * API version: 3.0
- * WWW: http://www.glfw.org/
- *------------------------------------------------------------------------
- * Copyright (c) 2002-2006 Marcus Geelnard
- * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.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.
- *
- *************************************************************************/
- const GLFW_VERSION_MAJOR = 3;
- const GLFW_VERSION_MINOR = 0;
- const GLFW_VERSION_REVISION = 0;
- const GLFW_KEY_SPACE = 32;
- const GLFW_KEY_APOSTROPHE = 39; /* */
- const GLFW_KEY_COMMA = 44; /* , */
- const GLFW_KEY_MINUS = 45; /* - */
- const GLFW_KEY_PERIOD = 46; /* . */
- const GLFW_KEY_SLASH = 47; /* / */
- const GLFW_KEY_0 = 48;
- const GLFW_KEY_1 = 49;
- const GLFW_KEY_2 = 50;
- const GLFW_KEY_3 = 51;
- const GLFW_KEY_4 = 52;
- const GLFW_KEY_5 = 53;
- const GLFW_KEY_6 = 54;
- const GLFW_KEY_7 = 55;
- const GLFW_KEY_8 = 56;
- const GLFW_KEY_9 = 57;
- const GLFW_KEY_SEMICOLON = 59; /* ; */
- const GLFW_KEY_EQUAL = 61; /* = */
- const GLFW_KEY_A = 65;
- const GLFW_KEY_B = 66;
- const GLFW_KEY_C = 67;
- const GLFW_KEY_D = 68;
- const GLFW_KEY_E = 69;
- const GLFW_KEY_F = 70;
- const GLFW_KEY_G = 71;
- const GLFW_KEY_H = 72;
- const GLFW_KEY_I = 73;
- const GLFW_KEY_J = 74;
- const GLFW_KEY_K = 75;
- const GLFW_KEY_L = 76;
- const GLFW_KEY_M = 77;
- const GLFW_KEY_N = 78;
- const GLFW_KEY_O = 79;
- const GLFW_KEY_P = 80;
- const GLFW_KEY_Q = 81;
- const GLFW_KEY_R = 82;
- const GLFW_KEY_S = 83;
- const GLFW_KEY_T = 84;
- const GLFW_KEY_U = 85;
- const GLFW_KEY_V = 86;
- const GLFW_KEY_W = 87;
- const GLFW_KEY_X = 88;
- const GLFW_KEY_Y = 89;
- const GLFW_KEY_Z = 90;
- const GLFW_KEY_LEFT_BRACKET = 91; /* [ */
- const GLFW_KEY_BACKSLASH = 92; /* \ */
- const GLFW_KEY_RIGHT_BRACKET = 93; /* ] */
- const GLFW_KEY_GRAVE_ACCENT = 96; /* */
- const GLFW_KEY_WORLD_1 = 161; /* non-US #1 */
- const GLFW_KEY_WORLD_2 = 162; /* non-US #2 */
- const GLFW_KEY_ESCAPE = 256;
- const GLFW_KEY_ENTER = 257;
- const GLFW_KEY_TAB = 258;
- const GLFW_KEY_BACKSPACE = 259;
- const GLFW_KEY_INSERT = 260;
- const GLFW_KEY_DELETE = 261;
- const GLFW_KEY_RIGHT = 262;
- const GLFW_KEY_LEFT = 263;
- const GLFW_KEY_DOWN = 264;
- const GLFW_KEY_UP = 265;
- const GLFW_KEY_PAGE_UP = 266;
- const GLFW_KEY_PAGE_DOWN = 267;
- const GLFW_KEY_HOME = 268;
- const GLFW_KEY_END = 269;
- const GLFW_KEY_CAPS_LOCK = 280;
- const GLFW_KEY_SCROLL_LOCK = 281;
- const GLFW_KEY_NUM_LOCK = 282;
- const GLFW_KEY_PRINT_SCREEN = 283;
- const GLFW_KEY_PAUSE = 284;
- const GLFW_KEY_F1 = 290;
- const GLFW_KEY_F2 = 291;
- const GLFW_KEY_F3 = 292;
- const GLFW_KEY_F4 = 293;
- const GLFW_KEY_F5 = 294;
- const GLFW_KEY_F6 = 295;
- const GLFW_KEY_F7 = 296;
- const GLFW_KEY_F8 = 297;
- const GLFW_KEY_F9 = 298;
- const GLFW_KEY_F10 = 299;
- const GLFW_KEY_F11 = 300;
- const GLFW_KEY_F12 = 301;
- const GLFW_KEY_F13 = 302;
- const GLFW_KEY_F14 = 303;
- const GLFW_KEY_F15 = 304;
- const GLFW_KEY_F16 = 305;
- const GLFW_KEY_F17 = 306;
- const GLFW_KEY_F18 = 307;
- const GLFW_KEY_F19 = 308;
- const GLFW_KEY_F20 = 309;
- const GLFW_KEY_F21 = 310;
- const GLFW_KEY_F22 = 311;
- const GLFW_KEY_F23 = 312;
- const GLFW_KEY_F24 = 313;
- const GLFW_KEY_F25 = 314;
- const GLFW_KEY_KP_0 = 320;
- const GLFW_KEY_KP_1 = 321;
- const GLFW_KEY_KP_2 = 322;
- const GLFW_KEY_KP_3 = 323;
- const GLFW_KEY_KP_4 = 324;
- const GLFW_KEY_KP_5 = 325;
- const GLFW_KEY_KP_6 = 326;
- const GLFW_KEY_KP_7 = 327;
- const GLFW_KEY_KP_8 = 328;
- const GLFW_KEY_KP_9 = 329;
- const GLFW_KEY_KP_DECIMAL = 330;
- const GLFW_KEY_KP_DIVIDE = 331;
- const GLFW_KEY_KP_MULTIPLY = 332;
- const GLFW_KEY_KP_SUBTRACT = 333;
- const GLFW_KEY_KP_ADD = 334;
- const GLFW_KEY_KP_ENTER = 335;
- const GLFW_KEY_KP_EQUAL = 336;
- const GLFW_KEY_LEFT_SHIFT = 340;
- const GLFW_KEY_LEFT_CONTROL = 341;
- const GLFW_KEY_LEFT_ALT = 342;
- const GLFW_KEY_LEFT_SUPER = 343;
- const GLFW_KEY_RIGHT_SHIFT = 344;
- const GLFW_KEY_RIGHT_CONTROL = 345;
- const GLFW_KEY_RIGHT_ALT = 346;
- const GLFW_KEY_RIGHT_SUPER = 347;
- const GLFW_KEY_MENU = 348;
- const GLFW_KEY_LAST = 348;
- const GLFW_KEY_ESC = 256;
- const GLFW_KEY_DEL = 261;
- const GLFW_KEY_PAGEUP = 266;
- const GLFW_KEY_PAGEDOWN = 267;
- const GLFW_KEY_KP_NUM_LOCK = 282;
- const GLFW_KEY_LCTRL = 341;
- const GLFW_KEY_LSHIFT = 340;
- const GLFW_KEY_LALT = 342;
- const GLFW_KEY_LSUPER = 343;
- const GLFW_KEY_RCTRL = 345;
- const GLFW_KEY_RSHIFT = 344;
- const GLFW_KEY_RALT = 346;
- const GLFW_KEY_RSUPER = 347;
- const GLFW_MOUSE_BUTTON_1 = 0;
- const GLFW_MOUSE_BUTTON_2 = 1;
- const GLFW_MOUSE_BUTTON_3 = 2;
- const GLFW_MOUSE_BUTTON_4 = 3;
- const GLFW_MOUSE_BUTTON_5 = 4;
- const GLFW_MOUSE_BUTTON_6 = 5;
- const GLFW_MOUSE_BUTTON_7 = 6;
- const GLFW_MOUSE_BUTTON_8 = 7;
- const GLFW_MOUSE_BUTTON_LAST = 7;
- const GLFW_MOUSE_BUTTON_LEFT = 0;
- const GLFW_MOUSE_BUTTON_RIGHT = 1;
- const GLFW_MOUSE_BUTTON_MIDDLE = 3;
- const GLFW_JOYSTICK_1 = 0;
- const GLFW_JOYSTICK_2 = 1;
- const GLFW_JOYSTICK_3 = 2;
- const GLFW_JOYSTICK_4 = 3;
- const GLFW_JOYSTICK_5 = 4;
- const GLFW_JOYSTICK_6 = 5;
- const GLFW_JOYSTICK_7 = 6;
- const GLFW_JOYSTICK_8 = 7;
- const GLFW_JOYSTICK_9 = 8;
- const GLFW_JOYSTICK_10 = 9;
- const GLFW_JOYSTICK_11 = 10;
- const GLFW_JOYSTICK_12 = 11;
- const GLFW_JOYSTICK_13 = 12;
- const GLFW_JOYSTICK_14 = 13;
- const GLFW_JOYSTICK_15 = 14;
- const GLFW_JOYSTICK_16 = 15;
- const GLFW_JOYSTICK_LAST = 15;
- const GLFW_NOT_INITIALIZED = 0x00070001;
- const GLFW_NO_CURRENT_CONTEXT = 0x00070002;
- const GLFW_INVALID_ENUM = 0x00070003;
- const GLFW_INVALID_VALUE = 0x00070004;
- const GLFW_OUT_OF_MEMORY = 0x00070005;
- const GLFW_API_UNAVAILABLE = 0x00070006;
- const GLFW_VERSION_UNAVAILABLE = 0x00070007;
- const GLFW_PLATFORM_ERROR = 0x00070008;
- const GLFW_FORMAT_UNAVAILABLE = 0x00070009;
- const GLFW_FOCUSED = 0x00020001;
- const GLFW_ICONIFIED = 0x00020002;
- const GLFW_RESIZABLE = 0x00022007;
- const GLFW_VISIBLE = 0x00022008;
- const GLFW_DECORATED = 0x00022009;
- const GLFW_CONTEXT_REVISION = 0x00020004;
- const GLFW_RED_BITS = 0x00021000;
- const GLFW_GREEN_BITS = 0x00021001;
- const GLFW_BLUE_BITS = 0x00021002;
- const GLFW_ALPHA_BITS = 0x00021003;
- const GLFW_DEPTH_BITS = 0x00021004;
- const GLFW_STENCIL_BITS = 0x00021005;
- const GLFW_ACCUM_RED_BITS = 0x00021006;
- const GLFW_ACCUM_GREEN_BITS = 0x00021007;
- const GLFW_ACCUM_BLUE_BITS = 0x00021008;
- const GLFW_ACCUM_ALPHA_BITS = 0x00021009;
- const GLFW_AUX_BUFFERS = 0x0002100A;
- const GLFW_STEREO = 0x0002100B;
- const GLFW_SAMPLES = 0x0002100C;
- const GLFW_SRGB_CAPABLE = 0x0002100D;
- const GLFW_CLIENT_API = 0x00022000;
- const GLFW_CONTEXT_VERSION_MAJOR = 0x00022001;
- const GLFW_CONTEXT_VERSION_MINOR = 0x00022002;
- const GLFW_CONTEXT_ROBUSTNESS = 0x00022003;
- const GLFW_OPENGL_FORWARD_COMPAT = 0x00022004;
- const GLFW_OPENGL_DEBUG_CONTEXT = 0x00022005;
- const GLFW_OPENGL_PROFILE = 0x00022006;
- const GLFW_OPENGL_API = 0x00000001;
- const GLFW_OPENGL_ES_API = 0x00000002;
- const GLFW_NO_ROBUSTNESS = 0x00000000;
- const GLFW_NO_RESET_NOTIFICATION = 0x00000001;
- const GLFW_LOSE_CONTEXT_ON_RESET = 0x00000002;
- const GLFW_OPENGL_NO_PROFILE = 0x00000000;
- const GLFW_OPENGL_CORE_PROFILE = 0x00000001;
- const GLFW_OPENGL_COMPAT_PROFILE = 0x00000002;
- const GLFW_CURSOR_MODE = 0x00030001;
- const GLFW_STICKY_KEYS = 0x00030002;
- const GLFW_STICKY_MOUSE_BUTTONS = 0x00030003;
- const GLFW_CURSOR_NORMAL = 0x00040001;
- const GLFW_CURSOR_HIDDEN = 0x00040002;
- const GLFW_CURSOR_CAPTURED = 0x00040003;
- const GLFW_PRESENT = 0x00050001;
- const GLFW_AXES = 0x00050002;
- const GLFW_BUTTONS = 0x00050003;
- const GLFW_GAMMA_RAMP_SIZE = 256;
- const GLFW_CONNECTED = 0x00061000;
- const GLFW_DISCONNECTED = 0x00061001;
- struct GLFWmonitor tmp : char; end; // FIXME
- struct GLFWwindow tmp : char; end; // FIXME
- alias GLFWglproc = def ();
- alias GLFWerrorfun = def (a : int; const msg : ^char);
- alias GLFWwindowposfun = def (wnd : ^GLFWwindow; xpos, ypos : int);
- alias GLFWwindowsizefun = def (wnd : ^GLFWwindow; width, height : int);
- alias GLFWwindowfocusfun = def (wnd : ^GLFWwindow; focused : int);
- alias GLFWwindowiconifyfun = def (wnd : ^GLFWwindow; iconified : int);
- alias GLFWwindowclosefun = def (wnd : ^GLFWwindow);
- alias GLFWwindowrefreshfun = def (wnd : ^GLFWwindow);
- alias GLFWmousebuttonfun = def (wnd : ^GLFWwindow; button, action : int);
- alias GLFWmousebuttonfun = def (wnd : ^GLFWwindow; xpos, ypos : double);
- alias GLFWcursorenterfun = def (wnd : ^GLFWwindow; entered : int);
- alias GLFWscrollfun = def (wnd : ^GLFWwindow; xpos, ypos : double);
- alias GLFWkeyfun = def (wnd : ^GLFWwindow; key, action : int);
- alias GLFWcharfun = def (wnd : ^GLFWwindow; character : cardinal);
- alias GLFWmonitorfun = def (wnd : ^GLFWmonitor; event : int);
- alias GLFWcursorposfun = def (wnd : ^GLFWwindow; xpos, ypos : double);
- struct GLFWvidmode
- width : int;
- height : int;
- redBits : int;
- greenBits : int;
- blueBits : int;
- end;
- struct GLFWgammaramp
- Red : [256 x word];
- Green : [256 x word];
- Blue : [256 x word];
- end;
- def glfwInit () : int external;
- def glfwTerminate () external;
- def glfwGetVersion (major, minor, rev : ^int) external;
- def glfwGetVersionString : ^char external;
- def glfwSetErrorCallback (cbfun : GLFWerrorfun) : GLFWerrorfun external;
- def glfwGetMonitors (count : ^int) : ^^GLFWmonitor external;
- def glfwGetPrimaryMonitor() : ^GLFWmonitor external;
- def glfwGetMonitorPos (monitor : ^GLFWmonitor; xpos, ypos : ^int) external;
- def glfwGetMonitorPhysicalSize (monitor : ^GLFWmonitor; width, height : ^int) external;
- def glfwGetMonitorName (monitor : ^GLFWmonitor) : ^char external;
- def glfwSetMonitorCallback (cbfun : GLFWmonitorfun) : GLFWmonitorfun external;
- def glfwGetVideoModes (monitor : ^GLFWmonitor; count : ^int) : ^GLFWvidmode external;
- def glfwGetVideoMode (monitor : ^GLFWmonitor) : GLFWvidmode external;
- def glfwSetGamma (monitor : ^GLFWmonitor; gamma : float) external;
- def glfwGetGammaRamp (monitor : ^GLFWmonitor; ramp : ^GLFWgammaramp) external;
- def glfwSetGammaRamp (monitor : ^GLFWmonitor; const ramp : ^GLFWgammaramp) external;
- def glfwDefaultWindowHints () external;
- def glfwWindowHint (target, hint : int) external;
- def glfwCreateWindow (width, height : int; const title : ^char; monitor : ^GLFWmonitor; share : ^GLFWwindow) : ^GLFWwindow external;
- def glfwDestroyWindow (window : ^GLFWwindow) external;
- def glfwWindowShouldClose (window : ^GLFWwindow) : int external;
- def glfwSetWindowShouldClose (window : ^GLFWwindow; value : int) external;
- def glfwSetWindowTitle (window : ^GLFWwindow; const title : ^char) external;
- def glfwGetWindowPos (window : ^GLFWwindow; xpos, ypos : ^int) external;
- def glfwSetWindowPos (window : ^GLFWwindow; xpos, ypos : int) external;
- def glfwGetWindowSize (window : ^GLFWwindow; width, height : ^int) external;
- def glfwSetWindowSize (window : ^GLFWwindow; width, height : int) external;
- def glfwIconifyWindow (window : ^GLFWwindow) external;
- def glfwRestoreWindow (window : ^GLFWwindow) external;
- def glfwShowWindow (window : ^GLFWwindow) external;
- def glfwHideWindow (window : ^GLFWwindow) external;
- def glfwGetWindowMonitor (window : ^GLFWwindow) : ^GLFWmonitor external;
- def glfwGetWindowParam (window : ^GLFWwindow; param : int) : int external;
- def glfwSetWindowUserPointer (window : ^GLFWwindow; ptr : pointer) external;
- def glfwGetWindowUserPointer (window : ^GLFWwindow) : pointer external;
- def glfwSetWindowPosCallback (window : ^GLFWwindow; cbfun : GLFWwindowposfun) : GLFWwindowposfun external;
- def glfwSetWindowSizeCallback (window : ^GLFWwindow; cbfun : GLFWwindowsizefun) : GLFWwindowsizefun external;
- def glfwSetWindowCloseCallback (window : ^GLFWwindow; cbfun : GLFWwindowclosefun) : GLFWwindowclosefun external;
- def glfwSetWindowRefreshCallback (window : ^GLFWwindow; cbfun : GLFWwindowrefreshfun) : GLFWwindowrefreshfun external;
- def glfwSetWindowFocusCallback (window : ^GLFWwindow; cbfun : GLFWwindowfocusfun) : GLFWwindowfocusfun external;
- def glfwSetWindowIconifyCallback (window : ^GLFWwindow; cbfun : GLFWwindowiconifyfun) : GLFWwindowiconifyfun external;
- def glfwPollEvents () external;
- def glfwWaitEvents () external;
- def glfwGetInputMode (window : ^GLFWwindow; mode : int) : int external;
- def glfwSetInputMode (window : ^GLFWwindow; mode, value : int) external;
- def glfwGetKey (window : ^GLFWwindow; key : int) : int external;
- def glfwGetMouseButton (window : ^GLFWwindow; button : int) : int external;
- def glfwGetCursorPos (window : ^GLFWwindow; xpos, ypos : ^double) external;
- def glfwSetCursorPos (window : ^GLFWwindow; xpos, ypos : double) external;
- def glfwSetKeyCallback (window : ^GLFWwindow; cbfun : GLFWkeyfun) : GLFWkeyfun external;
- def glfwSetCharCallback (window : ^GLFWwindow; cbfun : GLFWcharfun) : GLFWcharfun external;
- def glfwSetMouseButtonCallback (window : ^GLFWwindow; cbfun : GLFWmousebuttonfun) : GLFWmousebuttonfun external;
- def glfwSetCursorPosCallback (window : ^GLFWwindow; cbfun : GLFWcursorposfun) : GLFWcursorposfun external;
- def glfwSetCursorEnterCallback (window : ^GLFWwindow; cbfun : GLFWcursorenterfun) : GLFWcursorenterfun external;
- def glfwSetScrollCallback (window : ^GLFWwindow; cbfun : GLFWscrollfun) : GLFWscrollfun external;
- def glfwGetJoystickParam (joy, param : int) : int external;
- def glfwGetJoystickAxes (joy : int; axes : ^float; numaxes : int) : int external;
- def glfwGetJoystickButtons (joy : int; buttons : ^char; numbuttons : int) : int external;
- def glfwGetJoystickName (joy : int) : ^char external;
- def glfwSetClipboardString (window : ^GLFWwindow; const str : ^char) external;
- def glfwGetClipboardString (window : ^GLFWwindow) : ^char external;
- def glfwGetTime : double external;
- def glfwSetTime (time : double) external;
- def glfwMakeContextCurrent (window : ^GLFWwindow) external;
- def glfwGetCurrentContext() : ^GLFWwindow external;
- def glfwSwapBuffers (window : ^GLFWwindow) external;
- def glfwSwapInterval (interval : int) external;
- def glfwExtensionSupported (const extension : ^char) : int external;
- def glfwGetProcAddress (const procname : ^char) : GLFWglproc external;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement