Skip to content

Instantly share code, notes, and snippets.

@raizam
Created February 18, 2019 15:35
Show Gist options
  • Save raizam/7b1a3ff07c52f01338c7c8c87123e9b6 to your computer and use it in GitHub Desktop.
Save raizam/7b1a3ff07c52f01338c7c8c87123e9b6 to your computer and use it in GitHub Desktop.
using System;
using System.Runtime.InteropServices;
namespace LibGlfw
{
public enum Keys
{
KeyUnknown = -1,
KeySpace = 32,
KeyApostrophe = 39,
KeyComma = 44,
KeyMinus = 45,
KeyPeriod = 46,
KeySlash = 47,
Key0 = 48,
Key1 = 49,
Key2 = 50,
Key3 = 51,
Key4 = 52,
Key5 = 53,
Key6 = 54,
Key7 = 55,
Key8 = 56,
Key9 = 57,
KeySemicolon = 59,
KeyEqual = 61,
KeyA = 65,
KeyB = 66,
KeyC = 67,
KeyD = 68,
KeyE = 69,
KeyF = 70,
KeyG = 71,
KeyH = 72,
KeyI = 73,
KeyJ = 74,
KeyK = 75,
KeyL = 76,
KeyM = 77,
KeyN = 78,
KeyO = 79,
KeyP = 80,
KeyQ = 81,
KeyR = 82,
KeyS = 83,
KeyT = 84,
KeyU = 85,
KeyV = 86,
KeyW = 87,
KeyX = 88,
KeyY = 89,
KeyZ = 90,
KeyLeftBracket = 91,
KeyBackslash = 92,
KeyRightBracket = 93,
KeyGraveAccent = 96,
KeyWorld1 = 161,
KeyWorld2 = 162,
KeyEscape = 256,
KeyEnter = 257,
KeyTab = 258,
KeyBackspace = 259,
KeyInsert = 260,
KeyDelete = 261,
KeyRight = 262,
KeyLeft = 263,
KeyDown = 264,
KeyUp = 265,
KeyPageUp = 266,
KeyPageDown = 267,
KeyHome = 268,
KeyEnd = 269,
KeyCapsLock = 280,
KeyScrollLock = 281,
KeyNumLock = 282,
KeyPrintScreen = 283,
KeyPause = 284,
KeyF1 = 290,
KeyF2 = 291,
KeyF3 = 292,
KeyF4 = 293,
KeyF5 = 294,
KeyF6 = 295,
KeyF7 = 296,
KeyF8 = 297,
KeyF9 = 298,
KeyF10 = 299,
KeyF11 = 300,
KeyF12 = 301,
KeyF13 = 302,
KeyF14 = 303,
KeyF15 = 304,
KeyF16 = 305,
KeyF17 = 306,
KeyF18 = 307,
KeyF19 = 308,
KeyF20 = 309,
KeyF21 = 310,
KeyF22 = 311,
KeyF23 = 312,
KeyF24 = 313,
KeyF25 = 314,
KeyKp0 = 320,
KeyKp1 = 321,
KeyKp2 = 322,
KeyKp3 = 323,
KeyKp4 = 324,
KeyKp5 = 325,
KeyKp6 = 326,
KeyKp7 = 327,
KeyKp8 = 328,
KeyKp9 = 329,
KeyKpDecimal = 330,
KeyKpDivide = 331,
KeyKpMultiply = 332,
KeyKpSubtract = 333,
KeyKpAdd = 334,
KeyKpEnter = 335,
KeyKpEqual = 336,
KeyLeftShift = 340,
KeyLeftControl = 341,
KeyLeftAlt = 342,
KeyLeftSuper = 343,
KeyRightShift = 344,
KeyRightControl = 345,
KeyRightAlt = 346,
KeyRightSuper = 347,
KeyMenu = 348,
}
[Flags]
public enum KeyModifiers
{
Shift = 0x1,
Control = 0x2,
Alt = 0x4,
Super = 0x8,
}
public enum KeyState
{
Release = 0,
Press = 1,
Repeat = 2,
}
public enum StandardCursor
{
ArrowCursor = 221185,
IbeamCursor = 221186,
CrosshairCursor = 221187,
HandCursor = 221188,
HresizeCursor = 221189,
VresizeCursor = 221190,
}
//GLFWcursor
public unsafe partial struct Cursor
{
IntPtr ptr;
public Cursor(IntPtr ptr) => this.ptr = ptr;
}
//GLFWmonitor
public unsafe partial struct Monitor
{
IntPtr ptr;
public Monitor(IntPtr ptr) => this.ptr = ptr;
}
//GLFWwindow
public unsafe partial struct Window
{
IntPtr ptr;
public Window(IntPtr ptr) => this.ptr = ptr;
}
public unsafe partial struct Gammaramp
{
//GLFWgammaramp
GammarampData* ptr;
public unsafe partial struct GammarampData
{
public ushort* red;
public ushort* green;
public ushort* blue;
public uint size;
}
public ushort* Red
{
get => ptr->red;
set => ptr->red = value;
}
public ushort* Green
{
get => ptr->green;
set => ptr->green = value;
}
public ushort* Blue
{
get => ptr->blue;
set => ptr->blue = value;
}
public uint Size
{
get => ptr->size;
set => ptr->size = value;
}
}
public unsafe partial struct Image
{
//GLFWimage
ImageData* ptr;
public unsafe partial struct ImageData
{
public int width;
public int height;
public ushort* pixels;
}
public int Width
{
get => ptr->width;
set => ptr->width = value;
}
public int Height
{
get => ptr->height;
set => ptr->height = value;
}
public ushort* Pixels
{
get => ptr->pixels;
set => ptr->pixels = value;
}
}
public unsafe partial struct Vidmode
{
//GLFWvidmode
VidmodeData* ptr;
public unsafe partial struct VidmodeData
{
public int width;
public int height;
public int redBits;
public int greenBits;
public int blueBits;
public int refreshRate;
}
public int Width
{
get => ptr->width;
set => ptr->width = value;
}
public int Height
{
get => ptr->height;
set => ptr->height = value;
}
public int RedBits
{
get => ptr->redBits;
set => ptr->redBits = value;
}
public int GreenBits
{
get => ptr->greenBits;
set => ptr->greenBits = value;
}
public int BlueBits
{
get => ptr->blueBits;
set => ptr->blueBits = value;
}
public int RefreshRate
{
get => ptr->refreshRate;
set => ptr->refreshRate = value;
}
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void CharfunDelegate(Window param0, uint param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void CharmodsfunDelegate(Window param0, uint param1, int param2);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void CursorenterfunDelegate(Window param0, int param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void CursorposfunDelegate(Window param0, double param1, double param2);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void DropfunDelegate(Window param0, int param1, in sbyte* param2);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void ErrorfunDelegate(int param0, in sbyte param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void FramebuffersizefunDelegate(Window param0, int param1, int param2);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void GlprocDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void JoystickfunDelegate(int param0, int param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void KeyfunDelegate(Window param0, int param1, int param2, int param3, int param4);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void MonitorfunDelegate(Monitor param0, int param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void MousebuttonfunDelegate(Window param0, int param1, int param2, int param3);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void ScrollfunDelegate(Window param0, double param1, double param2);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void WindowclosefunDelegate(Window param0);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void WindowfocusfunDelegate(Window param0, int param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void WindowiconifyfunDelegate(Window param0, int param1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void WindowposfunDelegate(Window param0, int param1, int param2);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void WindowrefreshfunDelegate(Window param0);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void WindowsizefunDelegate(Window param0, int param1, int param2);
public unsafe static partial class Glfw
{
/// <summary>
/// GLFWcursor *glfwCreateCursor(const GLFWimage *image, int xhot, int yhot)
/// </summary>
/// <remarks>
/// Creates a custom cursor. The desired cursor image. The desired x-coordinate, in pixels, of the cursor hotspot. The desired y-coordinate, in pixels, of the cursor hotspot. The handle of the created cursor, or `NULL` if an [error]( Creates a new custom cursor image that can be set for a window with glfwSetCursor. The cursor can be destroyed with Any remaining cursors are destroyed by The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel. They are arranged canonically as packed sequential rows, starting from the top-left corner. The cursor hotspot is specified in pixels, relative to the upper-left corner of the cursor image. Like all other coordinate systems in GLFW, the X-axis points to the right and the Y-axis points down. Possible errors include GLFW_PLATFORM_ERROR. _lifetime The specified image data is copied before this function returns. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwDestroyCursor glfwCreateStandardCursor Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwCreateCursor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Cursor CreateCursor(Image image, int xhot, int yhot);
/// <summary>
/// GLFWcursor *glfwCreateStandardCursor(int shape)
/// </summary>
/// <remarks>
/// Creates a cursor with a standard shape. One of the [standard shapes]( A new cursor ready to use or `NULL` if an [error]( Returns a cursor with a [standard shape]( a window with Possible errors include GLFW_INVALID_ENUM and This function must not be called from a callback. _safety This function must only be called from the main thread. glfwCreateCursor Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwCreateStandardCursor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Cursor CreateStandardCursor(int shape);
/// <summary>
/// GLFWwindow *glfwCreateWindow(int width, int height, const char *title,
/// GLFWmonitor *monitor, GLFWwindow *share)
/// </summary>
/// <remarks>
/// Creates a window and its associated context. The desired width, in screen coordinates, of the window. This must be greater than zero. The desired height, in screen coordinates, of the window. This must be greater than zero. The initial, UTF-8 encoded window title. The monitor to use for full screen mode, or `NULL` for windowed mode. The window whose context to share resources with, or `NULL` to not share resources. The handle of the created window, or `NULL` if an [error]( This function creates a window and its associated OpenGL or OpenGL ES context. Most of the options controlling how the window and its context should be created are specified with [window hints]( Successful creation does not change which context is current. Before you can use the newly created context, you need to [make it current]( parameter, see The created window, framebuffer and context may differ from what you requested, as not all parameters and hints are [hard constraints]( window, especially for full screen windows. To query the actual attributes of the created window, framebuffer and context, see glfwGetWindowAttrib, To create a full screen window, you need to specify the monitor the window will cover. If no monitor is specified, the window will be windowed mode. Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor. For more information on how to query connected monitors, see For full screen windows, the specified size becomes the resolution of the window's _desired video mode_. As long as a full screen window is not iconified, the supported video mode most closely matching the desired video mode is set for the specified monitor. For more information about full screen windows, including the creation of so called _windowed full screen_ or _borderless full screen_ windows, see Once you have created the window, you can switch it between windowed and full screen mode with OpenGL or OpenGL ES context, it will be unaffected. By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, make it initially invisible using the [GLFW_VISIBLE]( hint, set its [position]( it. As long as at least one full screen window is not iconified, the screensaver is prohibited from starting. Window systems put limits on window sizes. Very large or very small window dimensions may be overridden by the window system on creation. Check the actual [size]( The [swap interval]( the initial value may vary depending on driver settings and defaults. Possible errors include GLFW_INVALID_ENUM, GLFW_VERSION_UNAVAILABLE, GLFW_PLATFORM_ERROR. Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available. If the executable has an icon resource named `GLFW_ICON,` it will be set as the initial icon for the window. If no such icon is present, the `IDI_WINLOGO` icon will be used instead. To set a different icon, see The context to share resources with must not be current on any other thread. The GLFW window has no icon, as it is not a document window, but the dock icon will be the same as the application bundle's icon. For more information on bundles, see the [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) in the Mac Developer Library. The first time a window is created the menu bar is populated with common commands like Hide, Quit and About. The About entry opens a minimal about dialog with information from the application's bundle. The menu bar can be disabled with a [compile-time option]( On OS X 10.10 and later the window frame will not be rendered at full resolution on Retina displays unless the `NSHighResolutionCapable` key is enabled in the application bundle's `Info.plist`. For more information, see [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html) in the Mac Developer Library. The GLFW test and example programs use a custom `Info.plist` template for this, which can be found as `CMake/MacOSXBundleInfo.plist.in` in the source tree. Some window managers will not respect the placement of initially hidden windows. Due to the asynchronous nature of X11, it may take a moment for a window to reach its requested state. This means you may not be able to query the final size, position or other attributes directly after window creation. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwDestroyWindow Added in version 3.0. Replaces `glfwOpenWindow`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwCreateWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Window CreateWindow(int width, int height, in sbyte title, Monitor monitor, Window share);
/// <summary>
/// void glfwDefaultWindowHints()
/// </summary>
/// <remarks>
/// Resets all window hints to their default values. This function resets all window hints to their [default values]( Possible errors include _safety This function must only be called from the main thread. glfwWindowHint Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwDefaultWindowHints", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void DefaultWindowHints();
/// <summary>
/// void glfwDestroyCursor(GLFWcursor *cursor)
/// </summary>
/// <remarks>
/// Destroys a cursor. The cursor object to destroy. This function destroys a cursor previously created with glfwCreateCursor. Any remaining cursors will be destroyed by glfwTerminate. Possible errors include GLFW_PLATFORM_ERROR. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwCreateCursor Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwDestroyCursor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void DestroyCursor(Cursor cursor);
/// <summary>
/// void glfwDestroyWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Destroys the specified window and its context. The window to destroy. This function destroys the specified window and its context. On calling this function, no further callbacks will be called for that window. If the context of the specified window is current on the main thread, it is detached before being destroyed. Possible errors include GLFW_PLATFORM_ERROR. The context of the specified window must not be current on any other thread when this function is called. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwCreateWindow Added in version 3.0. Replaces `glfwCloseWindow`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwDestroyWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void DestroyWindow(Window window);
/// <summary>
/// int glfwExtensionSupported(const char *extension)
/// </summary>
/// <remarks>
/// Returns whether the specified extension is available. The ASCII encoded name of the extension. `GLFW_TRUE` if the extension is available, or `GLFW_FALSE` otherwise. This function returns whether the specified [API extension]( OpenGL ES context. It searches both for client API extension and context creation API extensions. A context must be current on the calling thread. Calling this function without a current context will cause a As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this. This function does not apply to Vulkan. If you are using Vulkan, see glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties` and `vkEnumerateDeviceExtensionProperties` instead. Possible errors include GLFW_NO_CURRENT_CONTEXT, GLFW_PLATFORM_ERROR. _safety This function may be called from any thread. glfwGetProcAddress Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwExtensionSupported", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int ExtensionSupported(in sbyte extension);
/// <summary>
/// void glfwFocusWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Brings the specified window to front and sets input focus. The window to give input focus. This function brings the specified window to front and sets input focus. The window should already be visible and not iconified. By default, both windowed and full screen mode windows are focused when initially created. Set the [GLFW_FOCUSED]( this behavior. __Do not use this function__ to steal focus from other applications unless you are certain that is what the user wants. Focus stealing can be extremely disruptive. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwFocusWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void FocusWindow(Window window);
/// <summary>
/// const char *glfwGetClipboardString(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Returns the contents of the clipboard as a string. The window that will request the clipboard contents. The contents of the clipboard as a UTF-8 encoded string, or `NULL` if an [error]( This function returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string. If the clipboard is empty or if its contents cannot be converted, `NULL` is returned and a GLFW_FORMAT_UNAVAILABLE error is generated. Possible errors include GLFW_PLATFORM_ERROR. _lifetime The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to glfwGetClipboardString or is terminated. _safety This function must only be called from the main thread. glfwSetClipboardString Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetClipboardString", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern sbyte* GetClipboardString(this Window window);
/// <summary>
/// GLFWwindow *glfwGetCurrentContext()
/// </summary>
/// <remarks>
/// Returns the window whose context is current on the calling thread. The window whose context is current, or `NULL` if no window's context is current. This function returns the window whose OpenGL or OpenGL ES context is current on the calling thread. Possible errors include _safety This function may be called from any thread. glfwMakeContextCurrent Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetCurrentContext", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Window GetCurrentContext();
/// <summary>
/// void glfwGetCursorPos(GLFWwindow *window, double *xpos, double *ypos)
/// </summary>
/// <remarks>
/// Retrieves the position of the cursor relative to the client area of the window. The desired window. Where to store the cursor x-coordinate, relative to the left edge of the client area, or `NULL`. Where to store the cursor y-coordinate, relative to the to top edge of the client area, or `NULL`. This function returns the position of the cursor, in screen coordinates, relative to the upper-left corner of the client area of the specified window. If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor position is unbounded and limited only by the minimum and maximum values of a `double`. The coordinate can be converted to their integer equivalents with the `floor` function. Casting directly to an integer type works for positive coordinates, but fails for negative ones. Any or all of the position arguments may be `NULL`. If an error occurs, all non-`NULL` position arguments will be set to zero. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwSetCursorPos Added in version 3.0. Replaces `glfwGetMousePos`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetCursorPos", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetCursorPos(Window window, out double xpos, out double ypos);
/// <summary>
/// void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)
/// </summary>
/// <remarks>
/// Retrieves the size of the framebuffer of the specified window. The window whose framebuffer to query. Where to store the width, in pixels, of the framebuffer, or `NULL`. Where to store the height, in pixels, of the framebuffer, or `NULL`. This function retrieves the size, in pixels, of the framebuffer of the specified window. If you wish to retrieve the size of the window in screen coordinates, see Any or all of the size arguments may be `NULL`. If an error occurs, all non-`NULL` size arguments will be set to zero. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwSetFramebufferSizeCallback Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetFramebufferSize", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetFramebufferSize(Window window, out int width, out int height);
/// <summary>
/// const GLFWgammaramp *glfwGetGammaRamp(GLFWmonitor *monitor)
/// </summary>
/// <remarks>
/// Returns the current gamma ramp for the specified monitor. The monitor to query. The current gamma ramp, or `NULL` if an [error]( This function returns the current gamma ramp of the specified monitor. Possible errors include GLFW_PLATFORM_ERROR. _lifetime The returned structure and its arrays are allocated and freed by GLFW. You should not free them yourself. They are valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated. _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetGammaRamp", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Gammaramp GetGammaRamp(Monitor monitor);
/// <summary>
/// int glfwGetInputMode(GLFWwindow *window, int mode)
/// </summary>
/// <remarks>
/// Returns the value of an input option for the specified window. The window to query. One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or `GLFW_STICKY_MOUSE_BUTTONS`. This function returns the value of an input option for the specified window. The mode must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or `GLFW_STICKY_MOUSE_BUTTONS`. Possible errors include GLFW_INVALID_ENUM. _safety This function must only be called from the main thread. glfwSetInputMode Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetInputMode", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int GetInputMode(Window window, int mode);
/// <summary>
/// const float *glfwGetJoystickAxes(int joy, int *count)
/// </summary>
/// <remarks>
/// Returns the values of all axes of the specified joystick. The [joystick]( Where to store the number of axis values in the returned array. This is set to zero if the joystick is not present or an error occurred. An array of axis values, or `NULL` if the joystick is not present or an [error]( This function returns the values of all axes of the specified joystick. Each element in the array is a value between -1.0 and 1.0. Querying a joystick slot with no device present is not an error, but will cause this function to return `NULL`. Call check device presence. Possible errors include GLFW_INVALID_ENUM and _lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated. _safety This function must only be called from the main thread. Added in version 3.0. Replaces `glfwGetJoystickPos`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetJoystickAxes", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern float* GetJoystickAxes(int joy, out int count);
/// <summary>
/// const unsigned char *glfwGetJoystickButtons(int joy, int *count)
/// </summary>
/// <remarks>
/// Returns the state of all buttons of the specified joystick. The [joystick]( Where to store the number of button states in the returned array. This is set to zero if the joystick is not present or an error occurred. An array of button states, or `NULL` if the joystick is not present or an [error]( This function returns the state of all buttons of the specified joystick. Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`. Querying a joystick slot with no device present is not an error, but will cause this function to return `NULL`. Call check device presence. Possible errors include GLFW_INVALID_ENUM and _lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated. _safety This function must only be called from the main thread. Added in version 2.2. Changed to return a dynamic array.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetJoystickButtons", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern ushort* GetJoystickButtons(int joy, out int count);
/// <summary>
/// const char *glfwGetJoystickName(int joy)
/// </summary>
/// <remarks>
/// Returns the name of the specified joystick. The [joystick]( The UTF-8 encoded name of the joystick, or `NULL` if the joystick is not present or an [error]( This function returns the name, encoded as UTF-8, of the specified joystick. The returned string is allocated and freed by GLFW. You should not free it yourself. Querying a joystick slot with no device present is not an error, but will cause this function to return `NULL`. Call check device presence. Possible errors include GLFW_INVALID_ENUM and _lifetime The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated. _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetJoystickName", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern sbyte* GetJoystickName(int joy);
/// <summary>
/// int glfwGetKey(GLFWwindow *window, int key)
/// </summary>
/// <remarks>
/// Returns the last reported state of a keyboard key for the specified window. The desired window. The desired [keyboard key]( One of `GLFW_PRESS` or `GLFW_RELEASE`. This function returns the last state reported for the specified key to the specified window. The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to the key callback. If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns `GLFW_PRESS` the first time you call it for a key that was pressed, even if that key has already been released. The key functions deal with physical keys, with [key tokens]( named after their use on the standard US keyboard layout. If you want to input text, use the Unicode character callback instead. The [modifier key bit masks]( used with this function. __Do not use this function__ to implement [text input]( not a valid key for this function. Possible errors include GLFW_INVALID_ENUM. _safety This function must only be called from the main thread. Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetKey", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int GetKey(Window window, int key);
/// <summary>
/// const char *glfwGetKeyName(int key, int scancode)
/// </summary>
/// <remarks>
/// Returns the localized name of the specified printable key. The key to query, or `GLFW_KEY_UNKNOWN`. The scancode of the key to query. The localized name of the key, or `NULL`. This function returns the localized name of the specified printable key. This is intended for displaying key bindings to the user. If the key is `GLFW_KEY_UNKNOWN`, the scancode is used instead, otherwise the scancode is ignored. If a non-printable key or (if the key is `GLFW_KEY_UNKNOWN`) a scancode that maps to a non-printable key is specified, this function returns `NULL`. This behavior allows you to pass in the arguments passed to the [key callback]( The printable keys are: - `GLFW_KEY_APOSTROPHE` - `GLFW_KEY_COMMA` - `GLFW_KEY_MINUS` - `GLFW_KEY_PERIOD` - `GLFW_KEY_SLASH` - `GLFW_KEY_SEMICOLON` - `GLFW_KEY_EQUAL` - `GLFW_KEY_LEFT_BRACKET` - `GLFW_KEY_RIGHT_BRACKET` - `GLFW_KEY_BACKSLASH` - `GLFW_KEY_WORLD_1` - `GLFW_KEY_WORLD_2` - `GLFW_KEY_0` to `GLFW_KEY_9` - `GLFW_KEY_A` to `GLFW_KEY_Z` - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9` - `GLFW_KEY_KP_DECIMAL` - `GLFW_KEY_KP_DIVIDE` - `GLFW_KEY_KP_MULTIPLY` - `GLFW_KEY_KP_SUBTRACT` - `GLFW_KEY_KP_ADD` - `GLFW_KEY_KP_EQUAL` Possible errors include GLFW_PLATFORM_ERROR. _lifetime The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to glfwGetKeyName, or until the library is terminated. _safety This function must only be called from the main thread. Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetKeyName", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern sbyte* GetKeyName(int key, int scancode);
/// <summary>
/// const char *glfwGetMonitorName(GLFWmonitor *monitor)
/// </summary>
/// <remarks>
/// Returns the name of the specified monitor. The monitor to query. The UTF-8 encoded name of the monitor, or `NULL` if an [error]( This function returns a human-readable name, encoded as UTF-8, of the specified monitor. The name typically reflects the make and model of the monitor and is not guaranteed to be unique among the connected monitors. Possible errors include _lifetime The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated. _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetMonitorName", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern sbyte* GetMonitorName(Monitor monitor);
/// <summary>
/// void glfwGetMonitorPhysicalSize(GLFWmonitor *monitor, int *widthMM,
/// int *heightMM)
/// </summary>
/// <remarks>
/// Returns the physical size of the monitor. The monitor to query. Where to store the width, in millimetres, of the monitor's display area, or `NULL`. Where to store the height, in millimetres, of the monitor's display area, or `NULL`. This function returns the size, in millimetres, of the display area of the specified monitor. Some systems do not provide accurate monitor size information, either because the monitor [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data) data is incorrect or because the driver does not report it accurately. Any or all of the size arguments may be `NULL`. If an error occurs, all non-`NULL` size arguments will be set to zero. Possible errors include calculates the returned physical size from the current resolution and system DPI instead of querying the monitor EDID data. _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetMonitorPhysicalSize", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetMonitorPhysicalSize(Monitor monitor, out int widthMM, out int heightMM);
/// <summary>
/// void glfwGetMonitorPos(GLFWmonitor *monitor, int *xpos, int *ypos)
/// </summary>
/// <remarks>
/// Returns the position of the monitor's viewport on the virtual screen. The monitor to query. Where to store the monitor x-coordinate, or `NULL`. Where to store the monitor y-coordinate, or `NULL`. This function returns the position, in screen coordinates, of the upper-left corner of the specified monitor. Any or all of the position arguments may be `NULL`. If an error occurs, all non-`NULL` position arguments will be set to zero. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetMonitorPos", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetMonitorPos(Monitor monitor, out int xpos, out int ypos);
/// <summary>
/// GLFWmonitor **glfwGetMonitors(int *count)
/// </summary>
/// <remarks>
/// Returns the currently connected monitors. Where to store the number of monitors in the returned array. This is set to zero if an error occurred. An array of monitor handles, or `NULL` if no monitors were found or if an [error]( This function returns an array of handles for all currently connected monitors. The primary monitor is always first in the returned array. If no monitors were found, this function returns `NULL`. Possible errors include _lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated. _safety This function must only be called from the main thread. glfwGetPrimaryMonitor Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetMonitors", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Monitor* GetMonitors(out int count);
/// <summary>
/// int glfwGetMouseButton(GLFWwindow *window, int button)
/// </summary>
/// <remarks>
/// Returns the last reported state of a mouse button for the specified window. The desired window. The desired [mouse button]( One of `GLFW_PRESS` or `GLFW_RELEASE`. This function returns the last state reported for the specified mouse button to the specified window. The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function `GLFW_PRESS` the first time you call it for a mouse button that was pressed, even if that mouse button has already been released. Possible errors include GLFW_INVALID_ENUM. _safety This function must only be called from the main thread. Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetMouseButton", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int GetMouseButton(Window window, int button);
/// <summary>
/// GLFWmonitor *glfwGetPrimaryMonitor()
/// </summary>
/// <remarks>
/// Returns the primary monitor. The primary monitor, or `NULL` if no monitors were found or if an [error]( This function returns the primary monitor. This is usually the monitor where elements like the task bar or global menu bar are located. Possible errors include _safety This function must only be called from the main thread. The primary monitor is always first in the array returned by glfwGetMonitors. glfwGetMonitors Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetPrimaryMonitor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Monitor GetPrimaryMonitor();
/// <summary>
/// GLFWglproc glfwGetProcAddress(const char *procname)
/// </summary>
/// <remarks>
/// Returns the address of the specified function for the current context. The ASCII encoded name of the function. The address of the function, or `NULL` if an [error]( This function returns the address of the specified OpenGL or OpenGL ES [core or extension function]( by the current context. A context must be current on the calling thread. Calling this function without a current context will cause a This function does not apply to Vulkan. If you are rendering with Vulkan, see `vkGetDeviceProcAddr` instead. Possible errors include GLFW_NO_CURRENT_CONTEXT and The address of a given function is not guaranteed to be the same between contexts. This function may return a non-`NULL` address despite the associated version or extension not being available. Always check the context version or extension string first. _lifetime The returned function pointer is valid until the context is destroyed or the library is terminated. _safety This function may be called from any thread. glfwExtensionSupported Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetProcAddress", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern GlprocDelegate GetProcAddress(in sbyte procname);
/// <summary>
/// const char **glfwGetRequiredInstanceExtensions(uint32_t *count)
/// </summary>
/// <remarks>
/// Returns the Vulkan instance extensions required by GLFW. Where to store the number of extensions in the returned array. This is set to zero if an error occurred. An array of ASCII encoded extension names, or `NULL` if an [error]( This function returns an array of names of Vulkan instance extensions required by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the list will always contains `VK_KHR_surface`, so if you don't require any additional extensions you can pass this list directly to the `VkInstanceCreateInfo` struct. If Vulkan is not available on the machine, this function returns `NULL` and generates a to check whether Vulkan is available. If Vulkan is available but no set of extensions allowing window surface creation was found, this function returns `NULL`. You may still use Vulkan for off-screen rendering and compute work. Possible errors include GLFW_API_UNAVAILABLE. Additional extensions may be required by future versions of GLFW. You should check if any extensions you wish to enable are already in the returned array, as it is an error to specify an extension more than once in the `VkInstanceCreateInfo` struct. _lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the library is terminated. _safety This function may be called from any thread. glfwCreateWindowSurface Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetRequiredInstanceExtensions", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern sbyte** GetRequiredInstanceExtensions(out uint count);
/// <summary>
/// double glfwGetTime()
/// </summary>
/// <remarks>
/// Returns the value of the GLFW timer. The current value, in seconds, or zero if an [error]( This function returns the value of the GLFW timer. Unless the timer has been set using was initialized. The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic time source on each supported platform. Possible errors include _safety This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized with calls to Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetTime", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern double GetTime();
/// <summary>
/// uint64_t glfwGetTimerFrequency()
/// </summary>
/// <remarks>
/// Returns the frequency, in Hz, of the raw timer. The frequency of the timer, in Hz, or zero if an [error]( This function returns the frequency, in Hz, of the raw timer. Possible errors include _safety This function may be called from any thread. glfwGetTimerValue Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetTimerFrequency", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern ulong GetTimerFrequency();
/// <summary>
/// uint64_t glfwGetTimerValue()
/// </summary>
/// <remarks>
/// Returns the current value of the raw timer. The value of the timer, or zero if an [error]( This function returns the current value of the raw timer, measured in 1 / frequency seconds. To get the frequency, call glfwGetTimerFrequency. Possible errors include _safety This function may be called from any thread. glfwGetTimerFrequency Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetTimerValue", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern ulong GetTimerValue();
/// <summary>
/// void glfwGetVersion(int *major, int *minor, int *rev)
/// </summary>
/// <remarks>
/// Retrieves the version of the GLFW library. Where to store the major version number, or `NULL`. Where to store the minor version number, or `NULL`. Where to store the revision number, or `NULL`. This function retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure that you are using the minimum required version. Any or all of the version arguments may be `NULL`. None. This function may be called before _safety This function may be called from any thread. glfwGetVersionString Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetVersion", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetVersion(out int major, out int minor, out int rev);
/// <summary>
/// const char *glfwGetVersionString()
/// </summary>
/// <remarks>
/// Returns a string describing the compile-time configuration. The ASCII encoded GLFW version string. This function returns the compile-time generated [version string]( describes the version, platform, compiler and any platform-specific compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried with `glGetString`. __Do not use the version string__ to parse the GLFW library version. The binary in numerical format. None. This function may be called before _lifetime The returned string is static and compile-time generated. _safety This function may be called from any thread. glfwGetVersion Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetVersionString", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern sbyte* GetVersionString();
/// <summary>
/// const GLFWvidmode *glfwGetVideoMode(GLFWmonitor *monitor)
/// </summary>
/// <remarks>
/// Returns the current mode of the specified monitor. The monitor to query. The current mode of the monitor, or `NULL` if an [error]( This function returns the current video mode of the specified monitor. If you have created a full screen window for that monitor, the return value will depend on whether that window is iconified. Possible errors include GLFW_PLATFORM_ERROR. _lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated. _safety This function must only be called from the main thread. glfwGetVideoModes Added in version 3.0. Replaces `glfwGetDesktopMode`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetVideoMode", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Vidmode GetVideoMode(Monitor monitor);
/// <summary>
/// const GLFWvidmode *glfwGetVideoModes(GLFWmonitor *monitor, int *count)
/// </summary>
/// <remarks>
/// Returns the available video modes for the specified monitor. The monitor to query. Where to store the number of video modes in the returned array. This is set to zero if an error occurred. An array of video modes, or `NULL` if an [error]( This function returns an array of all video modes supported by the specified monitor. The returned array is sorted in ascending order, first by color bit depth (the sum of all channel depths) and then by resolution area (the product of width and height). Possible errors include GLFW_PLATFORM_ERROR. _lifetime The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated. _safety This function must only be called from the main thread. glfwGetVideoMode Added in version 1.0. Changed to return an array of modes for a specific monitor.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetVideoModes", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Vidmode GetVideoModes(Monitor monitor, out int count);
/// <summary>
/// int glfwGetWindowAttrib(GLFWwindow *window, int attrib)
/// </summary>
/// <remarks>
/// Returns an attribute of the specified window. The window to query. The [window attribute]( The value of the attribute, or zero if an [error]( This function returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context. return. Possible errors include GLFW_INVALID_ENUM and Framebuffer related hints are not window attributes. See window_attribs_fb for more information. Zero is a valid value for many window and context related attributes so you cannot use a return value of zero as an indication of errors. However, this function should not fail as long as it is passed valid arguments and the library has been [initialized]( _safety This function must only be called from the main thread. Added in version 3.0. Replaces `glfwGetWindowParam` and `glfwGetGLVersion`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetWindowAttrib", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int GetWindowAttrib(Window window, int attrib);
/// <summary>
/// void glfwGetWindowFrameSize(GLFWwindow *window, int *left, int *top, int *right,
/// int *bottom)
/// </summary>
/// <remarks>
/// Retrieves the size of the frame of the window. The window whose frame size to query. Where to store the size, in screen coordinates, of the left edge of the window frame, or `NULL`. Where to store the size, in screen coordinates, of the top edge of the window frame, or `NULL`. Where to store the size, in screen coordinates, of the right edge of the window frame, or `NULL`. Where to store the size, in screen coordinates, of the bottom edge of the window frame, or `NULL`. This function retrieves the size, in screen coordinates, of each edge of the frame of the specified window. This size includes the title bar, if the window has one. The size of the frame may vary depending on the [window-related hints]( Because this function retrieves the size of each window frame edge and not the offset along a particular coordinate axis, the retrieved values will always be zero or positive. Any or all of the size arguments may be `NULL`. If an error occurs, all non-`NULL` size arguments will be set to zero. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetWindowFrameSize", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetWindowFrameSize(Window window, out int left, out int top, out int right, out int bottom);
/// <summary>
/// GLFWmonitor *glfwGetWindowMonitor(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Returns the monitor that the window uses for full screen mode. The window to query. The monitor, or `NULL` if the window is in windowed mode or an [error]( This function returns the handle of the monitor that the specified window is in full screen on. Possible errors include _safety This function must only be called from the main thread. glfwSetWindowMonitor Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetWindowMonitor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern Monitor GetWindowMonitor(Window window);
/// <summary>
/// void glfwGetWindowPos(GLFWwindow *window, int *xpos, int *ypos)
/// </summary>
/// <remarks>
/// Retrieves the position of the client area of the specified window. The window to query. Where to store the x-coordinate of the upper-left corner of the client area, or `NULL`. Where to store the y-coordinate of the upper-left corner of the client area, or `NULL`. This function retrieves the position, in screen coordinates, of the upper-left corner of the client area of the specified window. Any or all of the position arguments may be `NULL`. If an error occurs, all non-`NULL` position arguments will be set to zero. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwSetWindowPos Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetWindowPos", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetWindowPos(Window window, out int xpos, out int ypos);
/// <summary>
/// void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)
/// </summary>
/// <remarks>
/// Retrieves the size of the client area of the specified window. The window whose size to retrieve. Where to store the width, in screen coordinates, of the client area, or `NULL`. Where to store the height, in screen coordinates, of the client area, or `NULL`. This function retrieves the size, in screen coordinates, of the client area of the specified window. If you wish to retrieve the size of the framebuffer of the window in pixels, see Any or all of the size arguments may be `NULL`. If an error occurs, all non-`NULL` size arguments will be set to zero. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwSetWindowSize Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetWindowSize", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void GetWindowSize(Window window, out int width, out int height);
/// <summary>
/// void *glfwGetWindowUserPointer(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Returns the user pointer of the specified window. The window whose pointer to return. This function returns the current value of the user-defined pointer of the specified window. The initial value is `NULL`. Possible errors include _safety This function may be called from any thread. Access is not synchronized. glfwSetWindowUserPointer Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwGetWindowUserPointer", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void* GetWindowUserPointer(Window window);
/// <summary>
/// void glfwHideWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Hides the specified window. The window to hide. This function hides the specified window if it was previously visible. If the window is already hidden or is in full screen mode, this function does nothing. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwShowWindow Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwHideWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void HideWindow(Window window);
/// <summary>
/// void glfwIconifyWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Iconifies the specified window. The window to iconify. This function iconifies (minimizes) the specified window if it was previously restored. If the window is already iconified, this function does nothing. If the specified window is a full screen window, the original monitor resolution is restored until the window is restored. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwRestoreWindow glfwMaximizeWindow Added in version 2.1. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwIconifyWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void IconifyWindow(Window window);
/// <summary>
/// int glfwInit()
/// </summary>
/// <remarks>
/// Initializes the GLFW library. `GLFW_TRUE` if successful, or `GLFW_FALSE` if an [error]( This function initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before an application terminates GLFW should be terminated in order to free any resources allocated during or after initialization. If this function fails, it calls succeeds, you should call Additional calls to this function after successful initialization but before termination will return `GLFW_TRUE` immediately. Possible errors include This function will change the current directory of the application to the `Contents/Resources` subdirectory of the application's bundle, if present. This can be disabled with a [compile-time option]( _safety This function must only be called from the main thread. glfwTerminate Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwInit", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int Init();
/// <summary>
/// int glfwJoystickPresent(int joy)
/// </summary>
/// <remarks>
/// Returns whether the specified joystick is present. The [joystick]( `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise. This function returns whether the specified joystick is present. Possible errors include GLFW_INVALID_ENUM and _safety This function must only be called from the main thread. Added in version 3.0. Replaces `glfwGetJoystickParam`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwJoystickPresent", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int JoystickPresent(int joy);
/// <summary>
/// void glfwMakeContextCurrent(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Makes the context of the specified window current for the calling thread. The window whose context to make current, or `NULL` to detach the current context. This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. A context can only be made current on a single thread at a time and each thread can have only a single current context at a time. By default, making a context non-current implicitly forces a pipeline flush. On machines that support `GL_KHR_context_flush_control`, you can control whether a context performs this flush by setting the [GLFW_CONTEXT_RELEASE_BEHAVIOR]( The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a error. Possible errors include GLFW_NO_WINDOW_CONTEXT and _safety This function may be called from any thread. glfwGetCurrentContext Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwMakeContextCurrent", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void MakeContextCurrent(Window window);
/// <summary>
/// void glfwMaximizeWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Maximizes the specified window. The window to maximize. This function maximizes the specified window if it was previously not maximized. If the window is already maximized, this function does nothing. If the specified window is a full screen window, this function does nothing. Possible errors include GLFW_PLATFORM_ERROR. Thread Safety This function may only be called from the main thread. glfwIconifyWindow glfwRestoreWindow Added in GLFW 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwMaximizeWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void MaximizeWindow(Window window);
/// <summary>
/// void glfwPollEvents()
/// </summary>
/// <remarks>
/// Processes all pending events. This function processes only those events that are already in the event queue and then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called. On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the [window refresh callback]( your window when necessary during such operations. On some platforms, certain events are sent directly to the application without going through the event queue, causing callbacks to be called outside of a call to one of the event processing functions. Event processing is not required for joystick input to work. Possible errors include GLFW_PLATFORM_ERROR. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwWaitEvents glfwWaitEventsTimeout Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwPollEvents", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void PollEvents();
/// <summary>
/// void glfwPostEmptyEvent()
/// </summary>
/// <remarks>
/// Posts an empty event to the event queue. This function posts an empty event from the current thread to the event queue, causing If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use your threading library of choice. Possible errors include GLFW_PLATFORM_ERROR. _safety This function may be called from any thread. glfwWaitEvents glfwWaitEventsTimeout Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwPostEmptyEvent", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void PostEmptyEvent();
/// <summary>
/// void glfwRestoreWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Restores the specified window. The window to restore. This function restores the specified window if it was previously iconified (minimized) or maximized. If the window is already restored, this function does nothing. If the specified window is a full screen window, the resolution chosen for the window is restored on the selected monitor. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwIconifyWindow glfwMaximizeWindow Added in version 2.1. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwRestoreWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void RestoreWindow(Window window);
/// <summary>
/// GLFWcharfun glfwSetCharCallback(GLFWwindow *window, GLFWcharfun cbfun)
/// </summary>
/// <remarks>
/// Sets the Unicode character callback. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the character callback of the specified window, which is called when a Unicode character is input. The character callback is intended for Unicode text input. As it deals with characters, it is keyboard layout dependent, whereas the [key callback]( to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback instead. The character callback behaves as system text input normally does and will not be called if modifier keys are held down that would prevent normal text input on that platform, for example a Super (Command) key on OS X or Alt key on Windows. There is a [character with modifiers callback]( receives these events. Possible errors include _safety This function must only be called from the main thread. Added in version 2.4. Added window handle parameter and return value.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetCharCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern CharfunDelegate SetCharCallback(Window window, CharfunDelegate cbfun);
/// <summary>
/// GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow *window,
/// GLFWcharmodsfun cbfun)
/// </summary>
/// <remarks>
/// Sets the Unicode character with modifiers callback. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or an [error]( This function sets the character with modifiers callback of the specified window, which is called when a Unicode character is input regardless of what modifier keys are used. The character with modifiers callback is intended for implementing custom Unicode character input. For regular Unicode text input, see the [character callback]( callback, the character with modifiers callback deals with characters and is keyboard layout dependent. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the [key callback]( Possible errors include _safety This function must only be called from the main thread. Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetCharModsCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern CharmodsfunDelegate SetCharModsCallback(Window window, CharmodsfunDelegate cbfun);
/// <summary>
/// void glfwSetClipboardString(GLFWwindow *window, const char *string)
/// </summary>
/// <remarks>
/// Sets the clipboard to the specified string. The window that will own the clipboard contents. A UTF-8 encoded string. This function sets the system clipboard to the specified, UTF-8 encoded string. Possible errors include GLFW_PLATFORM_ERROR. _lifetime The specified string is copied before this function returns. _safety This function must only be called from the main thread. glfwGetClipboardString Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetClipboardString", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetClipboardString(Window window, in sbyte @string);
/// <summary>
/// void glfwSetCursor(GLFWwindow *window, GLFWcursor *cursor)
/// </summary>
/// <remarks>
/// Sets the cursor for the window. The window to set the cursor for. The cursor to set, or `NULL` to switch back to the default arrow cursor. This function sets the cursor image to be used when the cursor is over the client area of the specified window. The set cursor will only be visible when the [cursor mode]( `GLFW_CURSOR_NORMAL`. On some platforms, the set cursor may not be visible unless the window also has input focus. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetCursor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetCursor(Window window, Cursor cursor);
/// <summary>
/// GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow *window,
/// GLFWcursorenterfun cbfun)
/// </summary>
/// <remarks>
/// Sets the cursor enter/exit callback. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the cursor boundary crossing callback of the specified window, which is called when the cursor enters or leaves the client area of the window. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetCursorEnterCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern CursorenterfunDelegate SetCursorEnterCallback(Window window, CursorenterfunDelegate cbfun);
/// <summary>
/// void glfwSetCursorPos(GLFWwindow *window, double xpos, double ypos)
/// </summary>
/// <remarks>
/// Sets the position of the cursor, relative to the client area of the window. The desired window. The desired x-coordinate, relative to the left edge of the client area. The desired y-coordinate, relative to the top edge of the client area. This function sets the position, in screen coordinates, of the cursor relative to the upper-left corner of the client area of the specified window. The window must have input focus. If the window does not have input focus when this function is called, it fails silently. __Do not use this function__ to implement things like camera controls. GLFW already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the cursor, transparently re-centers it and provides unconstrained cursor motion. See If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is unconstrained and limited only by the minimum and maximum values of a `double`. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwGetCursorPos Added in version 3.0. Replaces `glfwSetMousePos`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetCursorPos", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetCursorPos(Window window, double xpos, double ypos);
/// <summary>
/// GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow *window,
/// GLFWcursorposfun cbfun)
/// </summary>
/// <remarks>
/// Sets the cursor position callback. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the cursor position callback of the specified window, which is called when the cursor is moved. The callback is provided with the position, in screen coordinates, relative to the upper-left corner of the client area of the window. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0. Replaces `glfwSetMousePosCallback`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetCursorPosCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern CursorposfunDelegate SetCursorPosCallback(Window window, CursorposfunDelegate cbfun);
/// <summary>
/// GLFWdropfun glfwSetDropCallback(GLFWwindow *window, GLFWdropfun cbfun)
/// </summary>
/// <remarks>
/// Sets the file drop callback. The window whose callback to set. The new file drop callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the file drop callback of the specified window, which is called when one or more dragged files are dropped on the window. Because the path array and its strings may have been generated specifically for that event, they are not guaranteed to be valid after the callback has returned. If you wish to use them after the callback returns, you need to make a deep copy. Possible errors include _safety This function must only be called from the main thread. Added in version 3.1.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetDropCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern DropfunDelegate SetDropCallback(Window window, DropfunDelegate cbfun);
/// <summary>
/// GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
/// </summary>
/// <remarks>
/// Sets the error callback. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set. This function sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs. The error callback is called on the thread where the error occurred. If you are using GLFW from multiple threads, your error callback needs to be written accordingly. Because the description string may have been generated specifically for that error, it is not guaranteed to be valid after the callback has returned. If you wish to use it after the callback returns, you need to make a copy. Once set, the error callback remains set even after the library has been terminated. None. This function may be called before _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetErrorCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern ErrorfunDelegate SetErrorCallback(ErrorfunDelegate cbfun);
/// <summary>
/// GLFWframebuffersizefun
///glfwSetFramebufferSizeCallback(GLFWwindow *window, GLFWframebuffersizefun cbfun)
/// </summary>
/// <remarks>
/// Sets the framebuffer resize callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetFramebufferSizeCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern FramebuffersizefunDelegate SetFramebufferSizeCallback(Window window, FramebuffersizefunDelegate cbfun);
/// <summary>
/// void glfwSetGamma(GLFWmonitor *monitor, float gamma)
/// </summary>
/// <remarks>
/// Generates a gamma ramp and sets it for the specified monitor. The monitor whose gamma ramp to set. The desired exponent. This function generates a 256-element gamma ramp from the specified exponent and then calls number greater than zero. Possible errors include GLFW_INVALID_VALUE and _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetGamma", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetGamma(Monitor monitor, float gamma);
/// <summary>
/// void glfwSetGammaRamp(GLFWmonitor *monitor, const GLFWgammaramp *ramp)
/// </summary>
/// <remarks>
/// Sets the current gamma ramp for the specified monitor. The monitor whose gamma ramp to set. The gamma ramp to use. This function sets the current gamma ramp for the specified monitor. The original gamma ramp for that monitor is saved by GLFW the first time this function is called and is restored by Possible errors include GLFW_PLATFORM_ERROR. Gamma ramp sizes other than 256 are not supported by all platforms or graphics hardware. The gamma ramp size must be 256. _lifetime The specified gamma ramp is copied before this function returns. _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetGammaRamp", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetGammaRamp(Monitor monitor, Gammaramp ramp);
/// <summary>
/// void glfwSetInputMode(GLFWwindow *window, int mode, int value)
/// </summary>
/// <remarks>
/// Sets an input option for the specified window. The window whose input mode to set. One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or `GLFW_STICKY_MOUSE_BUTTONS`. The new value of the specified input mode. This function sets an input mode option for the specified window. The mode must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or `GLFW_STICKY_MOUSE_BUTTONS`. If the mode is `GLFW_CURSOR`, the value must be one of the following cursor modes: - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally. - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client area of the window but does not restrict the cursor from leaving. - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls. If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are enabled, a key press will ensure that the next time it is called even if the key had been released before the call. This is useful when you are only interested in whether keys have been pressed but not when or in which order. If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it. If sticky mouse buttons are enabled, a mouse button press will ensure that if the mouse button had been released before the call. This is useful when you are only interested in whether mouse buttons have been pressed but not when or in which order. Possible errors include GLFW_INVALID_ENUM and _safety This function must only be called from the main thread. glfwGetInputMode Added in version 3.0. Replaces `glfwEnable` and `glfwDisable`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetInputMode", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetInputMode(Window window, int mode, int @value);
/// <summary>
/// GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
/// </summary>
/// <remarks>
/// Sets the joystick configuration callback. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the joystick configuration callback, or removes the currently set callback. This is called when a joystick is connected to or disconnected from the system. Possible errors include _safety This function must only be called from the main thread. Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetJoystickCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern JoystickfunDelegate SetJoystickCallback(JoystickfunDelegate cbfun);
/// <summary>
/// GLFWkeyfun glfwSetKeyCallback(GLFWwindow *window, GLFWkeyfun cbfun)
/// </summary>
/// <remarks>
/// Sets the key callback. The window whose callback to set. The new key callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the key callback of the specified window, which is called when a key is pressed, repeated or released. The key functions deal with physical keys, with layout independent [key tokens]( layout. If you want to input text, use the [character callback]( When a window loses input focus, it will generate synthetic key release events for all pressed keys. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the [window focus callback]( The scancode of a key is specific to that platform or sometimes even to that machine. Scancodes are intended to allow users to bind keys that don't have a GLFW key token. Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their state is not saved and so it cannot be queried with Sometimes GLFW needs to generate synthetic key events, in which case the scancode may be zero. Possible errors include _safety This function must only be called from the main thread. Added in version 1.0. Added window handle parameter and return value.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetKeyCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern KeyfunDelegate SetKeyCallback(Window window, KeyfunDelegate cbfun);
/// <summary>
/// GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun)
/// </summary>
/// <remarks>
/// Sets the monitor configuration callback. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the monitor configuration callback, or removes the currently set callback. This is called when a monitor is connected to or disconnected from the system. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetMonitorCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern MonitorfunDelegate SetMonitorCallback(MonitorfunDelegate cbfun);
/// <summary>
/// GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow *window,
/// GLFWmousebuttonfun cbfun)
/// </summary>
/// <remarks>
/// Sets the mouse button callback. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the mouse button callback of the specified window, which is called when a mouse button is pressed or released. When a window loses input focus, it will generate synthetic mouse button release events for all pressed mouse buttons. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the [window focus callback]( Possible errors include _safety This function must only be called from the main thread. Added in version 1.0. Added window handle parameter and return value.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetMouseButtonCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern MousebuttonfunDelegate SetMouseButtonCallback(Window window, MousebuttonfunDelegate cbfun);
/// <summary>
/// GLFWscrollfun glfwSetScrollCallback(GLFWwindow *window, GLFWscrollfun cbfun)
/// </summary>
/// <remarks>
/// Sets the scroll callback. The window whose callback to set. The new scroll callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the scroll callback of the specified window, which is called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad. The scroll callback receives all scrolling input, like that from a mouse wheel or a touchpad scrolling area. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0. Replaces `glfwSetMouseWheelCallback`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetScrollCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern ScrollfunDelegate SetScrollCallback(Window window, ScrollfunDelegate cbfun);
/// <summary>
/// void glfwSetTime(double time)
/// </summary>
/// <remarks>
/// Sets the GLFW timer. The new value, in seconds. This function sets the value of the GLFW timer. It then continues to count up from that value. The value must be a positive finite number less than or equal to 18446744073.0, which is approximately 584.5 years. Possible errors include GLFW_INVALID_VALUE. The upper limit of the timer is calculated as floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations storing nanoseconds in 64 bits. The limit may be increased in the future. _safety This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized with calls to Added in version 2.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetTime", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetTime(double time);
/// <summary>
/// void glfwSetWindowAspectRatio(GLFWwindow *window, int numer, int denom)
/// </summary>
/// <remarks>
/// Sets the aspect ratio of the specified window. The window to set limits for. The numerator of the desired aspect ratio, or `GLFW_DONT_CARE`. The denominator of the desired aspect ratio, or `GLFW_DONT_CARE`. This function sets the required aspect ratio of the client area of the specified window. If the window is full screen, the aspect ratio only takes effect once it is made windowed. If the window is not resizable, this function does nothing. The aspect ratio is specified as a numerator and a denominator and both values must be greater than zero. For example, the common 16:9 aspect ratio is specified as 16 and 9, respectively. If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect ratio limit is disabled. The aspect ratio is applied immediately to a windowed mode window and may cause it to be resized. Possible errors include GLFW_INVALID_VALUE and If you set size limits and an aspect ratio that conflict, the results are undefined. _safety This function must only be called from the main thread. glfwSetWindowSizeLimits Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowAspectRatio", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowAspectRatio(Window window, int numer, int denom);
/// <summary>
/// GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow *window,
/// GLFWwindowclosefun cbfun)
/// </summary>
/// <remarks>
/// Sets the close callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the close callback of the specified window, which is called when the user attempts to close the window, for example by clicking the close widget in the title bar. The close flag is set before this callback is called, but you can modify it at any time with The close callback is not triggered by Possible errors include Selecting Quit from the application menu will trigger the close callback for all windows. _safety This function must only be called from the main thread. Added in version 2.5. Added window handle parameter and return value.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowCloseCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern WindowclosefunDelegate SetWindowCloseCallback(Window window, WindowclosefunDelegate cbfun);
/// <summary>
/// GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow *window,
/// GLFWwindowfocusfun cbfun)
/// </summary>
/// <remarks>
/// Sets the focus callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the focus callback of the specified window, which is called when the window gains or loses input focus. After the focus callback is called for a window that lost input focus, synthetic key and mouse button release events will be generated for all such that had been pressed. For more information, see and Possible errors include _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowFocusCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern WindowfocusfunDelegate SetWindowFocusCallback(Window window, WindowfocusfunDelegate cbfun);
/// <summary>
/// void glfwSetWindowIcon(GLFWwindow *window, int count, const GLFWimage *images)
/// </summary>
/// <remarks>
/// Sets the icon for the specified window. The window whose icon to set. The number of images in the specified array, or zero to revert to the default window icon. The images to create the icon from. This is ignored if count is zero. This function sets the icon of the specified window. If passed an array of candidate images, those of or closest to the sizes desired by the system are selected. If no images are specified, the window reverts to its default icon. The desired image sizes varies depending on platform and system settings. The selected images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48. Possible errors include GLFW_PLATFORM_ERROR. _lifetime The specified image data is copied before this function returns. The GLFW window has no icon, as it is not a document window, so this function does nothing. The dock icon will be the same as the application bundle's icon. For more information on bundles, see the [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) in the Mac Developer Library. _safety This function must only be called from the main thread. Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowIcon", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowIcon(Window window, int count, Image images);
/// <summary>
/// GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow *window,
/// GLFWwindowiconifyfun cbfun)
/// </summary>
/// <remarks>
/// Sets the iconify callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the iconification callback of the specified window, which is called when the window is iconified or restored. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowIconifyCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern WindowiconifyfunDelegate SetWindowIconifyCallback(Window window, WindowiconifyfunDelegate cbfun);
/// <summary>
/// void glfwSetWindowMonitor(GLFWwindow *window, GLFWmonitor *monitor, int xpos,
/// int ypos, int width, int height, int refreshRate)
/// </summary>
/// <remarks>
/// Sets the mode, monitor, video mode and placement of a window. The window whose monitor, size or video mode to set. The desired monitor, or `NULL` to set windowed mode. The desired x-coordinate of the upper-left corner of the client area. The desired y-coordinate of the upper-left corner of the client area. The desired with, in screen coordinates, of the client area or video mode. The desired height, in screen coordinates, of the client area or video mode. The desired refresh rate, in Hz, of the video mode, or `GLFW_DONT_CARE`. This function sets the monitor that the window uses for full screen mode or, if the monitor is `NULL`, makes it windowed mode. When setting a monitor, this function updates the width, height and refresh rate of the desired video mode and switches to the video mode closest to it. The window position is ignored when setting a monitor. When the monitor is `NULL`, the position, width and height are used to place the window client area. The refresh rate is ignored when no monitor is specified. If you only wish to update the resolution of a full screen window or the size of a windowed mode window, see When a window transitions from full screen to windowed mode, this function restores any previous window settings such as whether it is decorated, floating, resizable, has size or aspect ratio limits, etc.. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwGetWindowMonitor glfwSetWindowSize Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowMonitor", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowMonitor(Window window, Monitor monitor, int xpos, int ypos, int width, int height, int refreshRate);
/// <summary>
/// void glfwSetWindowPos(GLFWwindow *window, int xpos, int ypos)
/// </summary>
/// <remarks>
/// Sets the position of the client area of the specified window. The window to query. The x-coordinate of the upper-left corner of the client area. The y-coordinate of the upper-left corner of the client area. This function sets the position, in screen coordinates, of the upper-left corner of the client area of the specified windowed mode window. If the window is a full screen window, this function does nothing. __Do not use this function__ to move an already visible window unless you have very good reasons for doing so, as it will confuse and annoy the user. The window manager may put limits on what positions are allowed. GLFW cannot and should not override these limits. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwGetWindowPos Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowPos", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowPos(Window window, int xpos, int ypos);
/// <summary>
/// GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow *window,
/// GLFWwindowposfun cbfun)
/// </summary>
/// <remarks>
/// Sets the position callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the position callback of the specified window, which is called when the window is moved. The callback is provided with the screen position of the upper-left corner of the client area of the window. Possible errors include _safety This function must only be called from the main thread. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowPosCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern WindowposfunDelegate SetWindowPosCallback(Window window, WindowposfunDelegate cbfun);
/// <summary>
/// GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow *window,
/// GLFWwindowrefreshfun cbfun)
/// </summary>
/// <remarks>
/// Sets the refresh callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the refresh callback of the specified window, which is called when the client area of the window needs to be redrawn, for example if the window has been exposed after having been covered by another window. On compositing window systems such as Aero, Compiz or Aqua, where the window contents are saved off-screen, this callback may be called only very infrequently or never at all. Possible errors include _safety This function must only be called from the main thread. Added in version 2.5. Added window handle parameter and return value.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowRefreshCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern WindowrefreshfunDelegate SetWindowRefreshCallback(Window window, WindowrefreshfunDelegate cbfun);
/// <summary>
/// void glfwSetWindowShouldClose(GLFWwindow *window, int value)
/// </summary>
/// <remarks>
/// Sets the close flag of the specified window. The window whose flag to change. The new value. This function sets the value of the close flag of the specified window. This can be used to override the user's attempt to close the window, or to signal that it should be closed. Possible errors include _safety This function may be called from any thread. Access is not synchronized. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowShouldClose", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowShouldClose(Window window, int @value);
/// <summary>
/// void glfwSetWindowSize(GLFWwindow *window, int width, int height)
/// </summary>
/// <remarks>
/// Sets the size of the client area of the specified window. The window to resize. The desired width, in screen coordinates, of the window client area. The desired height, in screen coordinates, of the window client area. This function sets the size, in screen coordinates, of the client area of the specified window. For full screen windows, this function updates the resolution of its desired video mode and switches to the video mode closest to it, without affecting the window's context. As the context is unaffected, the bit depths of the framebuffer remain unchanged. If you wish to update the refresh rate of the desired video mode in addition to its resolution, see The window manager may put limits on what sizes are allowed. GLFW cannot and should not override these limits. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwGetWindowSize glfwSetWindowMonitor Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowSize", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowSize(Window window, int width, int height);
/// <summary>
/// GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow *window,
/// GLFWwindowsizefun cbfun)
/// </summary>
/// <remarks>
/// Sets the size callback for the specified window. The window whose callback to set. The new callback, or `NULL` to remove the currently set callback. The previously set callback, or `NULL` if no callback was set or the library had not been [initialized]( This function sets the size callback of the specified window, which is called when the window is resized. The callback is provided with the size, in screen coordinates, of the client area of the window. Possible errors include _safety This function must only be called from the main thread. Added in version 1.0. Added window handle parameter and return value.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowSizeCallback", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern WindowsizefunDelegate SetWindowSizeCallback(Window window, WindowsizefunDelegate cbfun);
/// <summary>
/// void glfwSetWindowSizeLimits(GLFWwindow *window, int minwidth, int minheight,
/// int maxwidth, int maxheight)
/// </summary>
/// <remarks>
/// Sets the size limits of the specified window. The window to set limits for. The minimum width, in screen coordinates, of the client area, or `GLFW_DONT_CARE`. The minimum height, in screen coordinates, of the client area, or `GLFW_DONT_CARE`. The maximum width, in screen coordinates, of the client area, or `GLFW_DONT_CARE`. The maximum height, in screen coordinates, of the client area, or `GLFW_DONT_CARE`. This function sets the size limits of the client area of the specified window. If the window is full screen, the size limits only take effect once it is made windowed. If the window is not resizable, this function does nothing. The size limits are applied immediately to a windowed mode window and may cause it to be resized. The maximum dimensions must be greater than or equal to the minimum dimensions and all must be greater than or equal to zero. Possible errors include GLFW_INVALID_VALUE and If you set size limits and an aspect ratio that conflict, the results are undefined. _safety This function must only be called from the main thread. glfwSetWindowAspectRatio Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowSizeLimits", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowSizeLimits(Window window, int minwidth, int minheight, int maxwidth, int maxheight);
/// <summary>
/// void glfwSetWindowTitle(GLFWwindow *window, const char *title)
/// </summary>
/// <remarks>
/// Sets the title of the specified window. The window whose title to change. The UTF-8 encoded window title. This function sets the window title, encoded as UTF-8, of the specified window. Possible errors include GLFW_PLATFORM_ERROR. The window title will not be updated until the next time you process events. _safety This function must only be called from the main thread. Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowTitle", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowTitle(Window window, in sbyte title);
/// <summary>
/// void glfwSetWindowUserPointer(GLFWwindow *window, void *pointer)
/// </summary>
/// <remarks>
/// Sets the user pointer of the specified window. The window whose pointer to set. The new value. This function sets the user-defined pointer of the specified window. The current value is retained until the window is destroyed. The initial value is `NULL`. Possible errors include _safety This function may be called from any thread. Access is not synchronized. glfwGetWindowUserPointer Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSetWindowUserPointer", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SetWindowUserPointer(Window window, IntPtr pointer);
/// <summary>
/// void glfwShowWindow(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Makes the specified window visible. The window to make visible. This function makes the specified window visible if it was previously hidden. If the window is already visible or is in full screen mode, this function does nothing. Possible errors include GLFW_PLATFORM_ERROR. _safety This function must only be called from the main thread. glfwHideWindow Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwShowWindow", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void ShowWindow(Window window);
/// <summary>
/// void glfwSwapBuffers(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Swaps the front and back buffers of the specified window. The window whose buffers to swap. This function swaps the front and back buffers of the specified window when rendering with OpenGL or OpenGL ES. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers. The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a error. This function does not apply to Vulkan. If you are rendering with Vulkan, see `vkQueuePresentKHR` instead. Possible errors include GLFW_NO_WINDOW_CONTEXT and __EGL:__ The context of the specified window must be current on the calling thread. _safety This function may be called from any thread. glfwSwapInterval Added in version 1.0. Added window handle parameter.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSwapBuffers", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SwapBuffers(Window window);
/// <summary>
/// void glfwSwapInterval(int interval)
/// </summary>
/// <remarks>
/// Sets the swap interval for the current context. The minimum number of screen updates to wait for until the buffers are swapped by This function sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time glfwSwapBuffers was called before swapping the buffers and returning. This is sometimes called _vertical synchronization_, _vertical retrace synchronization_ or just _vsync_. Contexts that support either of the `WGL_EXT_swap_control_tear` and `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals, which allow the driver to swap even if a frame arrives a little bit late. You can check for the presence of these extensions using glfwExtensionSupported. For more information about swap tearing, see the extension specifications. A context must be current on the calling thread. Calling this function without a current context will cause a This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead. Possible errors include GLFW_NO_CURRENT_CONTEXT and This function is not called during context creation, leaving the swap interval set to whatever is the default on that platform. This is done because some swap interval extensions used by GLFW do not allow the swap interval to be reset to zero once it has been set to a non-zero value. Some GPU drivers do not honor the requested swap interval, either because of a user setting that overrides the application's request or due to bugs in the driver. _safety This function may be called from any thread. glfwSwapBuffers Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwSwapInterval", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void SwapInterval(int interval);
/// <summary>
/// void glfwTerminate()
/// </summary>
/// <remarks>
/// Terminates the GLFW library. This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call you will be able to use most GLFW functions. If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to call this function, as it is called by failure. Possible errors include This function may be called before The contexts of any remaining windows must not be current on any other thread when this function is called. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwInit Added in version 1.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwTerminate", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void Terminate();
/// <summary>
/// int glfwVulkanSupported()
/// </summary>
/// <remarks>
/// Returns whether the Vulkan loader has been found. `GLFW_TRUE` if Vulkan is available, or `GLFW_FALSE` otherwise. This function returns whether the Vulkan loader has been found. This check is performed by The availability of a Vulkan loader does not by itself guarantee that window surface creation or even device creation is possible. Call glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan surface creation are available and glfwGetPhysicalDevicePresentationSupport to check whether a queue family of a physical device supports image presentation. Possible errors include _safety This function may be called from any thread. Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwVulkanSupported", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int VulkanSupported();
/// <summary>
/// void glfwWaitEvents()
/// </summary>
/// <remarks>
/// Waits until events are queued and processes them. This function puts the calling thread to sleep until at least one event is available in the event queue. Once one or more events are available, it behaves exactly like are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called. Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks. On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the [window refresh callback]( your window when necessary during such operations. On some platforms, certain callbacks may be called outside of a call to one of the event processing functions. If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use your threading library of choice. Event processing is not required for joystick input to work. Possible errors include GLFW_PLATFORM_ERROR. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwPollEvents glfwWaitEventsTimeout Added in version 2.5.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwWaitEvents", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void WaitEvents();
/// <summary>
/// void glfwWaitEventsTimeout(double timeout)
/// </summary>
/// <remarks>
/// Waits with timeout until events are queued and processes them. The maximum amount of time, in seconds, to wait. This function puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If one or more events are available, it behaves exactly like glfwPollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called. The timeout value must be a positive finite number. Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks. On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the [window refresh callback]( your window when necessary during such operations. On some platforms, certain callbacks may be called outside of a call to one of the event processing functions. If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use your threading library of choice. Event processing is not required for joystick input to work. This function must not be called from a callback. _safety This function must only be called from the main thread. glfwPollEvents glfwWaitEvents Added in version 3.2.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwWaitEventsTimeout", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void WaitEventsTimeout(double timeout);
/// <summary>
/// void glfwWindowHint(int hint, int value)
/// </summary>
/// <remarks>
/// Sets the specified window hint to the desired value. The [window hint]( The new value of the window hint. This function sets hints for the next call to hints, once set, retain their values until changed by a call to glfwWindowHint or terminated. This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next call to Possible errors include GLFW_INVALID_ENUM. _safety This function must only be called from the main thread. glfwDefaultWindowHints Added in version 3.0. Replaces `glfwOpenWindowHint`.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwWindowHint", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern void WindowHint(int hint, int @value);
/// <summary>
/// int glfwWindowShouldClose(GLFWwindow *window)
/// </summary>
/// <remarks>
/// Checks the close flag of the specified window. The window to query. The value of the close flag. This function returns the value of the close flag of the specified window. Possible errors include _safety This function may be called from any thread. Access is not synchronized. Added in version 3.0.
/// </remarks>
[DllImport(DllNames.GLFW, EntryPoint = "glfwWindowShouldClose", CallingConvention=CallingConvention.Cdecl)]
public static unsafe extern int WindowShouldClose(Window window);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment