SpaceVIL
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Glfw3.Glfw Class Reference

GLFW 3 bindings. More...

Classes

struct  Cursor
 Opaque cursor object. More...
 
struct  GammaRamp
 This describes the gamma ramp for a monitor. More...
 
struct  Image
 Image data. More...
 
struct  InternalGammaRamp
 
struct  InternalImage
 Internal image data.
 
struct  Monitor
 
struct  VideoMode
 This describes a single video mode. More...
 
struct  Window
 

Public Types

enum  ClientApi { None = 0, OpenGL = 0x00030001, OpenGLES = 0x00030002 }
 
See also
Hint.ClientApi

 
enum  ConnectionEvent { Connected = 0x00040001, Disconnected = 0x00040002 }
 Connection events for inputs and monitors. More...
 
enum  ContextApi { Native = 0x00036001, EGL = 0x00036002 }
 
See also
Hint.ContextCreationApi

 
enum  ContextReleaseBehavior { Any = 0, Flush = 0x00035001, None = 0x00035002 }
 
See also
Hint.ContextReleaseBehavior

 
enum  ContextRobustness { None = 0, NoResetNotification = 0x00031001, LoseContextOnReset = 0x00031002 }
 
See also
Hint.ContextRobustness

 
enum  CursorMode { CursorMode.Normal = 0x00034001, CursorMode.Hidden = 0x00034002, CursorMode.Disabled = 0x00034003 }
 Cursor modes. More...
 
enum  CursorType {
  CursorType.Arrow = 0x00036001, CursorType.Beam = 0x00036002, CursorType.Crosshair = 0x00036003, CursorType.Hand = 0x00036004,
  CursorType.ResizeX = 0x00036005, CursorType.ResizeY = 0x00036006, ResizeXY = 0x00036007
}
 Standard cursor shapes. More...
 
enum  ErrorCode {
  ErrorCode.NotInitialized = 0x00010001, ErrorCode.NoCurrentContext = 0x00010002, ErrorCode.InvalidEnum = 0x00010003, ErrorCode.InvalidValue = 0x00010004,
  ErrorCode.OutOfMemory = 0x00010005, ErrorCode.ApiUnavailable = 0x00010006, ErrorCode.VersionUnavailable = 0x00010007, ErrorCode.PlatformError = 0x00010008,
  ErrorCode.FormatUnavailable = 0x00010009, ErrorCode.NoWindowContext = 0x0001000A
}
 Error codes. More...
 
enum  Hint {
  Hint.Focused = 0x00020001, Hint.Resizable = 0x00020003, Hint.Visible = 0x00020004, Hint.Decorated = 0x00020005,
  Hint.AutoIconify = 0x00020006, Hint.Floating = 0x00020007, Hint.Maximized = 0x00020008, Hint.RedBits = 0x00021001,
  Hint.GreenBits = 0x00021002, Hint.BlueBits = 0x00021003, Hint.AlphaBits = 0x00021004, Hint.DepthBits = 0x00021005,
  Hint.StencilBits = 0x00021006, Hint.AccumRedBits = 0x00021007, Hint.AccumGreenBits = 0x00021008, Hint.AccumBlueBits = 0x00021009,
  Hint.AccumAlphaBits = 0x0002100a, Hint.AuxBuffers = 0x0002100b, Hint.Stereo = 0x0002100c, Hint.Samples = 0x0002100d,
  Hint.sRGBCapable = 0x0002100e, Hint.Doublebuffer = 0x00021010, Hint.RefreshRate = 0x0002100f, Hint.ClientApi = 0x00022001,
  Hint.ContextVersionMajor = 0x00022002, Hint.ContextVersionMinor = 0x00022003, Hint.ContextRevision = 0x00022004, Hint.ContextRobustness = 0x00022005,
  Hint.OpenglForwardCompat = 0x00022006, Hint.OpenglDebugContext = 0x00022007, Hint.OpenglProfile = 0x00022008, Hint.ContextReleaseBehavior = 0x00022009,
  Hint.ContextNoError = 0x0002200a, Hint.ContextCreationApi = 0x0002200b, TranspatentFramebuffer = 131082, CocoaRetinaFramebuffer = 143361
}
 
enum  OpenGLProfile { Any = 0, Core = 0x00032001, Compat = 0x00032002 }
 
See also
Hint.OpenglProfile

 
enum  WindowAttrib {
  WindowAttrib.Focused = 0x00020001, WindowAttrib.Iconified = 0x00020002, WindowAttrib.Maximized = 0x00020008, WindowAttrib.Visible = 0x00020004,
  WindowAttrib.Resizable = 0x00020003, WindowAttrib.Decorated = 0x00020005, WindowAttrib.Floating = 0x00020007
}
 

Public Member Functions

delegate void CharFunc (Window window, uint codepoint)
 The function signature for Unicode character callbacks. More...
 
delegate void CharModsFunc (Window window, uint codepoint, KeyMods mods)
 The function signature for Unicode character with modifiers callbacks. It is called for each input character, regardless of what modifier keys are held down. More...
 
delegate void CursorEnterFunc (Window window, [MarshalAs(UnmanagedType.Bool)] bool entered)
 The function signature for cursor enter/leave callbacks. More...
 
delegate void CursorPosFunc (Window window, double xpos, double ypos)
 The function signature for cursor position callbacks. More...
 
delegate void DropFunc (Window window, int count, [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr, SizeParamIndex=1)] string[] paths)
 
delegate void ErrorFunc (ErrorCode error, string description)
 The function signature for error callbacks. More...
 
delegate void FramebufferSizeFunc (Window window, int width, int height)
 The function signature for framebuffer resize callbacks. More...
 
delegate void KeyFunc (Window window, KeyCode key, int scancode, InputState state, KeyMods mods)
 The function signature for keyboard key callbacks. More...
 
delegate void JoystickFunc (Joystick joy, ConnectionEvent evt)
 The function signature for joystick configuration callbacks. More...
 
delegate void MonitorFunc (Monitor monitor, ConnectionEvent evt)
 The function signature for monitor configuration callbacks. More...
 
delegate void MouseButtonFunc (Window window, MouseButton button, InputState state, KeyMods mods)
 The function signature for mouse button callbacks. More...
 
delegate void ScrollFunc (Window window, double xoffset, double yoffset)
 The function signature for scroll callbacks. More...
 
delegate void WindowCloseFunc (Window window)
 The function signature for window close callbacks. More...
 
delegate void WindowFocusFunc (Window window, [MarshalAs(UnmanagedType.Bool)] bool focused)
 The function signature for window focus/defocus callbacks. More...
 
delegate void WindowIconifyFunc (Window window, [MarshalAs(UnmanagedType.Bool)] bool focused)
 The function signature for window iconify/restore callbacks. More...
 
delegate void WindowPosFunc (Window window, int xpos, int ypos)
 The function signature for window position callbacks. More...
 
delegate void WindowRefreshFunc (Window window)
 The function signature for window content refresh callbacks. More...
 
delegate void WindowSizeFunc (Window window, int width, int height)
 The function signature for window resize callbacks. More...
 
static bool Init ()
 
static void Terminate ()
 
static void GetVersion (out int major, out int minor, out int rev)
 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. More...
 
static Monitor GetPrimaryMonitor ()
 This function returns the primary monitor. This is usually the monitor where elements like the task bar or global menu bar are located. More...
 
static void DefaultWindowHints ()
 This function resets all window hints to their default values. More...
 
static void DestroyWindow (Window window)
 
static bool WindowShouldClose (Window window)
 This function returns the value of the close flag of the specified window. More...
 
static void SetWindowShouldClose (Window window, [MarshalAs(UnmanagedType.Bool)] bool 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. More...
 
static void SetWindowPos (Window window, int xpos, int ypos)
 
static void SetWindowOpacity (Window window, float opacity)
 
static void SetWindowSizeLimits (Window window, int minwidth, int minheight, int maxwidth, int maxheight)
 
static void SetWindowAspectRatio (Window window, int numer, int denom)
 
static void SetWindowSize (Window window, int width, int height)
 
static void IconifyWindow (Window window)
 
static void RestoreWindow (Window window)
 
static void MaximizeWindow (Window window)
 
static void ShowWindow (Window window)
 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. More...
 
static void HideWindow (Window window)
 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. More...
 
static void FocusWindow (Window window)
 
static void SetWindowMonitor (Window window, Monitor monitor, int xpos, int ypos, int width, int height, int refreshRate)
 
static void SetWindowUserPointer (Window window, IntPtr ptr)
 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 IntPtr.Zero. More...
 
static IntPtr GetWindowUserPointer (Window window)
 This function sets the user-defined pointer of the specified window. The initial value is IntPtr.Zero. More...
 
static void PollEvents ()
 
static void WaitEvents ()
 
static void WaitEventsTimeout (double timeout)
 
static void PostEmptyEvent ()
 
static bool GetKey (Window window, int key)
 
static bool GetMouseButton (Window window, MouseButton button)
 
static void SetCursorPos (Window window, double xpos, double ypos)
 
static Cursor CreateStandardCursor (CursorType cursor)
 Returns a cursor with a standard shape, that can be set for a window with CreateCursor(Image, int, int). More...
 
static void DestroyCursor (Cursor cursor)
 This function destroys a cursor previously created with CreateCursor(Image, int, int). Any remaining cursors will be destroyed by Terminate. More...
 
static void SetCursor (Window window, Cursor cursor)
 
static bool JoystickPresent (Joystick joy)
 This function returns whether the specified joystick is present. More...
 
static double GetTime ()
 
static void SetTime (double time)
 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. More...
 
static ulong GetTimerValue ()
 This function returns the current value of the raw timer, measured in 1/frequency seconds. To get the frequency, call GetTimerFrequency. More...
 
static ulong GetTimerFrequency ()
 This function returns the frequency, in Hz, of the raw timer. More...
 
static void MakeContextCurrent (Window window)
 
static Window GetCurrentContext ()
 This function returns the window whose OpenGL or OpenGL ES context is current on the calling thread. More...
 
static void SwapBuffers (Window window)
 
static void SwapInterval (int interval)
 
static bool ExtensionSupported (string extension)
 
static IntPtr GetProcAddress (string procname)
 
static bool VulkanSupported ()
 This function returns whether the Vulkan loader has been found. This check is performed by Init. More...
 

Static Public Member Functions

static unsafe string GetVersionString ()
 
static void SetErrorCallback (ErrorFunc callback)
 
static unsafe Monitor [] GetMonitors ()
 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. More...
 
static unsafe void GetMonitorPos (Monitor monitor, out int xpos, out int ypos)
 This function returns the position, in screen coordinates, of the upper-left corner of the specified monitor. More...
 
static unsafe void GetMonitorPhysicalSize (Monitor monitor, out int widthMM, out int heightMM)
 
static unsafe string GetMonitorName (Monitor monitor)
 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. More...
 
static void SetMonitorCallback (MonitorFunc callback)
 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. More...
 
static unsafe VideoMode [] GetVideoModes (Monitor monitor)
 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). More...
 
static VideoMode GetVideoMode (Monitor monitor)
 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. More...
 
static void SetGamma (Monitor monitor, float gamma)
 This function generates a 256-element gamma ramp from the specified exponent and then calls SetGammaRamp(Monitor, GammaRamp) with it. The value must be a finite number greater than zero. More...
 
static unsafe GammaRamp GetGammaRamp (Monitor monitor)
 This function returns the current gamma ramp of the specified monitor. More...
 
static unsafe void SetGammaRamp (Monitor monitor, GammaRamp ramp)
 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 Terminate. More...
 
static void WindowHint (Hint hint, bool value)
 
static void WindowHint (Hint hint, int value)
 
static void WindowHint (Hint hint, Enum value)
 
static Window CreateWindow (int width, int height, string title, Monitor? monitor=null, Window? share=null)
 
static void SetWindowTitle (Window window, string title)
 This function sets the window title, encoded as UTF-8, of the specified window. More...
 
static void SetWindowIcon (Window window, Image image)
 
static unsafe void SetWindowIcon (Window window, Image[] images)
 
static unsafe void GetWindowPos (Window window, out int xpos, out int ypos)
 This function retrieves the position, in screen coordinates, of the upper-left corner of the client area of the specified window. More...
 
static unsafe void GetWindowSize (Window window, out int width, out int height)
 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 GetFramebufferSize(Window, out int, out int). More...
 
static unsafe void GetFramebufferSize (Window window, out int width, out int height)
 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 GetWindowSize(Window, out int, out int). More...
 
static unsafe void GetWindowFrameSize (Window window, out int left, out int top, out int right, out int bottom)
 
static Monitor GetWindowMonitor (Window window)
 This function returns the handle of the monitor that the specified window is in full screen on. More...
 
static bool GetWindowAttrib (Window window, WindowAttrib attrib)
 This function returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context. More...
 
static void SetWindowPosCallback (Window window, WindowPosFunc callback)
 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. More...
 
static void SetWindowSizeCallback (Window window, WindowSizeFunc callback)
 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. More...
 
static void SetWindowCloseCallback (Window window, WindowCloseFunc callback)
 
static void SetWindowRefreshCallback (Window window, WindowRefreshFunc callback)
 
static void SetWindowFocusCallback (Window window, WindowFocusFunc callback)
 
static void SetWindowIconifyCallback (Window window, WindowIconifyFunc callback)
 This function sets the iconification callback of the specified window, which is called when the window is iconified or restored. More...
 
static void SetFramebufferSizeCallback (Window window, FramebufferSizeFunc callback)
 This function sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized. More...
 
static int GetInputMode (Window window, InputMode mode)
 This function returns the value of an input option for the specified window. More...
 
static void SetInputMode (Window window, InputMode mode, CursorMode value)
 
static void SetInputMode (Window window, InputMode mode, bool value)
 
static unsafe string GetKeyName (KeyCode key, int scancode)
 
static unsafe void GetCursorPos (Window window, out double xpos, out double ypos)
 
static unsafe Cursor CreateCursor (Image image, int xhot, int yhot)
 
static void SetKeyCallback (Window window, KeyFunc callback)
 
static void SetCharCallback (Window window, CharFunc callback)
 
static void SetCharModsCallback (Window window, CharModsFunc callback)
 
static void SetMouseButtonCallback (Window window, MouseButtonFunc callback)
 
static void SetCursorPosCallback (Window window, CursorPosFunc callback)
 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. More...
 
static void SetCursorEnterCallback (Window window, CursorEnterFunc callback)
 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. More...
 
static void SetScrollCallback (Window window, ScrollFunc callback)
 
static void SetDropCallback (Window window, DropFunc callback)
 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. More...
 
static unsafe float [] GetJoystickAxes (Joystick joy)
 
static unsafe bool [] GetJoystickButtons (Joystick joy)
 
static string GetJoystickName (Joystick joy)
 
static void SetJoystickCallback (JoystickFunc callback)
 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. More...
 
static void SetClipboardString (Window window, string value)
 This function sets the system clipboard to the specified, UTF-8 encoded string. More...
 
static string GetClipboardString (Window window)
 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 ErrorCode.FormatUnavailable error is generated. More...
 

Static Public Attributes

static readonly int DontCare = -1
 Adds the specified native directory path to the Path environment variable to facilitate native loading. More...
 
static readonly int VersionMajor = 3
 The major version number of the GLFW library. This is incremented when the API is changed in non-compatible ways. More...
 
static readonly int VersionMinor = 2
 The minor version number of the GLFW library. This is incremented when features are added to the API but it remains backward-compatible. More...
 
static readonly int VersionRevision = 1
 The revision number of the GLFW library. This is incremented when a bug fix release is made that does not contain any API changes. More...
 

Detailed Description

GLFW 3 bindings.

Member Enumeration Documentation

◆ ConnectionEvent

Connection events for inputs and monitors.

See also
SetJoystickCallback(JoystickFunc), SetMonitorCallback(MonitorFunc)

◆ CursorMode

enum Glfw3.Glfw.CursorMode
strong

Cursor modes.

See also
SetInputMode
Enumerator
Normal 

Makes the cursor visible and behaving normally.

Hidden 

Makes the cursor invisible when it is over the client area of the window but does not restrict the cursor from leaving.

Disabled 

Hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls.

◆ CursorType

enum Glfw3.Glfw.CursorType
strong

Standard cursor shapes.

See also
SetCursor
Enumerator
Arrow 

The regular arrow cursor.

Beam 

The text input I-beam cursor shape.

Crosshair 

The crosshair shape.

Hand 

The hand shape.

ResizeX 

The horizontal resize arrow shape.

ResizeY 

The vertical resize arrow shape.

◆ ErrorCode

enum Glfw3.Glfw.ErrorCode
strong

Error codes.

See also
SetErrorCallback
Enumerator
NotInitialized 

GLFW has not been initialized.

This occurs if a GLFW function was called that must not be called unless the library is initialized.

NoCurrentContext 

No context is current for this thread.

This occurs if a GLFW function was called that needs and operates on the current OpenGL or OpenGL ES context but no context is current on the calling thread. One such function is SwapInterval.

InvalidEnum 

One of the arguments to the function was an invalid enum value, for example requesting Hint.RedBits with GetWindowAttrib(Window, WindowAttrib).

InvalidValue 

One of the arguments to the function was an invalid value, for example requesting a non-existent OpenGL or OpenGL ES version like 2.7. Requesting a valid but unavailable OpenGL or OpenGL ES version will instead result in a VersionUnavailable error.

OutOfMemory 

A memory allocation failed.

ApiUnavailable 

GLFW could not find support for the requested API on the system.

VersionUnavailable 

The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.

PlatformError 

A platform-specific error occurred that does not match any of the more specific categories.

FormatUnavailable 

The requested format is not supported or available.

If emitted during window creation, the requested pixel format is not supported.

If emitted when querying the clipboard, the contents of the clipboard could not be converted to the requested format.

NoWindowContext 

A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.

◆ Hint

enum Glfw3.Glfw.Hint
strong

These hints are set to their default values each time the library is initialized with Init, can be set individually with WindowHint(Hint, bool) and reset all at once to their defaults with DefaultWindowHints.

Note that hints need to be set before the creation of the window and context you wish to have the specified attributes.

See also
WindowHint
Enumerator
Focused 

Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.

Resizable 

Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the SetWindowSize(Window, int, int) function. This hint is ignored for full screen windows.

Visible 

Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows.

Decorated 

Specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window may still allow the user to generate close events on some platforms. This hint is ignored for full screen windows.

AutoIconify 

Specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. This hint is ignored for windowed mode windows.

Floating 

Specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. This hint is ignored for full screen windows.

Maximized 

Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.

RedBits 

Specifies the desired bit depths of the red components of the default framebuffer. DontCare means the application has no preference.

GreenBits 

Specifies the desired bit depths of the green components of the default framebuffer. DontCare means the application has no preference.

BlueBits 

Specifies the desired bit depths of the blue components of the default framebuffer. DontCare means the application has no preference.

AlphaBits 

Specifies the desired bit depths of the alpha components of the default framebuffer. DontCare means the application has no preference.

DepthBits 

Specifies the desired bit depths of the depth components of the default framebuffer. DontCare means the application has no preference.

StencilBits 

Specifies the desired bit depths of the stencil components of the default framebuffer. DontCare means the application has no preference.

AccumRedBits 

Specifies the desired bit depths of the red components of the accumulation buffer. DontCare means the application has no preference.

Accumulation buffers are a legacy OpenGL feature and should not be used in new code.

AccumGreenBits 

Specifies the desired bit depths of the green components of the accumulation buffer. DontCare means the application has no preference.

Accumulation buffers are a legacy OpenGL feature and should not be used in new code.

AccumBlueBits 

Specifies the desired bit depths of the blue components of the accumulation buffer. DontCare means the application has no preference.

Accumulation buffers are a legacy OpenGL feature and should not be used in new code.

AccumAlphaBits 

Specifies the desired bit depths of the alpha components of the accumulation buffer. DontCare means the application has no preference.

Accumulation buffers are a legacy OpenGL feature and should not be used in new code.

AuxBuffers 

Specifies the desired number of auxiliary buffers. DontCare means the application has no preference.

Auxiliary buffers are a legacy OpenGL feature and should not be used in new code.

Stereo 

Specifies whether to use stereoscopic rendering. This is a hard constraint.

Samples 

Specifies the desired number of samples to use for multisampling. Zero disables multisampling. DontCare means the application has no preference.

sRGBCapable 

Specifies whether the framebuffer should be sRGB capable. If supported, a created OpenGL context will support the GL_FRAMEBUFFER_SRGB enable, also called GL_FRAMEBUFFER_SRGB_EXT) for controlling sRGB rendering and a created OpenGL ES context will always have sRGB rendering enabled.

Doublebuffer 

Specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint.

RefreshRate 

Specifies the desired refresh rate for full screen windows. If set to DontCare, the highest available refresh rate will be used. This hint is ignored for windowed mode windows.

ClientApi 

Specifies which Glfw.ClientApi to create the context for.

ContextVersionMajor 

Specifies the client API major version that the created context must be compatible with. The exact behavior of this hint depends on the requested client API.

OpenGL: Creation will fail if the OpenGL version of the created context is less than the one requested. It is therefore perfectly safe to use the default of version 1.0 for legacy code and you will still get backwards-compatible contexts of version 3.0 and above when available. While there is no way to ask the driver for a context of the highest supported version, GLFW will attempt to provide this when you ask for a version 1.0 context, which is the default for these hints.

OpenGL ES: Creation will fail if the OpenGL ES version of the created context is less than the one requested. Additionally, OpenGL ES 1.x cannot be returned if 2.0 or later was requested, and vice versa. This is because OpenGL ES 3.x is backward compatible with 2.0, but OpenGL ES 2.0 is not backward compatible with 1.x.

See also
ContextVersionMinor
ContextVersionMinor 

Specifies the client API minor version that the created context must be compatible with. The exact behavior of this hint depends on the requested client API.

See also
ContextVersionMajor
ContextRevision 

Specifies the client API revision version that the created context must be compatible with. The exact behavior of this hint depends on the requested client API.

ContextRobustness 

Specifies the Glfw.ContextRobustness to be used by the context.

OpenglForwardCompat 

Specifies whether the OpenGL context should be forward-compatible, i.e. one where all functionality deprecated in the requested version of OpenGL is removed. This must only be used if the requested OpenGL version is 3.0 or above. If OpenGL ES is requested, this hint is ignored.

OpenglDebugContext 

Specifies whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality. If OpenGL ES is requested, this hint is ignored.

OpenglProfile 

Specifies which OpenGLProfile to create the context for. If requesting an OpenGL version below 3.2, OpenGLProfile.Any must be used. If OpenGL ES is requested, this hint is ignored.

ContextReleaseBehavior 

Specifies the Glfw.ContextReleaseBehavior to be used by the context. If the behavior is ContextReleaseBehavior.Any, the default behavior of the context creation API will be used. If the behavior is ContextReleaseBehavior.Flush, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is ContextReleaseBehavior.None, the pipeline will not be flushed on release.

ContextNoError 

Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.

ContextCreationApi 

Specifies which ContextApi to use to create the context. This is a hard constraint. If no client API is requested, this hint is ignored.

OSX: The EGL API is not available on this platform and requests to use it will fail.

Wayland, Mir: The EGL API is the native context creation API, so this hint will have no effect.

◆ WindowAttrib

Enumerator
Focused 

Indicates whether the specified window has input focus. Initial input focus is controlled by the window hint with the same name.

Iconified 

Indicates whether the specified window is iconified, whether by the user or with IconifyWindow(Window).

Maximized 

Indicates whether the specified window is maximized, whether by the user or with MaximizeWindow(Window).

Visible 

Indicates whether the specified window is visible. Window visibility can be controlled with ShowWindow(Window) and HideWindow(Window) and initial visibility is controlled by the Hint with the same name.

Resizable 

Indicates whether the specified window is resizable by the user. This is set on creation with the Hint with the same name.

Decorated 

Indicates whether the specified window has decorations such as a border, a close widget, etc. This is set on creation with the Hint with the same name.

Floating 

Indicates whether the specified window is floating, also called topmost or always-on-top. This is controlled by the Hint with the same name.

Member Function Documentation

◆ CharFunc()

delegate void Glfw3.Glfw.CharFunc ( Window  window,
uint  codepoint 
)

The function signature for Unicode character callbacks.

Parameters
windowThe window that received the event.
codepointThe Unicode code point of the character.
See also
SetCharCallback(Window, CharFunc)

◆ CharModsFunc()

delegate void Glfw3.Glfw.CharModsFunc ( Window  window,
uint  codepoint,
KeyMods  mods 
)

The function signature for Unicode character with modifiers callbacks. It is called for each input character, regardless of what modifier keys are held down.

Parameters
windowThe window that received the event.
codepointThe Unicode code point of the character.
modsBit field describing which KeyMods were held down.
See also
SetCharModsCallback(Window, CharModsFunc)

◆ CreateCursor()

static unsafe Cursor Glfw3.Glfw.CreateCursor ( Image  image,
int  xhot,
int  yhot 
)
static

Creates a new custom cursor image that can be set for a window with SetCursor(Window, Cursor). The cursor can be destroyed with DestroyCursor(Cursor). Any remaining cursors are destroyed by Terminate.

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.

Parameters
imageThe desired cursor image.
xhotThe desired x-coordinate, in pixels, of the cursor hotspot.
yhotThe desired y-coordinate, in pixels, of the cursor hotspot.
Returns
The handle of the created cursor.
See also
DestroyCursor(Cursor), CreateStandardCursor(CursorType)

◆ CreateStandardCursor()

static Cursor Glfw3.Glfw.CreateStandardCursor ( CursorType  cursor)

Returns a cursor with a standard shape, that can be set for a window with CreateCursor(Image, int, int).

Parameters
cursorOne of the standard shapes.
Returns
A new cursor ready to use.

◆ CreateWindow()

static Window Glfw3.Glfw.CreateWindow ( int  width,
int  height,
string  title,
Monitor monitor = null,
Window share = null 
)
static

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.

The created window, framebuffer and context may differ from what you requested, as not all parameters and hints are hard constraints. This includes the size of the window, especially for full screen windows. To query the actual attributes of the created window, framebuffer and context see GetWindowAttrib(Window, WindowAttrib), GetWindowSize(Window, out int, out int) and GetFramebufferSize(Window, out int, out int).

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 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.

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 Hint.Visible hint, set its position and then show 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 after creation.

The swap interval is not set during window creation and the initial value may vary depending on driver settings and defaults.

Parameters
widthThe desired width, in screen coordinates, of the window. This must be greater than zero.
heightThe desired height, in screen coordinates, of the window. This must be greater than zero.
titleThe initial, UTF-8 encoded window title.
monitorThe monitor to use for full screen mode, or null for windowed mode.
shareThe window whose context to share resources with, or null to not share resources.
Returns
The handle of the created window, or null if an error occurred.

Win32: Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.

Win32: 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, use SetWindowIcon(Window, Image).

Win32:The context to share resources with must not be current on any other thread.

OSX: 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 in the Mac Developer Library.

OSX: 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.

OSX: 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 in the Mac Developer Library.

X11: Some window managers will not respect the placement of initially hidden windows

X11: 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.

See also
DestroyWindow(Window)

◆ CursorEnterFunc()

delegate void Glfw3.Glfw.CursorEnterFunc ( Window  window,
[MarshalAs(UnmanagedType.Bool)] bool  entered 
)

The function signature for cursor enter/leave callbacks.

Parameters
windowThe window that received the event.
enteredtrue if the cursor entered the window's client area, or false if it left it.
See also
SetCursorEnterCallback(Window, CursorEnterFunc)

◆ CursorPosFunc()

delegate void Glfw3.Glfw.CursorPosFunc ( Window  window,
double  xpos,
double  ypos 
)

The function signature for cursor position callbacks.

Parameters
windowThe window that received the event.
xposThe new cursor x-coordinate, relative to the left edge of the client area.
yposThe new cursor y-coordinate, relative to the top edge of the client area.
See also
SetCursorPosCallback(Window, CursorPosFunc)

◆ DefaultWindowHints()

static void Glfw3.Glfw.DefaultWindowHints ( )

This function resets all window hints to their default values.

See also
WindowHint(Hint, bool), WindowHint(Hint, Enum), WindowHint(Hint, int)

◆ DestroyCursor()

static void Glfw3.Glfw.DestroyCursor ( Cursor  cursor)

This function destroys a cursor previously created with CreateCursor(Image, int, int). Any remaining cursors will be destroyed by Terminate.

Parameters
cursorThe cursor object to destroy.
See also
CreateCursor(Image, int, int)

◆ DestroyWindow()

static void Glfw3.Glfw.DestroyWindow ( Window  window)

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.

Parameters
windowThe window to destroy.
See also
CreateWindow(int, int, string), CreateWindow(int, int, string, Monitor, Window)

◆ DropFunc()

delegate void Glfw3.Glfw.DropFunc ( Window  window,
int  count,
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr, SizeParamIndex=1)] string []  paths 
)

Parameters
window
count
paths
See also
SetDropCallback(Window, DropFunc)

◆ ErrorFunc()

delegate void Glfw3.Glfw.ErrorFunc ( ErrorCode  error,
string  description 
)

The function signature for error callbacks.

Parameters
errorAn ErrorCode.
descriptionA UTF-8 encoded string describing the error.
See also
SetErrorCallback(ErrorFunc)

◆ ExtensionSupported()

static bool Glfw3.Glfw.ExtensionSupported ( string  extension)

This function returns whether the specified API extension is supported by the current OpenGL or 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 ErrorCode.NoCurrentContext error.

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.

Parameters
extensionThe ASCII encoded name of the extension.
Returns
true if the extension is available, or false otherwise.
See also
GetProcAddress(string)

◆ FocusWindow()

static void Glfw3.Glfw.FocusWindow ( Window  window)

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 Hint.Focused hint to disable 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.

Parameters
windowThe window to give input focus.

◆ FramebufferSizeFunc()

delegate void Glfw3.Glfw.FramebufferSizeFunc ( Window  window,
int  width,
int  height 
)

The function signature for framebuffer resize callbacks.

Parameters
windowThe window whose framebuffer was resized.
widthThe new width, in pixels, of the framebuffer.
heightThe new height, in pixels, of the framebuffer.
See also
SetFramebufferSizeCallback(Window, FramebufferSizeFunc)

◆ GetClipboardString()

static string Glfw3.Glfw.GetClipboardString ( Window  window)
static

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 ErrorCode.FormatUnavailable error is generated.

Parameters
windowThe window that will request the clipboard contents.
Returns
The contents of the clipboard as a UTF-8 encoded string, or null if an error occurred.
See also
SetClipboardString(Window, string)

◆ GetCurrentContext()

static Window Glfw3.Glfw.GetCurrentContext ( )

This function returns the window whose OpenGL or OpenGL ES context is current on the calling thread.

Returns
The window whose context is current, or Window.None if no window's context is current.
See also
MakeContextCurrent(Window)

◆ GetCursorPos()

static unsafe void Glfw3.Glfw.GetCursorPos ( Window  window,
out double  xpos,
out double  ypos 
)
static

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 CursorMode.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.

Parameters
windowThe desired window.
xposWhere to store the cursor x-coordinate, relative to the left edge of the client area.
yposWhere to store the cursor y-coordinate, relative to the to top edge of the client area.
See also
SetCursorPos(Window, double, double)

◆ GetFramebufferSize()

static unsafe void Glfw3.Glfw.GetFramebufferSize ( Window  window,
out int  width,
out int  height 
)
static

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 GetWindowSize(Window, out int, out int).

Parameters
windowThe window whose framebuffer to query.
widthWhere to store the width, in pixels, of the framebuffer.
heightWhere to store the height, in pixels, of the framebuffer.
See also
SetFramebufferSizeCallback(Window, FramebufferSizeFunc)

◆ GetGammaRamp()

static unsafe GammaRamp Glfw3.Glfw.GetGammaRamp ( Monitor  monitor)
static

This function returns the current gamma ramp of the specified monitor.

Parameters
monitorThe monitor to query.
Returns
The current gamma ramp, or null if an error occurred.

◆ GetInputMode()

static int Glfw3.Glfw.GetInputMode ( Window  window,
InputMode  mode 
)
static

This function returns the value of an input option for the specified window.

Parameters
windowThe window to query.
modeOne of InputMode.
Returns
The value of an input option for the specified window.

◆ GetJoystickAxes()

static unsafe float [] Glfw3.Glfw.GetJoystickAxes ( Joystick  joy)
static

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 JoystickPresent(Joystick) to check device presence.

Parameters
joyThe joystick to query.
Returns
An array of axis values, or null if the joystick is not present.

◆ GetJoystickButtons()

static unsafe bool [] Glfw3.Glfw.GetJoystickButtons ( Joystick  joy)
static

This function returns the state of all buttons of the specified joystick.

Querying a joystick slot with no device present is not an error, but will cause this function to return null. Call JoystickPresent(Joystick) to check device presence.

Parameters
joyThe joystick to query.
Returns
An array of button states, or null if the joystick is not present.

◆ GetJoystickName()

static string Glfw3.Glfw.GetJoystickName ( Joystick  joy)
static

This function returns the name, encoded as UTF-8, of the specified joystick.

Querying a joystick slot with no device present is not an error, but will cause this function to return null. Call JoystickPresent(Joystick) to check device presence.

Parameters
joyThe joystick to query.
Returns
The UTF-8 encoded name of the joystick, or null if the joystick is not present.

◆ GetKey()

static bool Glfw3.Glfw.GetKey ( Window  window,
int  key 
)

This function returns the last state reported for the specified key to the specified window. The returned state is one of InputState.Press or InputState.Release. The higher-level action InputState.Repeat is only reported to the key callback.

If the InputMode.StickyKeys input mode is enabled, this function returns InputState.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 are not key tokens and cannot be used with this function.

Do not use this function to implement text input.

Parameters
windowThe desired window.
keyThe desired keyboard key. KeyCode.Unknown is not a valid key for this function.
Returns
One of InputState.Press or InputState.Release.

◆ GetKeyName()

static unsafe string Glfw3.Glfw.GetKeyName ( KeyCode  key,
int  scancode 
)
static

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 KeyCode.Unknown, the scancode is used instead, otherwise the scancode is ignored. If a non-printable key or (if the key is KeyCode.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 without modification.

The printable keys are:

  • KeyCode.Apostrophe
  • KeyCode.Comma
  • KeyCode.Minus
  • KeyCode.Period
  • KeyCode.Slash
  • KeyCode.SemiColon
  • KeyCode.Equal
  • KeyCode.LeftBracket
  • KeyCode.RightBracket
  • KeyCode.Backslash
  • KeyCode.World1
  • KeyCode.World2
  • KeyCode.Alpha0 to KeyCode.Alpha9
  • KeyCode.A to KeyCode.Z
  • KeyCode.Numpad0 to KeyCode.Numpad9
  • KeyCode.NumpadDecimal
  • KeyCode.NumpadDivide
  • KeyCode.NumpadMultiply
  • KeyCode.NumpadSubtract
  • KeyCode.NumpadAdd
  • KeyCode.NumpadEqual
Parameters
keyThe key to query, or KeyCode.Unknown.
scancodeThe scancode of the key to query.
Returns
The localized name of the key, or null.

◆ GetMonitorName()

static unsafe string Glfw3.Glfw.GetMonitorName ( Monitor  monitor)
static

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.

Parameters
monitorThe monitor to query.
Returns
The UTF-8 encoded name of the monitor, or null if an error occurred.

◆ GetMonitorPhysicalSize()

static unsafe void Glfw3.Glfw.GetMonitorPhysicalSize ( Monitor  monitor,
out int  widthMM,
out int  heightMM 
)
static

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 data is incorrect or because the driver does not report it accurately.

Parameters
monitorThe monitor to query.
widthMMWhere to store the width, in millimetres, of the monitor's display area.
heightMMWhere to store the height, in millimetres, of the monitor's display area.

Win32: Calculates the returned physical size from the current resolution and system DPI instead of querying the monitor EDID data.

◆ GetMonitorPos()

static unsafe void Glfw3.Glfw.GetMonitorPos ( Monitor  monitor,
out int  xpos,
out int  ypos 
)
static

This function returns the position, in screen coordinates, of the upper-left corner of the specified monitor.

Parameters
monitorThe monitor to query.
xposWhere to store the monitor x-coordinate.
yposWhere to store the monitor y-coordinate.

◆ GetMonitors()

static unsafe Monitor [] Glfw3.Glfw.GetMonitors ( )
static

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.

Returns
An array of monitor handles, or null if no monitors were found or if an error occurred.
See also
GetPrimaryMonitor

◆ GetMouseButton()

static bool Glfw3.Glfw.GetMouseButton ( Window  window,
MouseButton  button 
)

This function returns the last state reported for the specified mouse button to the specified window. The returned state is one of InputState.Press or InputState.Release.

If the InputMode.StickyKeys input mode is enabled, this function InputState.Press the first time you call it for a mouse button that was pressed, even if that mouse button has already been released.

Parameters
windowThe desired window.
buttonThe desired mouse button.
Returns
true if the button was pressed, false otherwise.

◆ GetPrimaryMonitor()

static Monitor Glfw3.Glfw.GetPrimaryMonitor ( )

This function returns the primary monitor. This is usually the monitor where elements like the task bar or global menu bar are located.

Returns
The primary monitor, or null if no monitors were found or if an error occurred.

The primary monitor is always first in the array returned by GetMonitors.

See also
GetMonitors

◆ GetProcAddress()

static IntPtr Glfw3.Glfw.GetProcAddress ( string  procname)

This function returns the address of the specified OpenGL or OpenGL ES core or extension function, if it is supported by the current context.

A context must be current on the calling thread. Calling this function without a current context will cause a ErrorCode.NoCurrentContext error.

Parameters
procnameThe ASCII encoded name of the function.
Returns
The address of the function, or null if an error occurred.

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.

See also
ExtensionSupported(string)

◆ GetTime()

static double Glfw3.Glfw.GetTime ( )

This function returns the value of the GLFW timer. Unless the timer has been set using SetTime(double), the timer measures time elapsed since GLFW 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.

Returns
The current value, in seconds, or zero if an error occurred.

◆ GetTimerFrequency()

static ulong Glfw3.Glfw.GetTimerFrequency ( )

This function returns the frequency, in Hz, of the raw timer.

Returns
The frequency of the timer, in Hz, or zero if an error occurred
See also
GetTimerValue

◆ GetTimerValue()

static ulong Glfw3.Glfw.GetTimerValue ( )

This function returns the current value of the raw timer, measured in 1/frequency seconds. To get the frequency, call GetTimerFrequency.

Returns
The value of the timer, or zero if an error occurred.
See also
GetTimerFrequency

◆ GetVersion()

static void Glfw3.Glfw.GetVersion ( out int  major,
out int  minor,
out int  rev 
)

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.

Parameters
majorWhere to store the major version number.
minorWhere to store the minor version number.
revWhere to store the revision number.

This function may be called before Init.

See also
GetVersionString

◆ GetVersionString()

static unsafe string Glfw3.Glfw.GetVersionString ( )
static

This function returns the compile-time generated version string of the GLFW library binary. It 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 GetVersion(out int, out int, out int) function provides the version of the running library binary in numerical format.

Returns
The ASCII encoded GLFW version string.

This function may be called before Init.

See also
GetVersion(out int, out int, out int)

◆ GetVideoMode()

static VideoMode Glfw3.Glfw.GetVideoMode ( Monitor  monitor)
static

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.

Parameters
monitorThe monitor to query.
Returns
The current mode of the monitor, or null if an error occurred.
See also
GetVideoModes(Monitor)

◆ GetVideoModes()

static unsafe VideoMode [] Glfw3.Glfw.GetVideoModes ( Monitor  monitor)
static

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).

Parameters
monitorThe monitor to query.
Returns
An array of video modes, or null if an error occurred.
See also
GetVideoMode(Monitor)

◆ GetWindowAttrib()

static bool Glfw3.Glfw.GetWindowAttrib ( Window  window,
WindowAttrib  attrib 
)
static

This function returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context.

Parameters
windowThe window to query.
attribThe window attribute whose value to return.
Returns
The value of the attribute, or false if an error occurred.

Framebuffer related hints are not window attributes.

◆ GetWindowFrameSize()

static unsafe void Glfw3.Glfw.GetWindowFrameSize ( Window  window,
out int  left,
out int  top,
out int  right,
out int  bottom 
)
static

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 used to create it.

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.

Parameters
windowThe window whose frame size to query.
leftWhere to store the size, in screen coordinates, of the left edge of the window frame.
topWhere to store the size, in screen coordinates, of the top edge of the window frame.
rightWhere to store the size, in screen coordinates, of the right edge of the window frame.
bottomWhere to store the size, in screen coordinates, of the bottom edge of the window frame.

◆ GetWindowMonitor()

static Monitor Glfw3.Glfw.GetWindowMonitor ( Window  window)
static

This function returns the handle of the monitor that the specified window is in full screen on.

Parameters
windowThe window to query.
Returns
The monitor, or Monitor.None if the window is in windowed mode or an error occurred.
See also
SetWindowMonitor(Window, Monitor, int, int, int, int, int)

◆ GetWindowPos()

static unsafe void Glfw3.Glfw.GetWindowPos ( Window  window,
out int  xpos,
out int  ypos 
)
static

This function retrieves the position, in screen coordinates, of the upper-left corner of the client area of the specified window.

Parameters
windowThe window to query.
xposWhere to store the x-coordinate of the upper-left corner of the client area.
yposWhere to store the y-coordinate of the upper-left corner of the client area.
See also
SetWindowPos(Window, int, int)

◆ GetWindowSize()

static unsafe void Glfw3.Glfw.GetWindowSize ( Window  window,
out int  width,
out int  height 
)
static

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 GetFramebufferSize(Window, out int, out int).

Parameters
windowThe window whose size to retrieve.
widthWhere to store the width, in screen coordinates, of the client area.
heightWhere to store the height, in screen coordinates, of the client area.
See also
SetWindowSize(Window, int, int)

◆ GetWindowUserPointer()

static IntPtr Glfw3.Glfw.GetWindowUserPointer ( Window  window)

This function sets the user-defined pointer of the specified window. The initial value is IntPtr.Zero.

Parameters
windowThe window whose pointer to return.
Returns
The user-defined pointer of the specified window.
See also
SetWindowUserPointer(Window, IntPtr)

◆ HideWindow()

static void Glfw3.Glfw.HideWindow ( Window  window)

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.

Parameters
windowThe window to hide.
See also
ShowWindow(Window)

◆ IconifyWindow()

static void Glfw3.Glfw.IconifyWindow ( Window  window)

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.

Parameters
windowThe window to iconify.
See also
RestoreWindow(Window), MaximizeWindow(Window)

◆ Init()

static bool Glfw3.Glfw.Init ( )

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 Terminate before returning. If it succeeds, you should call Terminate before the application exits.

Additional calls to this function after successful initialization but before termination will return true immediately.

Returns
true if successful, or false if an error occurred.

OSX: This function will change the current directory of the application to the Contents/Resources subdirectory of the application's bundle, if present.

See also
Terminate

◆ JoystickFunc()

delegate void Glfw3.Glfw.JoystickFunc ( Joystick  joy,
ConnectionEvent  evt 
)

The function signature for joystick configuration callbacks.

Parameters
joyThe joystick that was connected or disconnected.
evtOne of ConnectionEvent.
See also
SetJoystickCallback(JoystickFunc)

◆ JoystickPresent()

static bool Glfw3.Glfw.JoystickPresent ( Joystick  joy)

This function returns whether the specified joystick is present.

Parameters
joyThe joystick to query.
Returns
true if the joystick is present, or false otherwise.

◆ KeyFunc()

delegate void Glfw3.Glfw.KeyFunc ( Window  window,
KeyCode  key,
int  scancode,
InputState  state,
KeyMods  mods 
)

The function signature for keyboard key callbacks.

Parameters
windowThe window that received the event.
keyThe KeyCode that was pressed or released.
scancodeThe system-specific scancode of the key.
stateOne of InputState.
modsBit field describing which KeyMods were held down.
See also
SetKeyCallback(Window, KeyFunc)

◆ MakeContextCurrent()

static void Glfw3.Glfw.MakeContextCurrent ( Window  window)

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 Hint.ContextReleaseBehavior window hint.

The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a ErrorCode.NoWindowContext error.

Parameters
windowThe window whose context to make current, or Window.None to detach the current context.
See also
GetCurrentContext

◆ MaximizeWindow()

static void Glfw3.Glfw.MaximizeWindow ( Window  window)

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.

Parameters
windowThe window to maximize.
See also
IconifyWindow(Window), RestoreWindow(Window)

◆ MonitorFunc()

delegate void Glfw3.Glfw.MonitorFunc ( Monitor  monitor,
ConnectionEvent  evt 
)

The function signature for monitor configuration callbacks.

Parameters
monitorThe monitor that was connected or disconnected.
evtOne of ConnectionEvent.
See also
SetMonitorCallback(MonitorFunc)

◆ MouseButtonFunc()

delegate void Glfw3.Glfw.MouseButtonFunc ( Window  window,
MouseButton  button,
InputState  state,
KeyMods  mods 
)

The function signature for mouse button callbacks.

Parameters
windowThe window that received the event.
buttonThe MouseButton that was pressed or released.
stateOne of InputState.Press or InputState.Release
modsBit field describing which KeyMods were held down.
See also
SetMouseButtonCallback(Window, MouseButtonFunc)

◆ PollEvents()

static void Glfw3.Glfw.PollEvents ( )

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 to redraw the contents of 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.

See also
WaitEvents, WaitEventsTimeout(double)

◆ PostEmptyEvent()

static void Glfw3.Glfw.PostEmptyEvent ( )

This function posts an empty event from the current thread to the event queue, causing WaitEvents or WaitEventsTimeout(double) to return.

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.

◆ RestoreWindow()

static void Glfw3.Glfw.RestoreWindow ( Window  window)

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.

Parameters
windowThe window to restore.
See also
IconifyWindow(Window), MaximizeWindow(Window)

◆ ScrollFunc()

delegate void Glfw3.Glfw.ScrollFunc ( Window  window,
double  xoffset,
double  yoffset 
)

The function signature for scroll callbacks.

Parameters
windowThe window that received the event.
xoffsetThe scroll offset along the x-axis.
yoffsetThe scroll offset along the y-axis.
See also
SetScrollCallback(Window, CursorPosFunc)

◆ SetCharCallback()

static void Glfw3.Glfw.SetCharCallback ( Window  window,
CharFunc  callback 
)
static

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 SetKeyCallback(Window, KeyFunc) is not. 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 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 SetCharModsCallback(Window, CharModsFunc) that receives these events.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetCharModsCallback()

static void Glfw3.Glfw.SetCharModsCallback ( Window  window,
CharModsFunc  callback 
)
static

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, use SetCharCallback(Window, CharFunc). Like the character 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 SetKeyCallback(Window, KeyFunc) instead.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetClipboardString()

static void Glfw3.Glfw.SetClipboardString ( Window  window,
string  value 
)
static

This function sets the system clipboard to the specified, UTF-8 encoded string.

Parameters
windowThe window that will own the clipboard contents.
valueA UTF-8 encoded string.
See also
GetClipboardString(Window)

◆ SetCursor()

static void Glfw3.Glfw.SetCursor ( Window  window,
Cursor  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 of the window is CursorMode.Normal.

On some platforms, the set cursor may not be visible unless the window also has input focus.

Parameters
windowThe window to set the cursor for.
cursorThe cursor to set.

◆ SetCursorEnterCallback()

static void Glfw3.Glfw.SetCursorEnterCallback ( Window  window,
CursorEnterFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetCursorPos()

static void Glfw3.Glfw.SetCursorPos ( Window  window,
double  xpos,
double  ypos 
)

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 CursorMode.Disabled cursor mode that hides the cursor, transparently re-centers it and provides unconstrained cursor motion. See SetInputMode(Window, InputMode, CursorMode) for more information.

If the cursor mode is CursorMode.Disabled then the cursor position is unconstrained and limited only by the minimum and maximum values of a double.

Parameters
windowThe desired window.
xposThe desired x-coordinate, relative to the left edge of the client area.
yposThe desired y-coordinate, relative to the top edge of the client area.
See also
GetCursorPos(Window, out double, out double)

◆ SetCursorPosCallback()

static void Glfw3.Glfw.SetCursorPosCallback ( Window  window,
CursorPosFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetDropCallback()

static void Glfw3.Glfw.SetDropCallback ( Window  window,
DropFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetErrorCallback()

static void Glfw3.Glfw.SetErrorCallback ( ErrorFunc  callback)
static

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.

Parameters
callbackThe new callback, or null to remove the currently set callback.

This function may be called before Init.

◆ SetFramebufferSizeCallback()

static void Glfw3.Glfw.SetFramebufferSizeCallback ( Window  window,
FramebufferSizeFunc  callback 
)
static

This function sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetGamma()

static void Glfw3.Glfw.SetGamma ( Monitor  monitor,
float  gamma 
)
static

This function generates a 256-element gamma ramp from the specified exponent and then calls SetGammaRamp(Monitor, GammaRamp) with it. The value must be a finite number greater than zero.

Parameters
monitorThe monitor whose gamma ramp to set.
gammaThe desired exponent.

◆ SetGammaRamp()

static unsafe void Glfw3.Glfw.SetGammaRamp ( Monitor  monitor,
GammaRamp  ramp 
)
static

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 Terminate.

Parameters
monitorThe monitor whose gamma ramp to set.
rampThe gamma ramp to use.

Gamma ramp sizes other than 256 are not supported by all platforms or graphics hardware (Win32 requires a 256 gamma ramp size).

◆ SetInputMode() [1/2]

static void Glfw3.Glfw.SetInputMode ( Window  window,
InputMode  mode,
CursorMode  value 
)
static

This function sets an input mode option for the specified window.

If the mode is InputMode.Cursor, the value must be one of the following cursor modes:

  • CursorMode.Normal makes the cursor visible and behaving normally.
  • CursorMode.Hidden makes the cursor invisible when it is over the client area of the window but does not restrict the cursor from leaving.
  • CursorMode.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 InputMode.StickyKeys, the value must be either true to enable sticky keys, or false to disable it. If sticky keys are enabled, a key press will ensure that GetKey(Window, int) returns InputState.Press 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 InputMode.StickyMouseButton, the value must be either true to enable sticky mouse buttons, or false to disable it. If sticky mouse buttons are enabled, a mouse button press will ensure that GetMouseButton(Window, int) returns InputState.Press the next time it is called even 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.

Parameters
windowThe window whose input mode to set.
modeOne of InputMode.
valueThe new value of the specified input mode.
See also
GetInputMode(Window, InputMode)

◆ SetInputMode() [2/2]

static void Glfw3.Glfw.SetInputMode ( Window  window,
InputMode  mode,
bool  value 
)
static

This function sets an input mode option for the specified window.

If the mode is InputMode.Cursor, the value must be one of the following cursor modes:

  • CursorMode.Normal makes the cursor visible and behaving normally.
  • CursorMode.Hidden makes the cursor invisible when it is over the client area of the window but does not restrict the cursor from leaving.
  • CursorMode.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 InputMode.StickyKeys, the value must be either true to enable sticky keys, or false to disable it. If sticky keys are enabled, a key press will ensure that GetKey(Window, int) returns InputState.Press 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 InputMode.StickyMouseButton, the value must be either true to enable sticky mouse buttons, or false to disable it. If sticky mouse buttons are enabled, a mouse button press will ensure that GetMouseButton(Window, int) returns InputState.Press the next time it is called even 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.

Parameters
windowThe window whose input mode to set.
modeOne of InputMode.
valueThe new value of the specified input mode.
See also
GetInputMode(Window, InputMode)

◆ SetJoystickCallback()

static void Glfw3.Glfw.SetJoystickCallback ( JoystickFunc  callback)
static

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.

Parameters
callbackThe new callback, or null to remove the currently set callback.

◆ SetKeyCallback()

static void Glfw3.Glfw.SetKeyCallback ( Window  window,
KeyFunc  callback 
)
static

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 named after their values in the standard US keyboard layout. If you want to input text, use the SetCharCallback(Window, CharFunc) instead.

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 SetWindowFocusCallback(Window, WindowFocusFunc) has been called.

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 KeyCode.Unknown, their state is not saved and so it cannot be queried with GetKey(Window, int).

Sometimes GLFW needs to generate synthetic key events, in which case the scancode may be zero.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetMonitorCallback()

static void Glfw3.Glfw.SetMonitorCallback ( MonitorFunc  callback)
static

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.

Parameters
callbackThe new callback, or null to remove the currently set callback.

◆ SetMouseButtonCallback()

static void Glfw3.Glfw.SetMouseButtonCallback ( Window  window,
MouseButtonFunc  callback 
)
static

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 SetWindowFocusCallback(Window, WindowFocusFunc) has been called.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetScrollCallback()

static void Glfw3.Glfw.SetScrollCallback ( Window  window,
ScrollFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetTime()

static void Glfw3.Glfw.SetTime ( double  time)

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.

Parameters
timeThe new value, in seconds.

The upper limit of the timer is calculated as floor((2^64 - 1) / 10^9) and is due to implementations storing nanoseconds in 64 bits. The limit may be increased in the future.

◆ SetWindowAspectRatio()

static void Glfw3.Glfw.SetWindowAspectRatio ( Window  window,
int  numer,
int  denom 
)

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 DontCare 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.

Parameters
windowThe window to set limits for.
numerThe numerator of the desired aspect ratio, or DontCare.
denomThe denominator of the desired aspect ratio, or DontCare.

If you set size limits and an aspect ratio that conflict, the results are undefined.

See also
SetWindowSizeLimits(Window, int, int, int, int)

◆ SetWindowCloseCallback()

static void Glfw3.Glfw.SetWindowCloseCallback ( Window  window,
WindowCloseFunc  callback 
)
static

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 SetWindowShouldClose(Window, bool).

The close callback is not triggered by DestroyWindow(Window).

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

OSX: Selecting Quit from the application menu will trigger the close callback for all windows.

◆ SetWindowFocusCallback()

static void Glfw3.Glfw.SetWindowFocusCallback ( Window  window,
WindowFocusFunc  callback 
)
static

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 SetKeyCallback(Window, KeyFunc) and SetMouseButtonCallback(Window, MouseButtonFunc).

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetWindowIcon() [1/2]

static void Glfw3.Glfw.SetWindowIcon ( Window  window,
Image  image 
)
static

This function sets the icon of the specified window.

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.

Parameters
windowThe window whose icon to set.
imageThe image to create the icon from.

OSX: 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 in the Mac Developer Library.

◆ SetWindowIcon() [2/2]

static unsafe void Glfw3.Glfw.SetWindowIcon ( Window  window,
Image []  images 
)
static

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.

Parameters
windowThe window whose icon to set.
imagesThe images to create the icon from.

OSX: 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 in the Mac Developer Library.

◆ SetWindowIconifyCallback()

static void Glfw3.Glfw.SetWindowIconifyCallback ( Window  window,
WindowIconifyFunc  callback 
)
static

This function sets the iconification callback of the specified window, which is called when the window is iconified or restored.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetWindowMonitor()

static void Glfw3.Glfw.SetWindowMonitor ( Window  window,
Monitor  monitor,
int  xpos,
int  ypos,
int  width,
int  height,
int  refreshRate 
)

This function sets the monitor that the window uses for full screen mode or, if the monitor is Monitor.None, 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 Monitor.None, 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 SetWindowSize(Window, int, int)"/>.

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...

Parameters
windowThe window whose monitor, size or video mode to set.
monitorThe desired monitor, or Monitor.None to set windowed mode.
xposThe desired x-coordinate of the upper-left corner of the client area.
yposThe desired y-coordinate of the upper-left corner of the client area.
widthThe desired with, in screen coordinates, of the client area or video mode.
heightThe desired height, in screen coordinates, of the client area or video mode.
refreshRateThe desired refresh rate, in Hz, of the video mode, or DontCare.
See also
GetWindowMonitor(Window), SetWindowSize(Window, int, int)

◆ SetWindowPos()

static void Glfw3.Glfw.SetWindowPos ( Window  window,
int  xpos,
int  ypos 
)

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.

Parameters
windowThe window to query.
xposThe x-coordinate of the upper-left corner of the client area.
yposThe y-coordinate of the upper-left corner of the client area.
See also
GetWindowPos(Window, out int, out int)

◆ SetWindowPosCallback()

static void Glfw3.Glfw.SetWindowPosCallback ( Window  window,
WindowPosFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetWindowRefreshCallback()

static void Glfw3.Glfw.SetWindowRefreshCallback ( Window  window,
WindowRefreshFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetWindowShouldClose()

static void Glfw3.Glfw.SetWindowShouldClose ( Window  window,
[MarshalAs(UnmanagedType.Bool)] bool  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.

Parameters
windowThe window whose flag to change.
valueThe new value.

◆ SetWindowSize()

static void Glfw3.Glfw.SetWindowSize ( Window  window,
int  width,
int  height 
)

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 glfwSetWindowMonitor.

The window manager may put limits on what sizes are allowed.GLFW cannot and should not override these limits.

Parameters
windowThe window to resize.
widthThe desired width, in screen coordinates, of the window client area.
heightThe desired height, in screen coordinates, of the window client area.
See also
GetWindowSize(Window, out int, out int), SetWindowMonitor(Window, Monitor, int, int, int, int, int)

◆ SetWindowSizeCallback()

static void Glfw3.Glfw.SetWindowSizeCallback ( Window  window,
WindowSizeFunc  callback 
)
static

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.

Parameters
windowThe window whose callback to set.
callbackThe new callback, or null to remove the currently set callback.

◆ SetWindowSizeLimits()

static void Glfw3.Glfw.SetWindowSizeLimits ( Window  window,
int  minwidth,
int  minheight,
int  maxwidth,
int  maxheight 
)

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.

Parameters
windowThe window to set limits for.
minwidthThe minimum width, in screen coordinates, of the client area, or DontCare.
minheightThe minimum height, in screen coordinates, of the client area, or DontCare.
maxwidthThe maximum width, in screen coordinates, of the client area, or DontCare.
maxheightThe maximum height, in screen coordinates, of the client area, or DontCare.

If you set size limits and an aspect ratio that conflict, the results are undefined.

See also
SetWindowAspectRatio(Window, int, int)

◆ SetWindowTitle()

static void Glfw3.Glfw.SetWindowTitle ( Window  window,
string  title 
)
static

This function sets the window title, encoded as UTF-8, of the specified window.

Parameters
windowThe window whose title to change.
titleThe UTF-8 encoded window title.

OSX: The window title will not be updated until the next time you process events.

◆ SetWindowUserPointer()

static void Glfw3.Glfw.SetWindowUserPointer ( Window  window,
IntPtr  ptr 
)

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 IntPtr.Zero.

Parameters
windowThe window whose pointer to set.
ptrThe new value.
See also
GetWindowUserPointer(Window)

◆ ShowWindow()

static void Glfw3.Glfw.ShowWindow ( Window  window)

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.

Parameters
windowThe window to make visible.
See also
HideWindow(Window)

◆ SwapBuffers()

static void Glfw3.Glfw.SwapBuffers ( Window  window)

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 ErrorCode.NoWindowContext error.

Parameters
windowThe window whose buffers to swap.

EGL: The context of the specified window must be current on the calling thread.

◆ SwapInterval()

static void Glfw3.Glfw.SwapInterval ( int  interval)

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 SwapBuffers(Window) 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 ExtensionSupported(string). 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 ErrorCode.NoCurrentContext error.

Parameters
intervalThe minimum number of screen updates to wait for until the buffers are swapped by SwapBuffers(Window).

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.

See also
SwapBuffers(Window)

◆ Terminate()

static void Glfw3.Glfw.Terminate ( )

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 Init successfully before 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 Init before it returns failure.

This function may be called before Init.

See also
Init

◆ VulkanSupported()

static bool Glfw3.Glfw.VulkanSupported ( )

This function returns whether the Vulkan loader has been found. This check is performed by Init.

Returns
true if Vulkan is available, or false otherwise.

◆ WaitEvents()

static void Glfw3.Glfw.WaitEvents ( )

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 PollEvents, 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.

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 to redraw the contents of 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.

See also
PollEvents, WaitEventsTimeout(double)

◆ WaitEventsTimeout()

static void Glfw3.Glfw.WaitEventsTimeout ( double  timeout)

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. Once one or more events are available, it behaves exactly like PollEvents, 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.

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 to redraw the contents of 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.

Parameters
timeoutThe maximum amount of time, in seconds, to wait.
See also
PollEvents, WaitEvents

◆ WindowCloseFunc()

delegate void Glfw3.Glfw.WindowCloseFunc ( Window  window)

The function signature for window close callbacks.

Parameters
windowThe window that the user attempted to close.
See also
SetWindowCloseCallback(Window, WindowCloseFunc)

◆ WindowFocusFunc()

delegate void Glfw3.Glfw.WindowFocusFunc ( Window  window,
[MarshalAs(UnmanagedType.Bool)] bool  focused 
)

The function signature for window focus/defocus callbacks.

Parameters
windowThe window that gained or lost input focus.
focusedtrue if the window was given input focus, or false if it lost it.
See also
SetWindowFocusCallback(Window, WindowFocusFunc)

◆ WindowHint() [1/3]

static void Glfw3.Glfw.WindowHint ( Hint  hint,
bool  value 
)
static

This function sets hints for the next call to CreateWindow(int, int, string). The hints, once set, retain their values until changed by a call to WindowHint(Hint, int) or DefaultWindowHints, or until the library is 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 CreateWindow(int, int, string).

Parameters
hintThe window hint to set.
valueThe new value of the window hint.
See also
DefaultWindowHints

◆ WindowHint() [2/3]

static void Glfw3.Glfw.WindowHint ( Hint  hint,
int  value 
)
static

This function sets hints for the next call to CreateWindow(int, int, string). The hints, once set, retain their values until changed by a call to WindowHint(Hint, int) or DefaultWindowHints, or until the library is 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 CreateWindow(int, int, string).

Parameters
hintThe window hint to set.
valueThe new value of the window hint.
See also
DefaultWindowHints

◆ WindowHint() [3/3]

static void Glfw3.Glfw.WindowHint ( Hint  hint,
Enum  value 
)
static

This function sets hints for the next call to CreateWindow(int, int, string). The hints, once set, retain their values until changed by a call to WindowHint(Hint, int) or DefaultWindowHints, or until the library is 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 CreateWindow(int, int, string).

Parameters
hintThe window hint to set.
valueThe new value of the window hint.
See also
DefaultWindowHints

◆ WindowIconifyFunc()

delegate void Glfw3.Glfw.WindowIconifyFunc ( Window  window,
[MarshalAs(UnmanagedType.Bool)] bool  focused 
)

The function signature for window iconify/restore callbacks.

Parameters
windowThe window that was iconified or restored.
focusedtrue if the window was iconified, or false if it was restored.
See also
SetWindowIconifyCallback(Window, WindowIconifyFunc)

◆ WindowPosFunc()

delegate void Glfw3.Glfw.WindowPosFunc ( Window  window,
int  xpos,
int  ypos 
)

The function signature for window position callbacks.

Parameters
windowThe window that was moved.
xposThe new x-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
yposThe new y-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
See also
SetWindowPosCallback(Window, WindowPosFunc)

◆ WindowRefreshFunc()

delegate void Glfw3.Glfw.WindowRefreshFunc ( Window  window)

The function signature for window content refresh callbacks.

Parameters
windowThe window whose content needs to be refreshed.
See also
SetWindowRefreshCallback(Window, WindowRefreshFunc)

◆ WindowShouldClose()

static bool Glfw3.Glfw.WindowShouldClose ( Window  window)

This function returns the value of the close flag of the specified window.

Parameters
windowThe window to query.
Returns
The value of the close flag.

◆ WindowSizeFunc()

delegate void Glfw3.Glfw.WindowSizeFunc ( Window  window,
int  width,
int  height 
)

The function signature for window resize callbacks.

Parameters
windowThe window that was resized.
widthThe new width, in screen coordinates, of the window.
heightThe new height, in screen coordinates, of the window.
See also
SetWindowSizeCallback(Window, WindowSizeFunc)

Member Data Documentation

◆ DontCare

readonly int Glfw3.Glfw.DontCare = -1
static

Adds the specified native directory path to the Path environment variable to facilitate native loading.

Parameters
nativeDirectoryThe directory that the native library is stored in.
Exceptions
DirectoryNotFoundExceptionWhen nativeDirectory is not found.

GLFW_DONT_CARE

◆ VersionMajor

readonly int Glfw3.Glfw.VersionMajor = 3
static

The major version number of the GLFW library. This is incremented when the API is changed in non-compatible ways.

◆ VersionMinor

readonly int Glfw3.Glfw.VersionMinor = 2
static

The minor version number of the GLFW library. This is incremented when features are added to the API but it remains backward-compatible.

◆ VersionRevision

readonly int Glfw3.Glfw.VersionRevision = 1
static

The revision number of the GLFW library. This is incremented when a bug fix release is made that does not contain any API changes.


The documentation for this class was generated from the following files: