Class GLFW
GLFW is a free, Open Source, multi-platform library for opening a window, creating an OpenGL context and managing input. It is easy to integrate into existing applications and does not lay claim to the main loop.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the function pointers loaded from the glfwSharedLibrary. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPixelFormat hints.static final intPixelFormat hints.static final intPixelFormat hints.static final intPixelFormat hints.static final intPixelFormat hints.static final intANGLE rendering backend init hint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intValues for theANGLE_PLATFORM_TYPEhint.static final intHint value forPLATFORMthat enables automatic platform selection.static final intstatic final intValues for theCONTEXT_RELEASE_BEHAVIORhint.static final intError codes.static final intThe regular arrow cursor shape.static final intWindow attributes.static final intPixelFormat hints.static final intPixelFormat hints.static final intWindow attributes.static final intClient API hints.static final intmacOS specific init hint.static final intSpecifies the UTF-8 encoded name to use for autosaving the window frame, or if empty disables frame autosaving for the window.static final intSpecifies whether to enable Automatic Graphics Switching, i.e.static final intmacOS specific init hint.static final intSpecifies whether to use full resolution framebuffers on Retina displays.static final intMonitor events.static final intClient API hints.static final intClient API hints.static final intClient API hints.static final intClient API hints.static final intClient API hints.static final intClient API hints.static final intClient API hints.static final intClient API hints.static final intThe crosshair cursor shape.static final intInput options.static final intCursor state.static final intCursor state.static final intCursor state.static final intCursor state.static final intError codes.static final intWindow attributes.static final intPixelFormat hints.static final intMonitor events.static final intDon't care value.static final intPixelFormat hints.static final intValues for theCONTEXT_CREATION_APIhint.static final intBoolean values.static final intError codes.static final intError codes.static final intWindow attributes.static final intWindow attributes.static final intWindow attributes.static final intError codes.static final intGamepad axes.static final intGamepad axes.static final intGamepad axes.static final intGamepad axes.static final intGamepad axes.static final intGamepad axes.static final intGamepad axes.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intGamepad buttons.static final intPixelFormat hints.static final intLegacy name for compatibility.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intJoystick hat states.static final intWindow attributes.static final intLegacy name for compatibility.static final intThe text input I-beam cursor shape.static final intWindow attributes.static final intInput options.static final intError codes.static final intError codes.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoysticks.static final intJoystick hat buttons init hint.static final intJoysticks.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intFunction keys.static final intFunction keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intFunction keys.static final intPrintable keys.static final intThe unknown key.static final intFunction keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intPrintable keys.static final intInput options.static final intValues for theCONTEXT_ROBUSTNESShint.static final intPreedit candidate init hint.static final intWindow attributes.static final intIf this bit is set one or more Alt keys were held down.static final intIf this bit is set the Caps Lock key is enabled and theLOCK_KEY_MODSinput mode is set.static final intIf this bit is set one or more Control keys were held down.static final intIf this bit is set the Num Lock key is enabled and theLOCK_KEY_MODSinput mode is set.static final intIf this bit is set one or more Shift keys were held down.static final intIf this bit is set one or more Super keys were held down.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intMouse buttons.static final intWindow attributes.static final intValues for theCONTEXT_CREATION_APIhint.static final intValues for theCLIENT_APIhint.static final intError codes.static final intError codes.static final intValues for theCONTEXT_ROBUSTNESShint.static final intValues for theCONTEXT_ROBUSTNESShint.static final intError codes.static final intThe operation-not-allowed shape.static final intError codes.static final intValues for theOPENGL_PROFILEhint.static final intValues for theCLIENT_APIhint.static final intValues for theOPENGL_PROFILEhint.static final intValues for theOPENGL_PROFILEhint.static final intClient API hints.static final intValues for theCLIENT_APIhint.static final intClient API hints.static final intClient API hints.static final intValues for theCONTEXT_CREATION_APIhint.static final intError codes.static final intPlatform selection init hint.static final intHint value forPLATFORMthat enables automatic platform selection.static final intError codes.static final intHint value forPLATFORMthat enables automatic platform selection.static final intError codes.static final intHint value forPLATFORMthat enables automatic platform selection.static final intHint value forPLATFORMthat enables automatic platform selection.static final intHint value forPLATFORMthat enables automatic platform selection.static final intThe pointing hand cursor shape.static final intWindow attributes.static final intWindow attributes.static final intThe key or button was pressed.static final intInput options.static final intPixelFormat hints.static final intPixelFormat hints.static final intThe key or button was released.static final intValues for theCONTEXT_RELEASE_BEHAVIORhint.static final intValues for theCONTEXT_RELEASE_BEHAVIORhint.static final intThe key was held down until it repeated.static final intWindow attributes.static final intThe omni-directional resize cursor/move shape.static final intThe horizontal resize/move arrow shape.static final intThe top-right to bottom-left diagonal resize/move shape.static final intThe vertical resize/move shape.static final intThe top-left to bottom-right diagonal resize/move shape.static final intPixelFormat hints.static final intClient API hints.static final intClient API hints.static final intWindow attributes.static final intPixelFormat hints.static final intPixelFormat hints.static final intPixelFormat hints.static final intInput options.static final intInput options.static final intWindow attributes.static final intBoolean values.static final intInput options.static final intThe major version number of the GLFW header.static final intThe minor version number of the GLFW header.static final intThe revision number of the GLFW header.static final intError codes.static final intWindow attributes.static final intLegacy name for compatibility.static final intAllows specification of the Waylandapp_id.static final intValues for theWAYLAND_LIBDECORhint.static final intWayland specific init hint.static final intValues for theWAYLAND_LIBDECORhint.static final intSpecifies whether to allow access to the window menu via the Alt+Space and Alt-and-then-Space keyboard shortcuts.static final intWin32 specific [window hint](@ref GLFW_WIN32_SHOWDEFAULT_hint).static final intThe desired ASCII encoded class and instance parts of the ICCCMWM_CLASSwindow property.static final intThe desired ASCII encoded class and instance parts of the ICCCMWM_CLASSwindow property.static final intX11 specific init hint.static final intX11 specific init hint. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.lwjgl.system.SharedLibraryReturns the glfwSharedLibrary.static longglfwCreateCursor(GLFWImage image, int xhot, int yhot) Creates a new custom cursor image that can be set for a window withSetCursor.static longglfwCreateStandardCursor(int shape) Returns a cursor with a standard shape, that can be set for a window withSetCursor.static longglfwCreateWindow(int width, int height, CharSequence title, long monitor, long share) Creates a window and its associated OpenGL or OpenGL ES context.static longglfwCreateWindow(int width, int height, ByteBuffer title, long monitor, long share) Creates a window and its associated OpenGL or OpenGL ES context.static voidResets all window hints to their default values.static voidglfwDestroyCursor(long cursor) Destroys a cursor previously created withCreateCursor.static voidglfwDestroyWindow(long window) Destroys the specified window and its context.static booleanglfwExtensionSupported(CharSequence extension) Returns whether the specified API extension is supported by the current OpenGL or OpenGL ES context.static booleanglfwExtensionSupported(ByteBuffer extension) Returns whether the specified API extension is supported by the current OpenGL or OpenGL ES context.static voidglfwFocusWindow(long window) Brings the specified window to front and sets input focus.static @Nullable StringglfwGetClipboardString(long window) Returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string.static longReturns the window whose OpenGL or OpenGL ES context is current on the calling thread.static voidglfwGetCursorPos(long window, double @Nullable [] xpos, double @Nullable [] ypos) Array version of:GetCursorPosstatic voidglfwGetCursorPos(long window, @Nullable DoubleBuffer xpos, @Nullable DoubleBuffer ypos) Returns the position of the cursor, in screen coordinates, relative to the upper-left corner of the content area of the specified window.static intglfwGetError(@Nullable org.lwjgl.PointerBuffer description) Returns and clears the last error for the calling thread.static voidglfwGetFramebufferSize(long window, int @Nullable [] width, int @Nullable [] height) Array version of:GetFramebufferSizestatic voidglfwGetFramebufferSize(long window, @Nullable IntBuffer width, @Nullable IntBuffer height) Retrieves the size, in pixels, of the framebuffer of the specified window.static @Nullable StringglfwGetGamepadName(int jid) Returns the human-readable name of the gamepad from the gamepad mapping assigned to the specified joystick.static booleanglfwGetGamepadState(int jid, GLFWGamepadState state) Retrieves the state of the specified joystick remapped to an Xbox-like gamepad.static @Nullable GLFWGammaRampglfwGetGammaRamp(long monitor) Returns the current gamma ramp of the specified monitor.static intglfwGetInputMode(long window, int mode) Returns the value of an input option for the specified window.static @Nullable FloatBufferglfwGetJoystickAxes(int jid) Returns the values of all axes of the specified joystick.static @Nullable ByteBufferglfwGetJoystickButtons(int jid) Returns the state of all buttons of the specified joystick.static @Nullable StringglfwGetJoystickGUID(int jid) Returns the SDL compatible GUID, as a UTF-8 encoded hexadecimal string, of the specified joystick.static @Nullable ByteBufferglfwGetJoystickHats(int jid) Returns the state of all hats of the specified joystick.static @Nullable StringglfwGetJoystickName(int jid) Returns the name, encoded as UTF-8, of the specified joystick.static longglfwGetJoystickUserPointer(int jid) Returns the user pointer of the specified joystick.static intglfwGetKey(long window, int key) Returns the last state reported for the specified key to the specified window.static @Nullable StringglfwGetKeyName(int key, int scancode) Returns the layout-specific name of the specified printable key.static intglfwGetKeyScancode(int key) Returns the platform dependent scancode of the specified key.static voidglfwGetMonitorContentScale(long monitor, float @Nullable [] xscale, float @Nullable [] yscale) Array version of:GetMonitorContentScalestatic voidglfwGetMonitorContentScale(long monitor, @Nullable FloatBuffer xscale, @Nullable FloatBuffer yscale) Retrieves the content scale for the specified monitor.static @Nullable StringglfwGetMonitorName(long monitor) Returns a human-readable name, encoded as UTF-8, of the specified monitor.static voidglfwGetMonitorPhysicalSize(long monitor, int @Nullable [] widthMM, int @Nullable [] heightMM) Array version of:GetMonitorPhysicalSizestatic voidglfwGetMonitorPhysicalSize(long monitor, @Nullable IntBuffer widthMM, @Nullable IntBuffer heightMM) Returns the size, in millimetres, of the display area of the specified monitor.static voidglfwGetMonitorPos(long monitor, int @Nullable [] xpos, int @Nullable [] ypos) Array version of:GetMonitorPosstatic voidglfwGetMonitorPos(long monitor, @Nullable IntBuffer xpos, @Nullable IntBuffer ypos) Returns the position, in screen coordinates, of the upper-left corner of the specified monitor.static @Nullable org.lwjgl.PointerBufferReturns an array of handles for all currently connected monitors.static longglfwGetMonitorUserPointer(long monitor) Returns the user pointer of the specified monitor.static voidglfwGetMonitorWorkarea(long monitor, int @Nullable [] xpos, int @Nullable [] ypos, int @Nullable [] width, int @Nullable [] height) Array version of:GetMonitorWorkareastatic voidglfwGetMonitorWorkarea(long monitor, @Nullable IntBuffer xpos, @Nullable IntBuffer ypos, @Nullable IntBuffer width, @Nullable IntBuffer height) Retrieves the work area of the monitor.static intglfwGetMouseButton(long window, int button) Returns the last state reported for the specified mouse button to the specified window.static intReturns the currently selected platform.static @Nullable IntBufferglfwGetPreeditCandidate(long window, int index) Returns the text and the text-count of the preedit candidate.static voidglfwGetPreeditCursorRectangle(long window, int @Nullable [] x, int @Nullable [] y, int @Nullable [] w, int @Nullable [] h) Array version of:GetPreeditCursorRectanglestatic voidglfwGetPreeditCursorRectangle(long window, @Nullable IntBuffer x, @Nullable IntBuffer y, @Nullable IntBuffer w, @Nullable IntBuffer h) Retrieves the area of the preedit text cursor.static longReturns the primary monitor.static longglfwGetProcAddress(CharSequence procname) Returns the address of the specified OpenGL or OpenGL ES core or extension function, if it is supported by the current context.static longglfwGetProcAddress(ByteBuffer procname) Returns the address of the specified OpenGL or OpenGL ES core or extension function, if it is supported by the current context.static doubleReturns the value of the GLFW timer.static longReturns the frequency, in Hz, of the raw timer.static longReturns the current value of the raw timer.static voidglfwGetVersion(int @Nullable [] major, int @Nullable [] minor, int @Nullable [] rev) Array version of:GetVersionstatic voidglfwGetVersion(@Nullable IntBuffer major, @Nullable IntBuffer minor, @Nullable IntBuffer rev) Retrieves the major, minor and revision numbers of the GLFW library.static StringReturns the compile-time generated version string of the GLFW library binary.static @Nullable GLFWVidModeglfwGetVideoMode(long monitor) Returns the current video mode of the specified monitor.static @Nullable GLFWVidMode.BufferglfwGetVideoModes(long monitor) Returns an array of all video modes supported by the specified monitor.static intglfwGetWindowAttrib(long window, int attrib) Returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context.static voidglfwGetWindowContentScale(long window, float @Nullable [] xscale, float @Nullable [] yscale) Array version of:GetWindowContentScalestatic voidglfwGetWindowContentScale(long window, @Nullable FloatBuffer xscale, @Nullable FloatBuffer yscale) Retrieves the content scale for the specified window.static voidglfwGetWindowFrameSize(long window, int @Nullable [] left, int @Nullable [] top, int @Nullable [] right, int @Nullable [] bottom) Array version of:GetWindowFrameSizestatic voidglfwGetWindowFrameSize(long window, @Nullable IntBuffer left, @Nullable IntBuffer top, @Nullable IntBuffer right, @Nullable IntBuffer bottom) Retrieves the size, in screen coordinates, of each edge of the frame of the specified window.static longglfwGetWindowMonitor(long window) Returns the handle of the monitor that the specified window is in full screen on.static floatglfwGetWindowOpacity(long window) Returns the opacity of the whole window.static voidglfwGetWindowPos(long window, int @Nullable [] xpos, int @Nullable [] ypos) Array version of:GetWindowPosstatic voidglfwGetWindowPos(long window, @Nullable IntBuffer xpos, @Nullable IntBuffer ypos) Retrieves the position, in screen coordinates, of the upper-left corner of the content area of the specified window.static voidglfwGetWindowSize(long window, int @Nullable [] width, int @Nullable [] height) Array version of:GetWindowSizestatic voidglfwGetWindowSize(long window, @Nullable IntBuffer width, @Nullable IntBuffer height) Retrieves the size, in screen coordinates, of the content area of the specified window.static @Nullable StringglfwGetWindowTitle(long window) Returns the title of the specified window.static longglfwGetWindowUserPointer(long window) Returns the current value of the user-defined pointer of the specified window.static voidglfwHideWindow(long window) Hides the specified window, if it was previously visible.static voidglfwIconifyWindow(long window) Iconifies (minimizes) the specified window if it was previously restored.static booleanglfwInit()Initializes the GLFW library.static voidglfwInitAllocator(@Nullable GLFWAllocator allocator) Sets the init allocator to the desired value.static voidglfwInitHint(int hint, int value) Sets hints for the next initialization of GLFW.static booleanglfwJoystickIsGamepad(int jid) Returns whether the specified joystick is both present and has a gamepad mapping.static booleanglfwJoystickPresent(int jid) Returns whether the specified joystick is present.static voidglfwMakeContextCurrent(long window) Makes the OpenGL or OpenGL ES context of the specified window current on the calling thread.static voidglfwMaximizeWindow(long window) Maximizes the specified window if it was previously not maximized.static booleanglfwPlatformSupported(int platform) Returns whether the library includes support for the specified platform.static voidProcesses all pending events.static voidPosts an empty event from the current thread to the main thread event queue, causingWaitEventsorWaitEventsTimeoutto return.static booleanReturns whether raw mouse motion is supported.static voidglfwRequestWindowAttention(long window) Requests user attention to the specified window.static voidglfwResetPreeditText(long window) Resets IME's preedit text.static voidglfwRestoreWindow(long window) Restores the specified window if it was previously iconified (minimized) or maximized.static @Nullable GLFWCharCallbackglfwSetCharCallback(long window, @Nullable GLFWCharCallbackI cbfun) Sets the character callback of the specified window, which is called when a Unicode character is input.static @Nullable GLFWCharModsCallbackglfwSetCharModsCallback(long window, @Nullable GLFWCharModsCallbackI cbfun) 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.static voidglfwSetClipboardString(long window, CharSequence string) Sets the system clipboard to the specified, UTF-8 encoded string.static voidglfwSetClipboardString(long window, ByteBuffer string) Sets the system clipboard to the specified, UTF-8 encoded string.static voidglfwSetCursor(long window, long cursor) Sets the cursor image to be used when the cursor is over the content area of the specified window.static @Nullable GLFWCursorEnterCallbackglfwSetCursorEnterCallback(long window, @Nullable GLFWCursorEnterCallbackI cbfun) Sets the cursor boundary crossing callback of the specified window, which is called when the cursor enters or leaves the content area of the window.static voidglfwSetCursorPos(long window, double xpos, double ypos) Sets the position, in screen coordinates, of the cursor relative to the upper-left corner of the content area of the specified window.static @Nullable GLFWCursorPosCallbackglfwSetCursorPosCallback(long window, @Nullable GLFWCursorPosCallbackI cbfun) Sets the cursor position callback of the specified window, which is called when the cursor is moved.static @Nullable GLFWDropCallbackglfwSetDropCallback(long window, @Nullable GLFWDropCallbackI cbfun) Sets the file drop callback of the specified window, which is called when one or more dragged files are dropped on the window.static @Nullable GLFWErrorCallbackglfwSetErrorCallback(@Nullable GLFWErrorCallbackI cbfun) Sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.static @Nullable GLFWFramebufferSizeCallbackglfwSetFramebufferSizeCallback(long window, @Nullable GLFWFramebufferSizeCallbackI cbfun) Sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized.static voidglfwSetGamma(long monitor, float gamma) Generates a gamma ramp and sets it for the specified monitor.static voidglfwSetGammaRamp(long monitor, GLFWGammaRamp ramp) Sets the current gamma ramp for the specified monitor.static @Nullable GLFWIMEStatusCallbackglfwSetIMEStatusCallback(long window, @Nullable GLFWIMEStatusCallbackI cbfun) Sets the IME status change callback of the specified window, which is called when an IME is switched on and off.static voidglfwSetInputMode(long window, int mode, int value) Sets an input option for the specified window.static @Nullable GLFWJoystickCallbackglfwSetJoystickCallback(@Nullable GLFWJoystickCallbackI cbfun) Sets the joystick configuration callback, or removes the currently set callback.static voidglfwSetJoystickUserPointer(int jid, long pointer) Sets the user pointer of the specified joystick.static @Nullable GLFWKeyCallbackglfwSetKeyCallback(long window, @Nullable GLFWKeyCallbackI cbfun) Sets the key callback of the specified window, which is called when a key is pressed, repeated or released.static @Nullable GLFWMonitorCallbackglfwSetMonitorCallback(@Nullable GLFWMonitorCallbackI cbfun) Sets the monitor configuration callback, or removes the currently set callback.static voidglfwSetMonitorUserPointer(long monitor, long pointer) Sets the user pointer of the specified monitor.static @Nullable GLFWMouseButtonCallbackglfwSetMouseButtonCallback(long window, @Nullable GLFWMouseButtonCallbackI cbfun) Sets the mouse button callback of the specified window, which is called when a mouse button is pressed or released.static @Nullable GLFWPreeditCallbackglfwSetPreeditCallback(long window, @Nullable GLFWPreeditCallbackI cbfun) Sets the preedit callback of the specified window, which is called when an IME is processing text before committed.static @Nullable GLFWPreeditCandidateCallbackglfwSetPreeditCandidateCallback(long window, @Nullable GLFWPreeditCandidateCallbackI cbfun) Sets the preedit candidate change callback of the specified window, which is called when the candidates are updated and can be used to display them by the application side.static voidglfwSetPreeditCursorRectangle(long window, int x, int y, int w, int h) Sets the area of the preedit text cursor.static @Nullable GLFWScrollCallbackglfwSetScrollCallback(long window, @Nullable GLFWScrollCallbackI cbfun) Sets the scroll callback of the specified window, which is called when a scrolling device is used.static voidglfwSetTime(double time) Sets the value of the GLFW timer.static voidglfwSetWindowAspectRatio(long window, int numer, int denom) Sets the required aspect ratio of the content area of the specified window.static voidglfwSetWindowAttrib(long window, int attrib, int value) Sets an attribute of the specified window.static @Nullable GLFWWindowCloseCallbackglfwSetWindowCloseCallback(long window, @Nullable GLFWWindowCloseCallbackI cbfun) 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.static @Nullable GLFWWindowContentScaleCallbackglfwSetWindowContentScaleCallback(long window, @Nullable GLFWWindowContentScaleCallbackI cbfun) Sets the window content scale callback for the specified window, which is called when the content scale of the specified window changes.static @Nullable GLFWWindowFocusCallbackglfwSetWindowFocusCallback(long window, @Nullable GLFWWindowFocusCallbackI cbfun) Sets the focus callback of the specified window, which is called when the window gains or loses input focus.static voidglfwSetWindowIcon(long window, @Nullable GLFWImage.Buffer images) Sets the icon for the specified window.static @Nullable GLFWWindowIconifyCallbackglfwSetWindowIconifyCallback(long window, @Nullable GLFWWindowIconifyCallbackI cbfun) Sets the iconification callback of the specified window, which is called when the window is iconified or restored.static @Nullable GLFWWindowMaximizeCallbackglfwSetWindowMaximizeCallback(long window, @Nullable GLFWWindowMaximizeCallbackI cbfun) Sets the maximization callback of the specified window, which is called when the window is maximized or restored.static voidglfwSetWindowMonitor(long window, long monitor, int xpos, int ypos, int width, int height, int refreshRate) Sets the mode, monitor, video mode and placement of a window.static voidglfwSetWindowOpacity(long window, float opacity) Sets the opacity of the whole window.static voidglfwSetWindowPos(long window, int xpos, int ypos) Sets the position, in screen coordinates, of the upper-left corner of the content area of the specified windowed mode window.static @Nullable GLFWWindowPosCallbackglfwSetWindowPosCallback(long window, @Nullable GLFWWindowPosCallbackI cbfun) Sets the position callback of the specified window, which is called when the window is moved.static @Nullable GLFWWindowRefreshCallbackglfwSetWindowRefreshCallback(long window, @Nullable GLFWWindowRefreshCallbackI cbfun) Sets the refresh callback of the specified window, which is called when the content area of the window needs to be redrawn, for example if the window has been exposed after having been covered by another window.static voidglfwSetWindowShouldClose(long window, boolean value) Sets the value of the close flag of the specified window.static voidglfwSetWindowSize(long window, int width, int height) Sets the size, in pixels, of the content area of the specified window.static @Nullable GLFWWindowSizeCallbackglfwSetWindowSizeCallback(long window, @Nullable GLFWWindowSizeCallbackI cbfun) Sets the size callback of the specified window, which is called when the window is resized.static voidglfwSetWindowSizeLimits(long window, int minwidth, int minheight, int maxwidth, int maxheight) Sets the size limits of the content area of the specified window.static voidglfwSetWindowTitle(long window, CharSequence title) Sets the window title, encoded as UTF-8, of the specified window.static voidglfwSetWindowTitle(long window, ByteBuffer title) Sets the window title, encoded as UTF-8, of the specified window.static voidglfwSetWindowUserPointer(long window, long pointer) Sets the user-defined pointer of the specified window.static voidglfwShowWindow(long window) Makes the specified window visible if it was previously hidden.static voidglfwSwapBuffers(long window) Swaps the front and back buffers of the specified window when rendering with OpenGL or OpenGL ES.static voidglfwSwapInterval(int interval) Sets the swap interval for the current OpenGL or OpenGL ES context, i.e.static voidTerminates the GLFW library.static booleanglfwUpdateGamepadMappings(ByteBuffer string) Adds the specified SDL_GameControllerDB gamepad mappings.static voidWaits until events are queued and processes them.static voidglfwWaitEventsTimeout(double timeout) Waits with timeout until events are queued and processes them.static voidglfwWindowHint(int hint, int value) Sets hints for the next call toCreateWindow.static voidglfwWindowHintString(int hint, CharSequence value) Sets the specified window hint to the desired value.static voidglfwWindowHintString(int hint, ByteBuffer value) Sets the specified window hint to the desired value.static booleanglfwWindowShouldClose(long window) Returns the value of the close flag of the specified window.static longnglfwCreateCursor(long image, int xhot, int yhot) Unsafe version of:CreateCursorstatic longnglfwCreateWindow(int width, int height, long title, long monitor, long share) Unsafe version of:CreateWindowstatic intnglfwExtensionSupported(long extension) Unsafe version of:ExtensionSupportedstatic longnglfwGetClipboardString(long window) Unsafe version of:GetClipboardStringstatic voidnglfwGetCursorPos(long window, long xpos, long ypos) Unsafe version of:GetCursorPosstatic intnglfwGetError(long description) Unsafe version of:GetErrorstatic voidnglfwGetFramebufferSize(long window, long width, long height) Unsafe version of:GetFramebufferSizestatic longnglfwGetGamepadName(int jid) Unsafe version of:GetGamepadNamestatic intnglfwGetGamepadState(int jid, long state) Unsafe version of:GetGamepadStatestatic longnglfwGetGammaRamp(long monitor) Unsafe version of:GetGammaRampstatic longnglfwGetJoystickAxes(int jid, long count) Unsafe version of:GetJoystickAxesstatic longnglfwGetJoystickButtons(int jid, long count) Unsafe version of:GetJoystickButtonsstatic longnglfwGetJoystickGUID(int jid) Unsafe version of:GetJoystickGUIDstatic longnglfwGetJoystickHats(int jid, long count) Unsafe version of:GetJoystickHatsstatic longnglfwGetJoystickName(int jid) Unsafe version of:GetJoystickNamestatic longnglfwGetKeyName(int key, int scancode) Unsafe version of:GetKeyNamestatic voidnglfwGetMonitorContentScale(long monitor, long xscale, long yscale) Unsafe version of:GetMonitorContentScalestatic longnglfwGetMonitorName(long monitor) Unsafe version of:GetMonitorNamestatic voidnglfwGetMonitorPhysicalSize(long monitor, long widthMM, long heightMM) Unsafe version of:GetMonitorPhysicalSizestatic voidnglfwGetMonitorPos(long monitor, long xpos, long ypos) Unsafe version of:GetMonitorPosstatic longnglfwGetMonitors(long count) Unsafe version of:GetMonitorsstatic voidnglfwGetMonitorWorkarea(long monitor, long xpos, long ypos, long width, long height) Unsafe version of:GetMonitorWorkareastatic longnglfwGetPreeditCandidate(long window, int index, long textCount) Unsafe version of:GetPreeditCandidatestatic voidnglfwGetPreeditCursorRectangle(long window, long x, long y, long w, long h) Unsafe version of:GetPreeditCursorRectanglestatic longnglfwGetProcAddress(long procname) Unsafe version of:GetProcAddressstatic voidnglfwGetVersion(long major, long minor, long rev) Unsafe version of:GetVersionstatic longUnsafe version of:GetVersionStringstatic longnglfwGetVideoMode(long monitor) Unsafe version of:GetVideoModestatic longnglfwGetVideoModes(long monitor, long count) Unsafe version of:GetVideoModesstatic voidnglfwGetWindowContentScale(long window, long xscale, long yscale) Unsafe version of:GetWindowContentScalestatic voidnglfwGetWindowFrameSize(long window, long left, long top, long right, long bottom) Unsafe version of:GetWindowFrameSizestatic voidnglfwGetWindowPos(long window, long xpos, long ypos) Unsafe version of:GetWindowPosstatic voidnglfwGetWindowSize(long window, long width, long height) Unsafe version of:GetWindowSizestatic longnglfwGetWindowTitle(long window) Unsafe version of:GetWindowTitlestatic voidnglfwInitAllocator(long allocator) Unsafe version of:InitAllocatorstatic longnglfwSetCharCallback(long window, long cbfun) Unsafe version of:SetCharCallbackstatic longnglfwSetCharModsCallback(long window, long cbfun) Unsafe version of:SetCharModsCallbackstatic voidnglfwSetClipboardString(long window, long string) Unsafe version of:SetClipboardStringstatic longnglfwSetCursorEnterCallback(long window, long cbfun) Unsafe version of:SetCursorEnterCallbackstatic longnglfwSetCursorPosCallback(long window, long cbfun) Unsafe version of:SetCursorPosCallbackstatic longnglfwSetDropCallback(long window, long cbfun) Unsafe version of:SetDropCallbackstatic longnglfwSetErrorCallback(long cbfun) Unsafe version of:SetErrorCallbackstatic longnglfwSetFramebufferSizeCallback(long window, long cbfun) Unsafe version of:SetFramebufferSizeCallbackstatic voidnglfwSetGammaRamp(long monitor, long ramp) Unsafe version of:SetGammaRampstatic longnglfwSetIMEStatusCallback(long window, long cbfun) Unsafe version of:SetIMEStatusCallbackstatic longnglfwSetJoystickCallback(long cbfun) Unsafe version of:SetJoystickCallbackstatic longnglfwSetKeyCallback(long window, long cbfun) Unsafe version of:SetKeyCallbackstatic longnglfwSetMonitorCallback(long cbfun) Unsafe version of:SetMonitorCallbackstatic longnglfwSetMouseButtonCallback(long window, long cbfun) Unsafe version of:SetMouseButtonCallbackstatic longnglfwSetPreeditCallback(long window, long cbfun) Unsafe version of:SetPreeditCallbackstatic longnglfwSetPreeditCandidateCallback(long window, long cbfun) Unsafe version of:SetPreeditCandidateCallbackstatic longnglfwSetScrollCallback(long window, long cbfun) Unsafe version of:SetScrollCallbackstatic longnglfwSetWindowCloseCallback(long window, long cbfun) Unsafe version of:SetWindowCloseCallbackstatic longnglfwSetWindowContentScaleCallback(long window, long cbfun) Unsafe version of:SetWindowContentScaleCallbackstatic longnglfwSetWindowFocusCallback(long window, long cbfun) Unsafe version of:SetWindowFocusCallbackstatic voidnglfwSetWindowIcon(long window, int count, long images) Unsafe version of:SetWindowIconstatic longnglfwSetWindowIconifyCallback(long window, long cbfun) Unsafe version of:SetWindowIconifyCallbackstatic longnglfwSetWindowMaximizeCallback(long window, long cbfun) Unsafe version of:SetWindowMaximizeCallbackstatic longnglfwSetWindowPosCallback(long window, long cbfun) Unsafe version of:SetWindowPosCallbackstatic longnglfwSetWindowRefreshCallback(long window, long cbfun) Unsafe version of:SetWindowRefreshCallbackstatic longnglfwSetWindowSizeCallback(long window, long cbfun) Unsafe version of:SetWindowSizeCallbackstatic voidnglfwSetWindowTitle(long window, long title) Unsafe version of:SetWindowTitlestatic intnglfwUpdateGamepadMappings(long string) Unsafe version of:UpdateGamepadMappingsstatic voidnglfwWindowHintString(int hint, long value) Unsafe version of:WindowHintString
-
Field Details
-
GLFW_VERSION_MAJOR
public static final int GLFW_VERSION_MAJORThe major version number of the GLFW header.This is incremented when the API is changed in non-compatible ways.
- See Also:
-
GLFW_VERSION_MINOR
public static final int GLFW_VERSION_MINORThe minor version number of the GLFW header.This is incremented when features are added to the API but it remains backward-compatible.
- See Also:
-
GLFW_VERSION_REVISION
public static final int GLFW_VERSION_REVISIONThe revision number of the GLFW header.This is incremented when a bug fix release is made that does not contain any API changes.
- See Also:
-
GLFW_TRUE
public static final int GLFW_TRUEBoolean values.- See Also:
-
GLFW_FALSE
public static final int GLFW_FALSEBoolean values.- See Also:
-
GLFW_RELEASE
public static final int GLFW_RELEASEThe key or button was released.- See Also:
-
GLFW_PRESS
public static final int GLFW_PRESSThe key or button was pressed.- See Also:
-
GLFW_REPEAT
public static final int GLFW_REPEATThe key was held down until it repeated.- See Also:
-
GLFW_HAT_CENTERED
public static final int GLFW_HAT_CENTEREDJoystick hat states.- See Also:
-
GLFW_HAT_UP
public static final int GLFW_HAT_UPJoystick hat states.- See Also:
-
GLFW_HAT_RIGHT
public static final int GLFW_HAT_RIGHTJoystick hat states.- See Also:
-
GLFW_HAT_DOWN
public static final int GLFW_HAT_DOWNJoystick hat states.- See Also:
-
GLFW_HAT_LEFT
public static final int GLFW_HAT_LEFTJoystick hat states.- See Also:
-
GLFW_HAT_RIGHT_UP
public static final int GLFW_HAT_RIGHT_UPJoystick hat states.- See Also:
-
GLFW_HAT_RIGHT_DOWN
public static final int GLFW_HAT_RIGHT_DOWNJoystick hat states.- See Also:
-
GLFW_HAT_LEFT_UP
public static final int GLFW_HAT_LEFT_UPJoystick hat states.- See Also:
-
GLFW_HAT_LEFT_DOWN
public static final int GLFW_HAT_LEFT_DOWNJoystick hat states.- See Also:
-
GLFW_KEY_UNKNOWN
public static final int GLFW_KEY_UNKNOWNThe unknown key.- See Also:
-
GLFW_KEY_SPACE
public static final int GLFW_KEY_SPACEPrintable keys.- See Also:
-
GLFW_KEY_APOSTROPHE
public static final int GLFW_KEY_APOSTROPHEPrintable keys.- See Also:
-
GLFW_KEY_COMMA
public static final int GLFW_KEY_COMMAPrintable keys.- See Also:
-
GLFW_KEY_MINUS
public static final int GLFW_KEY_MINUSPrintable keys.- See Also:
-
GLFW_KEY_PERIOD
public static final int GLFW_KEY_PERIODPrintable keys.- See Also:
-
GLFW_KEY_SLASH
public static final int GLFW_KEY_SLASHPrintable keys.- See Also:
-
GLFW_KEY_0
public static final int GLFW_KEY_0Printable keys.- See Also:
-
GLFW_KEY_1
public static final int GLFW_KEY_1Printable keys.- See Also:
-
GLFW_KEY_2
public static final int GLFW_KEY_2Printable keys.- See Also:
-
GLFW_KEY_3
public static final int GLFW_KEY_3Printable keys.- See Also:
-
GLFW_KEY_4
public static final int GLFW_KEY_4Printable keys.- See Also:
-
GLFW_KEY_5
public static final int GLFW_KEY_5Printable keys.- See Also:
-
GLFW_KEY_6
public static final int GLFW_KEY_6Printable keys.- See Also:
-
GLFW_KEY_7
public static final int GLFW_KEY_7Printable keys.- See Also:
-
GLFW_KEY_8
public static final int GLFW_KEY_8Printable keys.- See Also:
-
GLFW_KEY_9
public static final int GLFW_KEY_9Printable keys.- See Also:
-
GLFW_KEY_SEMICOLON
public static final int GLFW_KEY_SEMICOLONPrintable keys.- See Also:
-
GLFW_KEY_EQUAL
public static final int GLFW_KEY_EQUALPrintable keys.- See Also:
-
GLFW_KEY_A
public static final int GLFW_KEY_APrintable keys.- See Also:
-
GLFW_KEY_B
public static final int GLFW_KEY_BPrintable keys.- See Also:
-
GLFW_KEY_C
public static final int GLFW_KEY_CPrintable keys.- See Also:
-
GLFW_KEY_D
public static final int GLFW_KEY_DPrintable keys.- See Also:
-
GLFW_KEY_E
public static final int GLFW_KEY_EPrintable keys.- See Also:
-
GLFW_KEY_F
public static final int GLFW_KEY_FPrintable keys.- See Also:
-
GLFW_KEY_G
public static final int GLFW_KEY_GPrintable keys.- See Also:
-
GLFW_KEY_H
public static final int GLFW_KEY_HPrintable keys.- See Also:
-
GLFW_KEY_I
public static final int GLFW_KEY_IPrintable keys.- See Also:
-
GLFW_KEY_J
public static final int GLFW_KEY_JPrintable keys.- See Also:
-
GLFW_KEY_K
public static final int GLFW_KEY_KPrintable keys.- See Also:
-
GLFW_KEY_L
public static final int GLFW_KEY_LPrintable keys.- See Also:
-
GLFW_KEY_M
public static final int GLFW_KEY_MPrintable keys.- See Also:
-
GLFW_KEY_N
public static final int GLFW_KEY_NPrintable keys.- See Also:
-
GLFW_KEY_O
public static final int GLFW_KEY_OPrintable keys.- See Also:
-
GLFW_KEY_P
public static final int GLFW_KEY_PPrintable keys.- See Also:
-
GLFW_KEY_Q
public static final int GLFW_KEY_QPrintable keys.- See Also:
-
GLFW_KEY_R
public static final int GLFW_KEY_RPrintable keys.- See Also:
-
GLFW_KEY_S
public static final int GLFW_KEY_SPrintable keys.- See Also:
-
GLFW_KEY_T
public static final int GLFW_KEY_TPrintable keys.- See Also:
-
GLFW_KEY_U
public static final int GLFW_KEY_UPrintable keys.- See Also:
-
GLFW_KEY_V
public static final int GLFW_KEY_VPrintable keys.- See Also:
-
GLFW_KEY_W
public static final int GLFW_KEY_WPrintable keys.- See Also:
-
GLFW_KEY_X
public static final int GLFW_KEY_XPrintable keys.- See Also:
-
GLFW_KEY_Y
public static final int GLFW_KEY_YPrintable keys.- See Also:
-
GLFW_KEY_Z
public static final int GLFW_KEY_ZPrintable keys.- See Also:
-
GLFW_KEY_LEFT_BRACKET
public static final int GLFW_KEY_LEFT_BRACKETPrintable keys.- See Also:
-
GLFW_KEY_BACKSLASH
public static final int GLFW_KEY_BACKSLASHPrintable keys.- See Also:
-
GLFW_KEY_RIGHT_BRACKET
public static final int GLFW_KEY_RIGHT_BRACKETPrintable keys.- See Also:
-
GLFW_KEY_GRAVE_ACCENT
public static final int GLFW_KEY_GRAVE_ACCENTPrintable keys.- See Also:
-
GLFW_KEY_WORLD_1
public static final int GLFW_KEY_WORLD_1Printable keys.- See Also:
-
GLFW_KEY_WORLD_2
public static final int GLFW_KEY_WORLD_2Printable keys.- See Also:
-
GLFW_KEY_ESCAPE
public static final int GLFW_KEY_ESCAPEFunction keys.- See Also:
-
GLFW_KEY_ENTER
public static final int GLFW_KEY_ENTERFunction keys.- See Also:
-
GLFW_KEY_TAB
public static final int GLFW_KEY_TABFunction keys.- See Also:
-
GLFW_KEY_BACKSPACE
public static final int GLFW_KEY_BACKSPACEFunction keys.- See Also:
-
GLFW_KEY_INSERT
public static final int GLFW_KEY_INSERTFunction keys.- See Also:
-
GLFW_KEY_DELETE
public static final int GLFW_KEY_DELETEFunction keys.- See Also:
-
GLFW_KEY_RIGHT
public static final int GLFW_KEY_RIGHTFunction keys.- See Also:
-
GLFW_KEY_LEFT
public static final int GLFW_KEY_LEFTFunction keys.- See Also:
-
GLFW_KEY_DOWN
public static final int GLFW_KEY_DOWNFunction keys.- See Also:
-
GLFW_KEY_UP
public static final int GLFW_KEY_UPFunction keys.- See Also:
-
GLFW_KEY_PAGE_UP
public static final int GLFW_KEY_PAGE_UPFunction keys.- See Also:
-
GLFW_KEY_PAGE_DOWN
public static final int GLFW_KEY_PAGE_DOWNFunction keys.- See Also:
-
GLFW_KEY_HOME
public static final int GLFW_KEY_HOMEFunction keys.- See Also:
-
GLFW_KEY_END
public static final int GLFW_KEY_ENDFunction keys.- See Also:
-
GLFW_KEY_CAPS_LOCK
public static final int GLFW_KEY_CAPS_LOCKFunction keys.- See Also:
-
GLFW_KEY_SCROLL_LOCK
public static final int GLFW_KEY_SCROLL_LOCKFunction keys.- See Also:
-
GLFW_KEY_NUM_LOCK
public static final int GLFW_KEY_NUM_LOCKFunction keys.- See Also:
-
GLFW_KEY_PRINT_SCREEN
public static final int GLFW_KEY_PRINT_SCREENFunction keys.- See Also:
-
GLFW_KEY_PAUSE
public static final int GLFW_KEY_PAUSEFunction keys.- See Also:
-
GLFW_KEY_F1
public static final int GLFW_KEY_F1Function keys.- See Also:
-
GLFW_KEY_F2
public static final int GLFW_KEY_F2Function keys.- See Also:
-
GLFW_KEY_F3
public static final int GLFW_KEY_F3Function keys.- See Also:
-
GLFW_KEY_F4
public static final int GLFW_KEY_F4Function keys.- See Also:
-
GLFW_KEY_F5
public static final int GLFW_KEY_F5Function keys.- See Also:
-
GLFW_KEY_F6
public static final int GLFW_KEY_F6Function keys.- See Also:
-
GLFW_KEY_F7
public static final int GLFW_KEY_F7Function keys.- See Also:
-
GLFW_KEY_F8
public static final int GLFW_KEY_F8Function keys.- See Also:
-
GLFW_KEY_F9
public static final int GLFW_KEY_F9Function keys.- See Also:
-
GLFW_KEY_F10
public static final int GLFW_KEY_F10Function keys.- See Also:
-
GLFW_KEY_F11
public static final int GLFW_KEY_F11Function keys.- See Also:
-
GLFW_KEY_F12
public static final int GLFW_KEY_F12Function keys.- See Also:
-
GLFW_KEY_F13
public static final int GLFW_KEY_F13Function keys.- See Also:
-
GLFW_KEY_F14
public static final int GLFW_KEY_F14Function keys.- See Also:
-
GLFW_KEY_F15
public static final int GLFW_KEY_F15Function keys.- See Also:
-
GLFW_KEY_F16
public static final int GLFW_KEY_F16Function keys.- See Also:
-
GLFW_KEY_F17
public static final int GLFW_KEY_F17Function keys.- See Also:
-
GLFW_KEY_F18
public static final int GLFW_KEY_F18Function keys.- See Also:
-
GLFW_KEY_F19
public static final int GLFW_KEY_F19Function keys.- See Also:
-
GLFW_KEY_F20
public static final int GLFW_KEY_F20Function keys.- See Also:
-
GLFW_KEY_F21
public static final int GLFW_KEY_F21Function keys.- See Also:
-
GLFW_KEY_F22
public static final int GLFW_KEY_F22Function keys.- See Also:
-
GLFW_KEY_F23
public static final int GLFW_KEY_F23Function keys.- See Also:
-
GLFW_KEY_F24
public static final int GLFW_KEY_F24Function keys.- See Also:
-
GLFW_KEY_F25
public static final int GLFW_KEY_F25Function keys.- See Also:
-
GLFW_KEY_KP_0
public static final int GLFW_KEY_KP_0Function keys.- See Also:
-
GLFW_KEY_KP_1
public static final int GLFW_KEY_KP_1Function keys.- See Also:
-
GLFW_KEY_KP_2
public static final int GLFW_KEY_KP_2Function keys.- See Also:
-
GLFW_KEY_KP_3
public static final int GLFW_KEY_KP_3Function keys.- See Also:
-
GLFW_KEY_KP_4
public static final int GLFW_KEY_KP_4Function keys.- See Also:
-
GLFW_KEY_KP_5
public static final int GLFW_KEY_KP_5Function keys.- See Also:
-
GLFW_KEY_KP_6
public static final int GLFW_KEY_KP_6Function keys.- See Also:
-
GLFW_KEY_KP_7
public static final int GLFW_KEY_KP_7Function keys.- See Also:
-
GLFW_KEY_KP_8
public static final int GLFW_KEY_KP_8Function keys.- See Also:
-
GLFW_KEY_KP_9
public static final int GLFW_KEY_KP_9Function keys.- See Also:
-
GLFW_KEY_KP_DECIMAL
public static final int GLFW_KEY_KP_DECIMALFunction keys.- See Also:
-
GLFW_KEY_KP_DIVIDE
public static final int GLFW_KEY_KP_DIVIDEFunction keys.- See Also:
-
GLFW_KEY_KP_MULTIPLY
public static final int GLFW_KEY_KP_MULTIPLYFunction keys.- See Also:
-
GLFW_KEY_KP_SUBTRACT
public static final int GLFW_KEY_KP_SUBTRACTFunction keys.- See Also:
-
GLFW_KEY_KP_ADD
public static final int GLFW_KEY_KP_ADDFunction keys.- See Also:
-
GLFW_KEY_KP_ENTER
public static final int GLFW_KEY_KP_ENTERFunction keys.- See Also:
-
GLFW_KEY_KP_EQUAL
public static final int GLFW_KEY_KP_EQUALFunction keys.- See Also:
-
GLFW_KEY_LEFT_SHIFT
public static final int GLFW_KEY_LEFT_SHIFTFunction keys.- See Also:
-
GLFW_KEY_LEFT_CONTROL
public static final int GLFW_KEY_LEFT_CONTROLFunction keys.- See Also:
-
GLFW_KEY_LEFT_ALT
public static final int GLFW_KEY_LEFT_ALTFunction keys.- See Also:
-
GLFW_KEY_LEFT_SUPER
public static final int GLFW_KEY_LEFT_SUPERFunction keys.- See Also:
-
GLFW_KEY_RIGHT_SHIFT
public static final int GLFW_KEY_RIGHT_SHIFTFunction keys.- See Also:
-
GLFW_KEY_RIGHT_CONTROL
public static final int GLFW_KEY_RIGHT_CONTROLFunction keys.- See Also:
-
GLFW_KEY_RIGHT_ALT
public static final int GLFW_KEY_RIGHT_ALTFunction keys.- See Also:
-
GLFW_KEY_RIGHT_SUPER
public static final int GLFW_KEY_RIGHT_SUPERFunction keys.- See Also:
-
GLFW_KEY_MENU
public static final int GLFW_KEY_MENUFunction keys.- See Also:
-
GLFW_KEY_LAST
public static final int GLFW_KEY_LASTFunction keys.- See Also:
-
GLFW_MOD_SHIFT
public static final int GLFW_MOD_SHIFTIf this bit is set one or more Shift keys were held down.- See Also:
-
GLFW_MOD_CONTROL
public static final int GLFW_MOD_CONTROLIf this bit is set one or more Control keys were held down.- See Also:
-
GLFW_MOD_ALT
public static final int GLFW_MOD_ALTIf this bit is set one or more Alt keys were held down.- See Also:
-
GLFW_MOD_SUPER
public static final int GLFW_MOD_SUPERIf this bit is set one or more Super keys were held down.- See Also:
-
GLFW_MOD_CAPS_LOCK
public static final int GLFW_MOD_CAPS_LOCKIf this bit is set the Caps Lock key is enabled and theLOCK_KEY_MODSinput mode is set.- See Also:
-
GLFW_MOD_NUM_LOCK
public static final int GLFW_MOD_NUM_LOCKIf this bit is set the Num Lock key is enabled and theLOCK_KEY_MODSinput mode is set.- See Also:
-
GLFW_MOUSE_BUTTON_1
public static final int GLFW_MOUSE_BUTTON_1Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_2
public static final int GLFW_MOUSE_BUTTON_2Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_3
public static final int GLFW_MOUSE_BUTTON_3Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_4
public static final int GLFW_MOUSE_BUTTON_4Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_5
public static final int GLFW_MOUSE_BUTTON_5Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_6
public static final int GLFW_MOUSE_BUTTON_6Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_7
public static final int GLFW_MOUSE_BUTTON_7Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_8
public static final int GLFW_MOUSE_BUTTON_8Mouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_LAST
public static final int GLFW_MOUSE_BUTTON_LASTMouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_LEFT
public static final int GLFW_MOUSE_BUTTON_LEFTMouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_RIGHT
public static final int GLFW_MOUSE_BUTTON_RIGHTMouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_MOUSE_BUTTON_MIDDLE
public static final int GLFW_MOUSE_BUTTON_MIDDLEMouse buttons. See mouse button input for how these are used.- See Also:
-
GLFW_JOYSTICK_1
public static final int GLFW_JOYSTICK_1Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_2
public static final int GLFW_JOYSTICK_2Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_3
public static final int GLFW_JOYSTICK_3Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_4
public static final int GLFW_JOYSTICK_4Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_5
public static final int GLFW_JOYSTICK_5Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_6
public static final int GLFW_JOYSTICK_6Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_7
public static final int GLFW_JOYSTICK_7Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_8
public static final int GLFW_JOYSTICK_8Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_9
public static final int GLFW_JOYSTICK_9Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_10
public static final int GLFW_JOYSTICK_10Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_11
public static final int GLFW_JOYSTICK_11Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_12
public static final int GLFW_JOYSTICK_12Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_13
public static final int GLFW_JOYSTICK_13Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_14
public static final int GLFW_JOYSTICK_14Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_15
public static final int GLFW_JOYSTICK_15Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_16
public static final int GLFW_JOYSTICK_16Joysticks. See joystick input for how these are used.- See Also:
-
GLFW_JOYSTICK_LAST
public static final int GLFW_JOYSTICK_LASTJoysticks. See joystick input for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_A
public static final int GLFW_GAMEPAD_BUTTON_AGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_B
public static final int GLFW_GAMEPAD_BUTTON_BGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_X
public static final int GLFW_GAMEPAD_BUTTON_XGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_Y
public static final int GLFW_GAMEPAD_BUTTON_YGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_LEFT_BUMPER
public static final int GLFW_GAMEPAD_BUTTON_LEFT_BUMPERGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER
public static final int GLFW_GAMEPAD_BUTTON_RIGHT_BUMPERGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_BACK
public static final int GLFW_GAMEPAD_BUTTON_BACKGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_START
public static final int GLFW_GAMEPAD_BUTTON_STARTGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_GUIDE
public static final int GLFW_GAMEPAD_BUTTON_GUIDEGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_LEFT_THUMB
public static final int GLFW_GAMEPAD_BUTTON_LEFT_THUMBGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_RIGHT_THUMB
public static final int GLFW_GAMEPAD_BUTTON_RIGHT_THUMBGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_DPAD_UP
public static final int GLFW_GAMEPAD_BUTTON_DPAD_UPGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_DPAD_RIGHT
public static final int GLFW_GAMEPAD_BUTTON_DPAD_RIGHTGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_DPAD_DOWN
public static final int GLFW_GAMEPAD_BUTTON_DPAD_DOWNGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_DPAD_LEFT
public static final int GLFW_GAMEPAD_BUTTON_DPAD_LEFTGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_LAST
public static final int GLFW_GAMEPAD_BUTTON_LASTGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_CROSS
public static final int GLFW_GAMEPAD_BUTTON_CROSSGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_CIRCLE
public static final int GLFW_GAMEPAD_BUTTON_CIRCLEGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_SQUARE
public static final int GLFW_GAMEPAD_BUTTON_SQUAREGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_BUTTON_TRIANGLE
public static final int GLFW_GAMEPAD_BUTTON_TRIANGLEGamepad buttons. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_LEFT_X
public static final int GLFW_GAMEPAD_AXIS_LEFT_XGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_LEFT_Y
public static final int GLFW_GAMEPAD_AXIS_LEFT_YGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_RIGHT_X
public static final int GLFW_GAMEPAD_AXIS_RIGHT_XGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_RIGHT_Y
public static final int GLFW_GAMEPAD_AXIS_RIGHT_YGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
public static final int GLFW_GAMEPAD_AXIS_LEFT_TRIGGERGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
public static final int GLFW_GAMEPAD_AXIS_RIGHT_TRIGGERGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_GAMEPAD_AXIS_LAST
public static final int GLFW_GAMEPAD_AXIS_LASTGamepad axes. See gamepad for how these are used.- See Also:
-
GLFW_NO_ERROR
public static final int GLFW_NO_ERRORError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_NOT_INITIALIZED
public static final int GLFW_NOT_INITIALIZEDError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_NO_CURRENT_CONTEXT
public static final int GLFW_NO_CURRENT_CONTEXTError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_INVALID_ENUM
public static final int GLFW_INVALID_ENUMError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_INVALID_VALUE
public static final int GLFW_INVALID_VALUEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_OUT_OF_MEMORY
public static final int GLFW_OUT_OF_MEMORYError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_API_UNAVAILABLE
public static final int GLFW_API_UNAVAILABLEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_VERSION_UNAVAILABLE
public static final int GLFW_VERSION_UNAVAILABLEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_PLATFORM_ERROR
public static final int GLFW_PLATFORM_ERRORError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_FORMAT_UNAVAILABLE
public static final int GLFW_FORMAT_UNAVAILABLEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_NO_WINDOW_CONTEXT
public static final int GLFW_NO_WINDOW_CONTEXTError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_CURSOR_UNAVAILABLE
public static final int GLFW_CURSOR_UNAVAILABLEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_FEATURE_UNAVAILABLE
public static final int GLFW_FEATURE_UNAVAILABLEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_FEATURE_UNIMPLEMENTED
public static final int GLFW_FEATURE_UNIMPLEMENTEDError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_PLATFORM_UNAVAILABLE
public static final int GLFW_PLATFORM_UNAVAILABLEError codes.Enum values:
NO_ERROR- No error has occurred.NOT_INITIALIZED- GLFW has not been initialized.This occurs if a GLFW function was called that may not be called unless the library is initialized.
NO_CURRENT_CONTEXT- 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.INVALID_ENUM- One of the arguments to the function was an invalid enum value.One of the arguments to the function was an invalid enum value, for example requesting
RED_BITSwithGetWindowAttrib.INVALID_VALUE- One of the arguments to the function was an invalid value.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
VERSION_UNAVAILABLEerror.OUT_OF_MEMORY- A memory allocation failed.A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.
API_UNAVAILABLE- GLFW could not find support for the requested API on the system.The installed graphics driver does not support the requested API, or does not support it via the chosen context creation API. Below are a few examples:
Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan.
VERSION_UNAVAILABLE- The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not
INVALID_VALUE, because GLFW cannot know what future versions will exist.PLATFORM_ERROR- A platform-specific error occurred that does not match any of the more specific categories.A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker.
FORMAT_UNAVAILABLE- The requested format is not supported or available.If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.
NO_WINDOW_CONTEXT- The specified window does not have an OpenGL or OpenGL ES context.A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
CURSOR_UNAVAILABLE- The specified cursor shape is not available.The specified standard cursor shape is not available, either because the current platform cursor theme does not provide it or because it is not available on the platform.
Platform or system settings limitation. Pick another standard cursor shape or create a custom cursor.
FEATURE_UNAVAILABLE- The requested feature is not provided by the platform.The requested feature is not provided by the platform, so GLFW is unable to implement it. The documentation for each function notes if it could emit this error.
Platform or platform version limitation. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
FEATURE_UNIMPLEMENTED- The requested feature has not yet been implemented in GLFW for this platform.An incomplete implementation of GLFW for this platform, hopefully fixed in a future release. The error can be ignored unless the feature is critical to the application.
A function call that emits this error has no effect other than the error and updating any existing out parameters.
PLATFORM_UNAVAILABLE- Platform unavailable or no matching platform was found.If emitted during initialization, no matching platform was found. If the
PLATFORMinit hint was set toANY_PLATFORM, GLFW could not detect any of the platforms supported by this library binary, except for theNullplatform. If the init hint was set to a specific platform, it is either not supported by this library binary or GLFW was not able to detect it.If emitted by a native access function, GLFW was initialized for a different platform than the function is for.
Failure to detect any platform usually only happens on non-macOS Unix systems, either when no window system is running or the program was run from a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected.
Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call
PlatformSupportedto check whether a specific platform is supported by a library binary.
- See Also:
-
GLFW_FOCUSED
public static final int GLFW_FOCUSEDWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_ICONIFIED
public static final int GLFW_ICONIFIEDWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_RESIZABLE
public static final int GLFW_RESIZABLEWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_VISIBLE
public static final int GLFW_VISIBLEWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_DECORATED
public static final int GLFW_DECORATEDWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_AUTO_ICONIFY
public static final int GLFW_AUTO_ICONIFYWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_FLOATING
public static final int GLFW_FLOATINGWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_MAXIMIZED
public static final int GLFW_MAXIMIZEDWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_CENTER_CURSOR
public static final int GLFW_CENTER_CURSORWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_TRANSPARENT_FRAMEBUFFER
public static final int GLFW_TRANSPARENT_FRAMEBUFFERWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_HOVERED
public static final int GLFW_HOVEREDWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_FOCUS_ON_SHOW
public static final int GLFW_FOCUS_ON_SHOWWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_MOUSE_PASSTHROUGH
public static final int GLFW_MOUSE_PASSTHROUGHWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_POSITION_X
public static final int GLFW_POSITION_XWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_POSITION_Y
public static final int GLFW_POSITION_YWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_SOFT_FULLSCREEN
public static final int GLFW_SOFT_FULLSCREENWindow attributes.Enum values:
FOCUSED-WindowHint: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and initially hidden windows.GetWindowAttrib: Indicates whether the specified window has input focus.ICONIFIED-GetWindowAttrib: Indicates whether the specified window is iconified, whether by the user or withIconifyWindow.RESIZABLE-WindowHint: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using theSetWindowSizefunction. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is resizable by the user.VISIBLE-WindowHint: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for example moving it to a specific location.GetWindowAttrib: Indicates whether the specified window is visible. Window visibility can be controlled withShowWindowandHideWindow.DECORATED-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window has decorations such as a border, a close widget, etc.AUTO_ICONIFY-WindowHint: 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-WindowHint: 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.GetWindowAttrib: Indicates whether the specified window is floating, also called topmost or always-on-top.MAXIMIZED-WindowHint: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows.GetWindowAttrib: Indicates whether the specified window is maximized, whether by the user orMaximizeWindow.CENTER_CURSOR-WindowHint: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode windows.TRANSPARENT_FRAMEBUFFER-WindowHint: Specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations.HOVERED-GetWindowAttrib: Indicates whether the cursor is currently directly over the content area of the window, with no other windows between.FOCUS_ON_SHOW-WindowHint: Specifies whether input focuses on calling show window.GetWindowAttrib: Indicates whether input focuses on calling show window.MOUSE_PASSTHROUGH-WindowHint: Specifies whether the window is transparent to mouse input, letting any mouse events pass through to whatever window is behind it. This is only supported for undecorated windows. Decorated windows with this enabled will behave differently between platforms.GetWindowAttrib: Indicates whether the window is transparent to mouse input.POSITION_X-WindowHint: Initial position x-coordinate window hint.POSITION_Y-WindowHint: Initial position y-coordinate window hint.SOFT_FULLSCREEN-WindowHint: Soft fullscreen window hint.
- See Also:
-
GLFW_CURSOR
public static final int GLFW_CURSORInput options.- See Also:
-
GLFW_STICKY_KEYS
public static final int GLFW_STICKY_KEYSInput options.- See Also:
-
GLFW_STICKY_MOUSE_BUTTONS
public static final int GLFW_STICKY_MOUSE_BUTTONSInput options.- See Also:
-
GLFW_LOCK_KEY_MODS
public static final int GLFW_LOCK_KEY_MODSInput options.- See Also:
-
GLFW_RAW_MOUSE_MOTION
public static final int GLFW_RAW_MOUSE_MOTIONInput options.- See Also:
-
GLFW_UNLIMITED_MOUSE_BUTTONS
public static final int GLFW_UNLIMITED_MOUSE_BUTTONSInput options.- See Also:
-
GLFW_IME
public static final int GLFW_IMEInput options.- See Also:
-
GLFW_CURSOR_NORMAL
public static final int GLFW_CURSOR_NORMALCursor state.- See Also:
-
GLFW_CURSOR_HIDDEN
public static final int GLFW_CURSOR_HIDDENCursor state.- See Also:
-
GLFW_CURSOR_DISABLED
public static final int GLFW_CURSOR_DISABLEDCursor state.- See Also:
-
GLFW_CURSOR_CAPTURED
public static final int GLFW_CURSOR_CAPTUREDCursor state.- See Also:
-
GLFW_ARROW_CURSOR
public static final int GLFW_ARROW_CURSORThe regular arrow cursor shape.- See Also:
-
GLFW_IBEAM_CURSOR
public static final int GLFW_IBEAM_CURSORThe text input I-beam cursor shape.- See Also:
-
GLFW_CROSSHAIR_CURSOR
public static final int GLFW_CROSSHAIR_CURSORThe crosshair cursor shape.- See Also:
-
GLFW_POINTING_HAND_CURSOR
public static final int GLFW_POINTING_HAND_CURSORThe pointing hand cursor shape.- See Also:
-
GLFW_RESIZE_EW_CURSOR
public static final int GLFW_RESIZE_EW_CURSORThe horizontal resize/move arrow shape.This is usually a horizontal double-headed arrow.
- See Also:
-
GLFW_RESIZE_NS_CURSOR
public static final int GLFW_RESIZE_NS_CURSORThe vertical resize/move shape.This is usually a vertical double-headed arrow.
- See Also:
-
GLFW_RESIZE_NWSE_CURSOR
public static final int GLFW_RESIZE_NWSE_CURSORThe top-left to bottom-right diagonal resize/move shape.This is usually a diagonal double-headed arrow.
Note
- macOS: This shape is provided by a private system API and may fail with
CURSOR_UNAVAILABLEin the future. - Wayland: This shape is provided by a newer standard not supported by all cursor themes.
- X11: This shape is provided by a newer standard not supported by all cursor themes.
- See Also:
- macOS: This shape is provided by a private system API and may fail with
-
GLFW_RESIZE_NESW_CURSOR
public static final int GLFW_RESIZE_NESW_CURSORThe top-right to bottom-left diagonal resize/move shape.This is usually a diagonal double-headed arrow.
Note
- macOS: This shape is provided by a private system API and may fail with
CURSOR_UNAVAILABLEin the future. - Wayland: This shape is provided by a newer standard not supported by all cursor themes.
- X11: This shape is provided by a newer standard not supported by all cursor themes.
- See Also:
- macOS: This shape is provided by a private system API and may fail with
-
GLFW_RESIZE_ALL_CURSOR
public static final int GLFW_RESIZE_ALL_CURSORThe omni-directional resize cursor/move shape.This is usually either a combined horizontal and vertical double-headed arrow or a grabbing hand.
- See Also:
-
GLFW_NOT_ALLOWED_CURSOR
public static final int GLFW_NOT_ALLOWED_CURSORThe operation-not-allowed shape.This is usually a circle with a diagonal line through it.
Note
- Wayland: This shape is provided by a newer standard not supported by all cursor themes.
- X11: This shape is provided by a newer standard not supported by all cursor themes.
- See Also:
-
GLFW_HRESIZE_CURSOR
public static final int GLFW_HRESIZE_CURSORLegacy name for compatibility.- See Also:
-
GLFW_VRESIZE_CURSOR
public static final int GLFW_VRESIZE_CURSORLegacy name for compatibility.- See Also:
-
GLFW_HAND_CURSOR
public static final int GLFW_HAND_CURSORLegacy name for compatibility.- See Also:
-
GLFW_CONNECTED
public static final int GLFW_CONNECTEDMonitor events.- See Also:
-
GLFW_DISCONNECTED
public static final int GLFW_DISCONNECTEDMonitor events.- See Also:
-
GLFW_JOYSTICK_HAT_BUTTONS
public static final int GLFW_JOYSTICK_HAT_BUTTONSJoystick hat buttons init hint.Specifies whether to also expose joystick hats as buttons, for compatibility with earlier versions of GLFW that did not have
GetJoystickHats. Possible values areTRUEandFALSE.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE
public static final int GLFW_ANGLE_PLATFORM_TYPEANGLE rendering backend init hint.Specifies the platform type (rendering backend) to request when using OpenGL ES and EGL via ANGLE. If the requested platform type is unavailable, ANGLE will use its default. Possible values are one of
ANGLE_PLATFORM_TYPE_NONE,ANGLE_PLATFORM_TYPE_OPENGL,ANGLE_PLATFORM_TYPE_OPENGLES,ANGLE_PLATFORM_TYPE_D3D9,ANGLE_PLATFORM_TYPE_D3D11,ANGLE_PLATFORM_TYPE_VULKANandANGLE_PLATFORM_TYPE_METAL.- See Also:
-
GLFW_ANY_POSITION
public static final int GLFW_ANY_POSITION- See Also:
-
GLFW_PLATFORM
public static final int GLFW_PLATFORMPlatform selection init hint.- See Also:
-
GLFW_MANAGE_PREEDIT_CANDIDATE
public static final int GLFW_MANAGE_PREEDIT_CANDIDATEPreedit candidate init hint.- See Also:
-
GLFW_COCOA_CHDIR_RESOURCES
public static final int GLFW_COCOA_CHDIR_RESOURCESmacOS specific init hint.Specifies whether to set the current directory to the application to the
Contents/Resourcessubdirectory of the application's bundle, if present. Possible values areTRUE` andFALSE`. This is ignored on other platforms.- See Also:
-
GLFW_COCOA_MENUBAR
public static final int GLFW_COCOA_MENUBARmacOS specific init hint.Specifies whether to create the menu bar and dock icon when GLFW is initialized. This applies whether the menu bar is created from a nib or manually by GLFW. Possible values are
TRUEandFALSE. This is ignored on other platforms.- See Also:
-
GLFW_X11_XCB_VULKAN_SURFACE
public static final int GLFW_X11_XCB_VULKAN_SURFACEX11 specific init hint.- See Also:
-
GLFW_X11_ONTHESPOT
public static final int GLFW_X11_ONTHESPOTX11 specific init hint.- See Also:
-
GLFW_WAYLAND_LIBDECOR
public static final int GLFW_WAYLAND_LIBDECORWayland specific init hint.- See Also:
-
GLFW_ANY_PLATFORM
public static final int GLFW_ANY_PLATFORMHint value forPLATFORMthat enables automatic platform selection.- See Also:
-
GLFW_PLATFORM_WIN32
public static final int GLFW_PLATFORM_WIN32Hint value forPLATFORMthat enables automatic platform selection.- See Also:
-
GLFW_PLATFORM_COCOA
public static final int GLFW_PLATFORM_COCOAHint value forPLATFORMthat enables automatic platform selection.- See Also:
-
GLFW_PLATFORM_WAYLAND
public static final int GLFW_PLATFORM_WAYLANDHint value forPLATFORMthat enables automatic platform selection.- See Also:
-
GLFW_PLATFORM_X11
public static final int GLFW_PLATFORM_X11Hint value forPLATFORMthat enables automatic platform selection.- See Also:
-
GLFW_PLATFORM_NULL
public static final int GLFW_PLATFORM_NULLHint value forPLATFORMthat enables automatic platform selection.- See Also:
-
GLFW_DONT_CARE
public static final int GLFW_DONT_CAREDon't care value.- See Also:
-
GLFW_RED_BITS
public static final int GLFW_RED_BITSPixelFormat hints.- See Also:
-
GLFW_GREEN_BITS
public static final int GLFW_GREEN_BITSPixelFormat hints.- See Also:
-
GLFW_BLUE_BITS
public static final int GLFW_BLUE_BITSPixelFormat hints.- See Also:
-
GLFW_ALPHA_BITS
public static final int GLFW_ALPHA_BITSPixelFormat hints.- See Also:
-
GLFW_DEPTH_BITS
public static final int GLFW_DEPTH_BITSPixelFormat hints.- See Also:
-
GLFW_STENCIL_BITS
public static final int GLFW_STENCIL_BITSPixelFormat hints.- See Also:
-
GLFW_ACCUM_RED_BITS
public static final int GLFW_ACCUM_RED_BITSPixelFormat hints.- See Also:
-
GLFW_ACCUM_GREEN_BITS
public static final int GLFW_ACCUM_GREEN_BITSPixelFormat hints.- See Also:
-
GLFW_ACCUM_BLUE_BITS
public static final int GLFW_ACCUM_BLUE_BITSPixelFormat hints.- See Also:
-
GLFW_ACCUM_ALPHA_BITS
public static final int GLFW_ACCUM_ALPHA_BITSPixelFormat hints.- See Also:
-
GLFW_AUX_BUFFERS
public static final int GLFW_AUX_BUFFERSPixelFormat hints.- See Also:
-
GLFW_STEREO
public static final int GLFW_STEREOPixelFormat hints.- See Also:
-
GLFW_SAMPLES
public static final int GLFW_SAMPLESPixelFormat hints.- See Also:
-
GLFW_SRGB_CAPABLE
public static final int GLFW_SRGB_CAPABLEPixelFormat hints.- See Also:
-
GLFW_REFRESH_RATE
public static final int GLFW_REFRESH_RATEPixelFormat hints.- See Also:
-
GLFW_DOUBLEBUFFER
public static final int GLFW_DOUBLEBUFFERPixelFormat hints.- See Also:
-
GLFW_CLIENT_API
public static final int GLFW_CLIENT_APIClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_VERSION_MAJOR
public static final int GLFW_CONTEXT_VERSION_MAJORClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_VERSION_MINOR
public static final int GLFW_CONTEXT_VERSION_MINORClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_REVISION
public static final int GLFW_CONTEXT_REVISIONClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_ROBUSTNESS
public static final int GLFW_CONTEXT_ROBUSTNESSClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_OPENGL_FORWARD_COMPAT
public static final int GLFW_OPENGL_FORWARD_COMPATClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_DEBUG
public static final int GLFW_CONTEXT_DEBUGClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_OPENGL_DEBUG_CONTEXT
public static final int GLFW_OPENGL_DEBUG_CONTEXTClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_OPENGL_PROFILE
public static final int GLFW_OPENGL_PROFILEClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_RELEASE_BEHAVIOR
public static final int GLFW_CONTEXT_RELEASE_BEHAVIORClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_NO_ERROR
public static final int GLFW_CONTEXT_NO_ERRORClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_CONTEXT_CREATION_API
public static final int GLFW_CONTEXT_CREATION_APIClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_SCALE_TO_MONITOR
public static final int GLFW_SCALE_TO_MONITORClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_SCALE_FRAMEBUFFER
public static final int GLFW_SCALE_FRAMEBUFFERClient API hints.Enum values:
CLIENT_API-WindowHint: Specifies which client API to create the context for. Possible values areOPENGL_API,OPENGL_ES_APIandNO_API. This is a hard constraint.GetWindowAttrib: Indicates the client API provided by the window's context; eitherOPENGL_API,OPENGL_ES_APIorNO_API.CONTEXT_VERSION_MAJOR-WindowHint: 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.Note
- 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:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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. - OpenGL ES:
CONTEXT_VERSION_MAJORandCONTEXT_VERSION_MINORare not hard constraints, but 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.
GetWindowAttrib: Indicate the client API major version of the window's context.CONTEXT_VERSION_MINOR-WindowHint: 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.GetWindowAttrib: Indicate the client API minor version of the window's context.CONTEXT_REVISION-GetWindowAttrib: Indicates the client API version of the window's context.CONTEXT_ROBUSTNESS-WindowHint: Specifies the robustness strategy to be used by the context. This can be one ofNO_RESET_NOTIFICATIONorLOSE_CONTEXT_ON_RESET, orNO_ROBUSTNESSto not request a robustness strategy.GetWindowAttrib: Indicates the robustness strategy used by the context. This isLOSE_CONTEXT_ON_RESETorNO_RESET_NOTIFICATIONif the window's context supports robustness, orNO_ROBUSTNESSotherwise.OPENGL_FORWARD_COMPAT-WindowHint: 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.GetWindowAttrib: Indicates if the window's context is an OpenGL forward-compatible one.CONTEXT_DEBUG-WindowHint: Specifies whether to create a debug context, which may have additional error and performance issue reporting functionality.GetWindowAttrib: Indicates if the window's context is a debug context.OPENGL_DEBUG_CONTEXT- Alias ofCONTEXT_DEBUGfor compatibility with earlier versions.OPENGL_PROFILE-WindowHint: Specifies which OpenGL profile to create the context for. Possible values are one ofOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILE, orOPENGL_ANY_PROFILEto not request a specific profile. If requesting an OpenGL version below 3.2,OPENGL_ANY_PROFILEmust be used. If OpenGL ES is requested, this hint is ignored.GetWindowAttrib: Indicates the OpenGL profile used by the context. This isOPENGL_CORE_PROFILEorOPENGL_COMPAT_PROFILEif the context uses a known profile, orOPENGL_ANY_PROFILEif the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.CONTEXT_RELEASE_BEHAVIOR-WindowHint: Specifies the release behavior to be used by the context. If the behavior isANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior isRELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior isRELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.CONTEXT_NO_ERROR-WindowHint: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause undefined behavior.CONTEXT_CREATION_API-WindowHint: Specifies which context creation API to use to create the context. Possible values areNATIVE_CONTEXT_API,EGL_CONTEXT_APIandOSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.Note
- macOS: 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.
- An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this
hint. This can be resolved by having it load via
GetProcAddress, which always uses the selected API.
GetWindowAttrib: Indicates the context creation API used to create the window's context; eitherNATIVE_CONTEXT_APIorEGL_CONTEXT_API.SCALE_TO_MONITOR-WindowHint: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. This includes the initial placement when the window is created. Possible values areTRUEandFALSE.This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the resolution of the framebuffer is changed independently of the window size.
SCALE_FRAMEBUFFER- Legacy name for compatibility.This is an alias for the
GLFW_SCALE_FRAMEBUFFERwindow hint for compatibility with earlier versions.
- See Also:
-
GLFW_COCOA_RETINA_FRAMEBUFFER
public static final int GLFW_COCOA_RETINA_FRAMEBUFFERSpecifies whether to use full resolution framebuffers on Retina displays.This is ignored on other platforms.
- See Also:
-
GLFW_COCOA_FRAME_NAME
public static final int GLFW_COCOA_FRAME_NAMESpecifies the UTF-8 encoded name to use for autosaving the window frame, or if empty disables frame autosaving for the window.This is ignored on other platforms.
- See Also:
-
GLFW_COCOA_GRAPHICS_SWITCHING
public static final int GLFW_COCOA_GRAPHICS_SWITCHINGSpecifies whether to enable Automatic Graphics Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL context and move it between GPUs if necessary or whether to force it to always run on the discrete GPU. This only affects systems with both integrated and discrete GPUs.This is ignored on other platforms.
- See Also:
-
GLFW_X11_CLASS_NAME
public static final int GLFW_X11_CLASS_NAMEThe desired ASCII encoded class and instance parts of the ICCCMWM_CLASSwindow property.These are ignored on other platforms.
- See Also:
-
GLFW_X11_INSTANCE_NAME
public static final int GLFW_X11_INSTANCE_NAMEThe desired ASCII encoded class and instance parts of the ICCCMWM_CLASSwindow property.These are ignored on other platforms.
- See Also:
-
GLFW_WIN32_KEYBOARD_MENU
public static final int GLFW_WIN32_KEYBOARD_MENUSpecifies whether to allow access to the window menu via the Alt+Space and Alt-and-then-Space keyboard shortcuts.This is ignored on other platforms.
- See Also:
-
GLFW_WIN32_SHOWDEFAULT
public static final int GLFW_WIN32_SHOWDEFAULTWin32 specific [window hint](@ref GLFW_WIN32_SHOWDEFAULT_hint).- See Also:
-
GLFW_WAYLAND_APP_ID
public static final int GLFW_WAYLAND_APP_IDAllows specification of the Waylandapp_id.This is ignored on other platforms.
- See Also:
-
GLFW_NO_API
public static final int GLFW_NO_APIValues for theCLIENT_APIhint.- See Also:
-
GLFW_OPENGL_API
public static final int GLFW_OPENGL_APIValues for theCLIENT_APIhint.- See Also:
-
GLFW_OPENGL_ES_API
public static final int GLFW_OPENGL_ES_APIValues for theCLIENT_APIhint.- See Also:
-
GLFW_NO_ROBUSTNESS
public static final int GLFW_NO_ROBUSTNESSValues for theCONTEXT_ROBUSTNESShint.- See Also:
-
GLFW_NO_RESET_NOTIFICATION
public static final int GLFW_NO_RESET_NOTIFICATIONValues for theCONTEXT_ROBUSTNESShint.- See Also:
-
GLFW_LOSE_CONTEXT_ON_RESET
public static final int GLFW_LOSE_CONTEXT_ON_RESETValues for theCONTEXT_ROBUSTNESShint.- See Also:
-
GLFW_OPENGL_ANY_PROFILE
public static final int GLFW_OPENGL_ANY_PROFILEValues for theOPENGL_PROFILEhint.- See Also:
-
GLFW_OPENGL_CORE_PROFILE
public static final int GLFW_OPENGL_CORE_PROFILEValues for theOPENGL_PROFILEhint.- See Also:
-
GLFW_OPENGL_COMPAT_PROFILE
public static final int GLFW_OPENGL_COMPAT_PROFILEValues for theOPENGL_PROFILEhint.- See Also:
-
GLFW_ANY_RELEASE_BEHAVIOR
public static final int GLFW_ANY_RELEASE_BEHAVIORValues for theCONTEXT_RELEASE_BEHAVIORhint.- See Also:
-
GLFW_RELEASE_BEHAVIOR_FLUSH
public static final int GLFW_RELEASE_BEHAVIOR_FLUSHValues for theCONTEXT_RELEASE_BEHAVIORhint.- See Also:
-
GLFW_RELEASE_BEHAVIOR_NONE
public static final int GLFW_RELEASE_BEHAVIOR_NONEValues for theCONTEXT_RELEASE_BEHAVIORhint.- See Also:
-
GLFW_NATIVE_CONTEXT_API
public static final int GLFW_NATIVE_CONTEXT_APIValues for theCONTEXT_CREATION_APIhint.- See Also:
-
GLFW_EGL_CONTEXT_API
public static final int GLFW_EGL_CONTEXT_APIValues for theCONTEXT_CREATION_APIhint.- See Also:
-
GLFW_OSMESA_CONTEXT_API
public static final int GLFW_OSMESA_CONTEXT_APIValues for theCONTEXT_CREATION_APIhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_NONE
public static final int GLFW_ANGLE_PLATFORM_TYPE_NONEValues for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_OPENGL
public static final int GLFW_ANGLE_PLATFORM_TYPE_OPENGLValues for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_OPENGLES
public static final int GLFW_ANGLE_PLATFORM_TYPE_OPENGLESValues for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_D3D9
public static final int GLFW_ANGLE_PLATFORM_TYPE_D3D9Values for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_D3D11
public static final int GLFW_ANGLE_PLATFORM_TYPE_D3D11Values for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_VULKAN
public static final int GLFW_ANGLE_PLATFORM_TYPE_VULKANValues for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_ANGLE_PLATFORM_TYPE_METAL
public static final int GLFW_ANGLE_PLATFORM_TYPE_METALValues for theANGLE_PLATFORM_TYPEhint.- See Also:
-
GLFW_WAYLAND_PREFER_LIBDECOR
public static final int GLFW_WAYLAND_PREFER_LIBDECORValues for theWAYLAND_LIBDECORhint.- See Also:
-
GLFW_WAYLAND_DISABLE_LIBDECOR
public static final int GLFW_WAYLAND_DISABLE_LIBDECORValues for theWAYLAND_LIBDECORhint.- See Also:
-
-
Method Details
-
getLibrary
public static org.lwjgl.system.SharedLibrary getLibrary()Returns the glfwSharedLibrary. -
glfwInit
public static boolean glfwInit()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
Terminatebefore returning. If it succeeds, you should callTerminatebefore the application exits.Additional calls to this function after successful initialization but before termination will return
TRUEimmediately.The
PLATFORMinit hint controls which platforms are considered during initialization. This also depends on which platforms the library was compiled to support.Note
- This function must only be called from the main thread.
- macOS: This function will change the current directory of the application to the `Contents/Resources` subdirectory of the application's
bundle, if present. This can be disabled with the
COCOA_CHDIR_RESOURCESinit hint. - macOS: This function will create the main menu and dock icon for the application. If GLFW finds a
MainMenu.nibit is loaded and assumed to contain a menu bar. Otherwise a minimal menu bar is created manually with common commands like Hide, Quit and About. The About entry opens a minimal about dialog with information from the application's bundle. The menu bar and dock icon can be disabled entirely with theCOCOA_MENUBARinit hint. - Wayland, X11: If the library was compiled with support for both Wayland and X11, and the
PLATFORMinit hint is set toANY_PLATFORM, theXDG_SESSION_TYPEenvironment variable affects which platform is picked. If the environment variable is not set, or is set to something other thanwaylandorx11, the regular detection mechanism will be used instead. - x11: This function will set the
LC_CTYPEcategory of the application locale according to the current environment if that category is still "C". This is because the "C" locale breaks Unicode text input.
- Returns:
TRUEif successful, orFALSEif an error occurred.Possible errors include
PLATFORM_UNAVAILABLEandPLATFORM_ERROR.- Since:
- version 1.0
-
glfwTerminate
public static void glfwTerminate()Terminates the GLFW library.This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call
Initsuccessfully 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
Initbefore it returns failure.This function has no effect if GLFW is not initialized.
Note
- This function may be called before
Init. - This function must only be called from the main thread.
- This function must not be called from a callback.
- No window's context may be current on another thread when this function is called.
- Since:
- version 1.0
- This function may be called before
-
glfwInitHint
public static void glfwInitHint(int hint, int value) Sets hints for the next initialization of GLFW.The values you set hints to are never reset by GLFW, but they only take effect during initialization. Once GLFW has been initialized, any values you set will be ignored until the library is terminated and initialized again.
Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will simply ignore them. Setting these hints requires no platform specific headers or functions.
Note
- This function may be called before
Init. - This function must only be called from the main thread.
- Parameters:
hint- the init hint to set. One of:JOYSTICK_HAT_BUTTONSANGLE_PLATFORM_TYPECOCOA_CHDIR_RESOURCESCOCOA_MENUBARPLATFORMX11_XCB_VULKAN_SURFACEvalue- the new value of the init hint- Since:
- version 3.3
- This function may be called before
-
nglfwInitAllocator
public static void nglfwInitAllocator(long allocator) Unsafe version of:InitAllocator -
glfwInitAllocator
Sets the init allocator to the desired value.To use the default allocator, call this function with a
NULLargument.If you specify an allocator struct, every member must be a valid function pointer. If any member is
NULL, this function will emitINVALID_VALUEand the init allocator will be unchanged.The functions in the allocator must fulfil a number of requirements. See the documentation for
GLFWAllocateCallback,GLFWReallocateCallbackandGLFWDeallocateCallbackfor details.Note
- Possible errors include
INVALID_VALUE. - The specified allocator is copied before this function returns.
- This function must only be called from the main thread.
- Parameters:
allocator- the allocator to use at the next initialization, orNULLto use the default one- Since:
- version 3.4
- Possible errors include
-
nglfwGetVersion
public static void nglfwGetVersion(long major, long minor, long rev) Unsafe version of:GetVersion -
glfwGetVersion
public static void glfwGetVersion(@Nullable IntBuffer major, @Nullable IntBuffer minor, @Nullable IntBuffer rev) 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.Note
- Any or all of the version arguments may be
NULL. - This function always succeeds.
- This function may be called before
Init. - This function may be called from any thread.
- Parameters:
major- where to store the major version number, orNULLminor- where to store the minor version number, orNULLrev- where to store the revision number, orNULL- Since:
- version 1.0
- Any or all of the version arguments may be
-
nglfwGetVersionString
public static long nglfwGetVersionString()Unsafe version of:GetVersionString -
glfwGetVersionString
Returns the compile-time generated version string of the GLFW library binary. It describes the version, platforms, compiler and any platform or operating system specific compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried withglGetString.Do not use the version string to parse the GLFW library version. The
GetVersionfunction already provides the version of the library binary in numerical format.Do not use the version string to parse what platforms are supported. The
PlatformSupportedfunction lets you query platform support.Note
- This function always succeeds.
- This function may be called before
Init. - This function may be called from any thread.
- The returned string is static and compile-time generated.
- Returns:
- the ASCII encoded GLFW version string
- Since:
- version 3.0
-
nglfwGetError
public static int nglfwGetError(long description) Unsafe version of:GetError -
glfwGetError
public static int glfwGetError(@Nullable org.lwjgl.PointerBuffer description) Returns and clears the last error for the calling thread.This function returns and clears the error code of the last error that occurred on the calling thread and optionally a UTF-8 encoded human-readable description of it. If no error has occurred since the last call, it returns
NO_ERROR(zero), and the description pointer is set toNULL.Note
- This function may be called before
Init. - This function may be called from any thread.
- The returned string is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the next error occurs or the library is terminated.
- Parameters:
description- where to store the error description pointer, orNULL- Returns:
- the last error code for the calling thread, or
NO_ERROR(zero) - Since:
- version 3.3
- This function may be called before
-
nglfwSetErrorCallback
public static long nglfwSetErrorCallback(long cbfun) Unsafe version of:SetErrorCallback -
glfwSetErrorCallback
Sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.The error code is set before the callback is called. Calling
GetErrorfrom the error callback will return the same value as the error code argument.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.
Note
- This function may be called before
Init. - This function must only be called from the main thread.
- Parameters:
cbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 3.0
- This function may be called before
-
glfwGetPlatform
public static int glfwGetPlatform()Returns the currently selected platform.This function returns the platform that was selected during initialization. The returned value will be one of
PLATFORM_WIN32,PLATFORM_COCOA,PLATFORM_WAYLAND,PLATFORM_X11orPLATFORM_NULL.This function may be called from any thread.
- Returns:
- the currently selected platform, or zero if an error occurred.
Possible errors include
NOT_INITIALIZED. - Since:
- version 3.4
-
glfwPlatformSupported
public static boolean glfwPlatformSupported(int platform) Returns whether the library includes support for the specified platform.This function returns whether the library was compiled with support for the specified platform.
This function may be called before
Init.This function may be called from any thread.
- Parameters:
platform- the platform to query. One of:PLATFORM_WIN32PLATFORM_COCOAPLATFORM_WAYLANDPLATFORM_X11PLATFORM_NULL- Returns:
TRUEif the platform is supported, orFALSEotherwise.Possible errors include
INVALID_ENUM.- Since:
- version 3.4
-
nglfwGetMonitors
public static long nglfwGetMonitors(long count) Unsafe version of:GetMonitors- Parameters:
count- where to store the number of monitors in the returned array. This is set to zero if an error occurred.
-
glfwGetMonitors
public static @Nullable org.lwjgl.PointerBuffer glfwGetMonitors()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 returnsNULL.The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated.
This function must only be called from the main thread.
- Returns:
- an array of monitor handlers, or
NULLif no monitors were found or if an error occurred - Since:
- version 3.0
-
glfwGetPrimaryMonitor
public static long glfwGetPrimaryMonitor()Returns the primary monitor. This is usually the monitor where elements like the task bar or global menu bar are located.This function must only be called from the main thread.
The primary monitor is always first in the array returned by
GetMonitors.- Returns:
- the primary monitor, or
NULLif no monitors were found or if an error occurred - Since:
- version 3.0
-
nglfwGetMonitorPos
public static void nglfwGetMonitorPos(long monitor, long xpos, long ypos) Unsafe version of:GetMonitorPos -
glfwGetMonitorPos
public static void glfwGetMonitorPos(long monitor, @Nullable IntBuffer xpos, @Nullable IntBuffer ypos) Returns the position, in screen coordinates, of the upper-left corner of the specified monitor.Any or all of the position arguments may be
NULL. If an error occurs, all non-NULLposition arguments will be set to zero.This function must only be called from the main thread.
- Parameters:
monitor- the monitor to queryxpos- where to store the monitor x-coordinate, orNULLypos- where to store the monitor y-coordinate, orNULL- Since:
- version 3.0
-
nglfwGetMonitorWorkarea
public static void nglfwGetMonitorWorkarea(long monitor, long xpos, long ypos, long width, long height) Unsafe version of:GetMonitorWorkarea -
glfwGetMonitorWorkarea
public static void glfwGetMonitorWorkarea(long monitor, @Nullable IntBuffer xpos, @Nullable IntBuffer ypos, @Nullable IntBuffer width, @Nullable IntBuffer height) Retrieves the work area of the monitor.This function returns the position, in screen coordinates, of the upper-left corner of the work area of the specified monitor along with the work area size in screen coordinates. The work area is defined as the area of the monitor not occluded by the window system task bar where present. If no task bar exists then the work area is the monitor resolution in screen coordinates.
Any or all of the position and size arguments may be
NULL. If an error occurs, all non-NULLposition and size arguments will be set to zero.This function must only be called from the main thread.
- Parameters:
monitor- the monitor to queryxpos- where to store the working area x-coordinate, orNULLypos- where to store the working area y-coordinate, orNULLwidth- where to store the working area width, orNULLheight- where to store the working area height, orNULL- Since:
- version 3.3
-
nglfwGetMonitorPhysicalSize
public static void nglfwGetMonitorPhysicalSize(long monitor, long widthMM, long heightMM) Unsafe version of:GetMonitorPhysicalSize -
glfwGetMonitorPhysicalSize
public static void glfwGetMonitorPhysicalSize(long monitor, @Nullable IntBuffer widthMM, @Nullable IntBuffer heightMM) Returns the size, in millimetres, of the display area of the specified monitor.Some platforms do not provide accurate monitor size information, either because the monitor EDID data is incorrect or because the driver does not report it accurately.
Any or all of the size arguments may be
NULL. If an error occurs, all non-NULLsize arguments will be set to zero.Note
- This function must only be called from the main thread.
- Windows: On Windows 8 and earlier the physical size is calculated from the current resolution and system DPI instead of querying the monitor EDID data.
- Parameters:
monitor- the monitor to querywidthMM- where to store the width, in millimetres, of the monitor's display area, orNULLheightMM- where to store the height, in millimetres, of the monitor's display area, orNULL- Since:
- version 3.0
-
nglfwGetMonitorContentScale
public static void nglfwGetMonitorContentScale(long monitor, long xscale, long yscale) Unsafe version of:GetMonitorContentScale -
glfwGetMonitorContentScale
public static void glfwGetMonitorContentScale(long monitor, @Nullable FloatBuffer xscale, @Nullable FloatBuffer yscale) Retrieves the content scale for the specified monitor.This function retrieves the content scale for the specified monitor. The content scale is the ratio between the current DPI and the platform's default DPI. This is especially important for text and any UI elements. If the pixel dimensions of your UI scaled by this look appropriate on your machine then it should appear at a reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system DPI and scaling settings being somewhat correct.
The content scale may depend on both the monitor resolution and pixel density and on user settings. It may be very different from the raw DPI calculated from the physical size and current resolution.
Wayland: Fractional scaling information is not yet available for monitors, so this function only returns integer content scales.
This function must only be called from the main thread.
- Parameters:
monitor- the monitor to queryxscale- where to store the x-axis content scale, orNULLyscale- where to store the y-axis content scale, orNULL- Since:
- version 3.3
-
nglfwGetMonitorName
public static long nglfwGetMonitorName(long monitor) Unsafe version of:GetMonitorName -
glfwGetMonitorName
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.The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.
This function must only be called from the main thread.
- Parameters:
monitor- the monitor to query- Returns:
- the UTF-8 encoded name of the monitor, or
NULLif an error occurred - Since:
- version 3.0
-
glfwSetMonitorUserPointer
public static void glfwSetMonitorUserPointer(long monitor, long pointer) Sets the user pointer of the specified monitor.This function sets the user-defined pointer of the specified monitor. The current value is retained until the monitor is disconnected. The initial value is
NULL.This function may be called from the monitor callback, even for a monitor that is being disconnected.
This function may be called from any thread. Access is not synchronized.
- Parameters:
monitor- the monitor whose pointer to setpointer- the new value- Since:
- version 3.3
-
glfwGetMonitorUserPointer
public static long glfwGetMonitorUserPointer(long monitor) Returns the user pointer of the specified monitor.This function returns the current value of the user-defined pointer of the specified monitor. The initial value is
NULL.This function may be called from the monitor callback, even for a monitor that is being disconnected.
This function may be called from any thread. Access is not synchronized.
- Parameters:
monitor- the monitor whose pointer to return- Since:
- version 3.3
-
nglfwSetMonitorCallback
public static long nglfwSetMonitorCallback(long cbfun) Unsafe version of:SetMonitorCallback -
glfwSetMonitorCallback
public static @Nullable GLFWMonitorCallback glfwSetMonitorCallback(@Nullable GLFWMonitorCallbackI cbfun) 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.This function must only be called from the main thread.
- Parameters:
cbfun- the new callback, orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.0
-
nglfwGetVideoModes
public static long nglfwGetVideoModes(long monitor, long count) Unsafe version of:GetVideoModes- Parameters:
count- where to store the number of video modes in the returned array. This is set to zero if an error occurred.
-
glfwGetVideoModes
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), then by resolution area (the product of width and height), then resolution width and finally by refresh rate.
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
This function must only be called from the main thread.
- Parameters:
monitor- the monitor to query- Returns:
- an array of video modes, or
NULLif an error occurred - Since:
- version 1.0
-
nglfwGetVideoMode
public static long nglfwGetVideoMode(long monitor) Unsafe version of:GetVideoMode -
glfwGetVideoMode
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.The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.
This function must only be called from the main thread.
- Parameters:
monitor- the monitor to query- Returns:
- the current mode of the monitor, or
NULLif an error occurred - Since:
- version 3.0
-
glfwSetGamma
public static void glfwSetGamma(long monitor, float gamma) Generates a gamma ramp and sets it for the specified monitor.This function generates an appropriately sized gamma ramp from the specified exponent and then calls
SetGammaRampwith it. The value must be a finite number greater than zero.The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today is usually an approximation of sRGB gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will produce the default (usually sRGB-like) behavior.
For gamma correct rendering with OpenGL or OpenGL ES, see the
SRGB_CAPABLEhint.Notes:
- This function must only be called from the main thread.
- Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits
PLATFORM_ERROR.
- Parameters:
monitor- the monitor whose gamma ramp to setgamma- the desired exponent- Since:
- version 3.0
-
nglfwGetGammaRamp
public static long nglfwGetGammaRamp(long monitor) Unsafe version of:GetGammaRamp -
glfwGetGammaRamp
Returns the current gamma ramp of the specified monitor.The returned structure and its arrays are allocated and freed by GLFW. You should not free them yourself. They are valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
Notes:
- This function must only be called from the main thread.
- Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits
PLATFORM_ERRORwhile returningNULL.
- Parameters:
monitor- the monitor to query- Returns:
- the current gamma ramp, or
NULLif an error occurred - Since:
- version 3.0
-
nglfwSetGammaRamp
public static void nglfwSetGammaRamp(long monitor, long ramp) Unsafe version of:SetGammaRamp -
glfwSetGammaRamp
Sets the current gamma ramp for the specified monitor.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.The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today is usually an approximation of sRGB gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will produce the default (usually sRGB-like) behavior.
For gamma correct rendering with OpenGL or OpenGL ES, see the
SRGB_CAPABLEhint.Note
- This function must only be called from the main thread.
- The size of the specified gamma ramp should match the size of the current ramp for that monitor.
- Windows: The gamma ramp size must be 256.
- Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits
PLATFORM_ERROR. - The specified gamma ramp is copied before this function returns.
- Parameters:
monitor- the monitor whose gamma ramp to setramp- the gamma ramp to use- Since:
- version 3.0
-
glfwDefaultWindowHints
public static void glfwDefaultWindowHints()Resets all window hints to their default values. SeeWindowHintfor details.This function must only be called from the main thread.
- Since:
- version 3.0
-
glfwWindowHint
public static void glfwWindowHint(int hint, int value) Sets hints for the next call toCreateWindow. The hints, once set, retain their values until changed by a call to this function orDefaultWindowHints, or until the library is terminated.Only integer value hints can be set with this function. String value hints are set with
WindowHintString.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.Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.
Supported and default values
This function must only be called from the main thread.
- Parameters:
hint- the window hint to set. One of:value- the new value of the window hint- Since:
- version 2.2
-
nglfwWindowHintString
public static void nglfwWindowHintString(int hint, long value) Unsafe version of:WindowHintString -
glfwWindowHintString
Sets the specified window hint to the desired value.This function sets hints for the next call to
CreateWindow. The hints, once set, retain their values until changed by a call to this function orDefaultWindowHints, or until the library is terminated.Only string type hints can be set with this function. Integer value hints are set with
WindowHint.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.Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.
Supported and default values
Name Default value Supported values COCOA_FRAME_NAME"" A UTF-8 encoded frame autosave name X11_CLASS_NAME"" An ASCII encoded WM_CLASSclass nameX11_INSTANCE_NAME"" An ASCII encoded WM_CLASSinstance nameWAYLAND_APP_ID"" An ASCII encoded Wayland app_idnameThis function must only be called from the main thread.
- Parameters:
hint- the window hint to set. One of:COCOA_FRAME_NAMEX11_CLASS_NAMEX11_INSTANCE_NAMEWAYLAND_APP_IDvalue- the new value of the window hint. The specified string is copied before this function returns.- Since:
- version 3.3
-
glfwWindowHintString
Sets the specified window hint to the desired value.This function sets hints for the next call to
CreateWindow. The hints, once set, retain their values until changed by a call to this function orDefaultWindowHints, or until the library is terminated.Only string type hints can be set with this function. Integer value hints are set with
WindowHint.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.Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.
Supported and default values
Name Default value Supported values COCOA_FRAME_NAME"" A UTF-8 encoded frame autosave name X11_CLASS_NAME"" An ASCII encoded WM_CLASSclass nameX11_INSTANCE_NAME"" An ASCII encoded WM_CLASSinstance nameWAYLAND_APP_ID"" An ASCII encoded Wayland app_idnameThis function must only be called from the main thread.
- Parameters:
hint- the window hint to set. One of:COCOA_FRAME_NAMEX11_CLASS_NAMEX11_INSTANCE_NAMEWAYLAND_APP_IDvalue- the new value of the window hint. The specified string is copied before this function returns.- Since:
- version 3.3
-
nglfwCreateWindow
public static long nglfwCreateWindow(int width, int height, long title, long monitor, long share) Unsafe version of:CreateWindow -
glfwCreateWindow
public static long glfwCreateWindow(int width, int height, ByteBuffer title, long monitor, long share) 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. For information about the
shareparameter, see context sharing.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, use queries like
GetWindowAttribandGetWindowSizeandGetFramebufferSize.To create a full screen window, you need to specify the monitor the window will cover. If no monitor is specified, the window will be windowed mode. Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor. For more information on how to query connected monitors, see monitors.
For full screen windows, the specified size becomes the resolution of the window's desired video mode. As long as a full screen window is not iconified, the supported video mode most closely matching the desired video mode is set for the specified monitor. For more information about full screen windows, including the creation of so called windowed full screen or borderless full screen windows, see full screen.
Once you have created the window, you can switch it between windowed and full screen mode with
SetWindowMonitor. If the window has an OpenGL or OpenGL ES context, it will be unaffected.By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, set the
POSITION_XandPOSITION_Ywindow hints before creation. To restore the default behavior, set either or both hints back toANY_POSITION.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.
Note
- This function must only be called from the main thread.
- Windows: Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.
- Windows: 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, theIDI_APPLICATIONicon will be used instead. To set a different icon, seeSetWindowIcon. - Windows: The context to share resources with may not be current on any other thread.
- The OS only supports core profile contexts for OpenGL versions 3.2 and later. Before creating an OpenGL context of version 3.2 or later you must
set the
OPENGL_PROFILEhint accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS. - macOS: 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.
- macOS: The window frame will not be rendered at full resolution on Retina displays unless the
COCOA_RETINA_FRAMEBUFFERhint isTRUEand theNSHighResolutionCapablekey is enabled in the application bundle'sInfo.plist. For more information, see High Resolution Guidelines for macOS in the Mac Developer Library. - macOS: When activating frame autosaving with
COCOA_FRAME_NAME, the specified window size and position may be overridden by previously saved values. - Wayland: GLFW uses libdecor where available to create its window decorations. This in turn uses server-side XDG decorations where available and provides high quality client-side decorations on compositors like GNOME. If both XDG decorations and libdecor are unavailable, GLFW falls back to a very simple set of window decorations that only support moving, resizing and the window manager's right-click menu.
- 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.
- X11: The class part of the
WM_CLASSwindow property will by default be set to the window title passed to this function. The instance part will use the contents of theRESOURCE_NAMEenvironment variable, if present and not empty, or fall back to the window title. Set theX11_CLASS_NAMEandX11_INSTANCE_NAMEwindow hints to override this.
- Parameters:
width- the desired width, in screen coordinates, of the windowheight- the desired height, in screen coordinates, of the windowtitle- initial, UTF-8 encoded window titlemonitor- the monitor to use for fullscreen mode, orNULLfor windowed modeshare- the window whose context to share resources with, orNULLto not share resources- Returns:
- the handle of the created window, or
NULLif an error occurred - Since:
- version 1.0
-
glfwCreateWindow
public static long glfwCreateWindow(int width, int height, CharSequence title, long monitor, long share) 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. For information about the
shareparameter, see context sharing.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, use queries like
GetWindowAttribandGetWindowSizeandGetFramebufferSize.To create a full screen window, you need to specify the monitor the window will cover. If no monitor is specified, the window will be windowed mode. Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor. For more information on how to query connected monitors, see monitors.
For full screen windows, the specified size becomes the resolution of the window's desired video mode. As long as a full screen window is not iconified, the supported video mode most closely matching the desired video mode is set for the specified monitor. For more information about full screen windows, including the creation of so called windowed full screen or borderless full screen windows, see full screen.
Once you have created the window, you can switch it between windowed and full screen mode with
SetWindowMonitor. If the window has an OpenGL or OpenGL ES context, it will be unaffected.By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, set the
POSITION_XandPOSITION_Ywindow hints before creation. To restore the default behavior, set either or both hints back toANY_POSITION.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.
Note
- This function must only be called from the main thread.
- Windows: Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.
- Windows: 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, theIDI_APPLICATIONicon will be used instead. To set a different icon, seeSetWindowIcon. - Windows: The context to share resources with may not be current on any other thread.
- The OS only supports core profile contexts for OpenGL versions 3.2 and later. Before creating an OpenGL context of version 3.2 or later you must
set the
OPENGL_PROFILEhint accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS. - macOS: 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.
- macOS: The window frame will not be rendered at full resolution on Retina displays unless the
COCOA_RETINA_FRAMEBUFFERhint isTRUEand theNSHighResolutionCapablekey is enabled in the application bundle'sInfo.plist. For more information, see High Resolution Guidelines for macOS in the Mac Developer Library. - macOS: When activating frame autosaving with
COCOA_FRAME_NAME, the specified window size and position may be overridden by previously saved values. - Wayland: GLFW uses libdecor where available to create its window decorations. This in turn uses server-side XDG decorations where available and provides high quality client-side decorations on compositors like GNOME. If both XDG decorations and libdecor are unavailable, GLFW falls back to a very simple set of window decorations that only support moving, resizing and the window manager's right-click menu.
- 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.
- X11: The class part of the
WM_CLASSwindow property will by default be set to the window title passed to this function. The instance part will use the contents of theRESOURCE_NAMEenvironment variable, if present and not empty, or fall back to the window title. Set theX11_CLASS_NAMEandX11_INSTANCE_NAMEwindow hints to override this.
- Parameters:
width- the desired width, in screen coordinates, of the windowheight- the desired height, in screen coordinates, of the windowtitle- initial, UTF-8 encoded window titlemonitor- the monitor to use for fullscreen mode, orNULLfor windowed modeshare- the window whose context to share resources with, orNULLto not share resources- Returns:
- the handle of the created window, or
NULLif an error occurred - Since:
- version 1.0
-
glfwDestroyWindow
public static void glfwDestroyWindow(long window) 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.
Note
- This function must only be called from the main thread.
- This function must not be called from a callback.
- The context of the specified window must not be current on any other thread when this function is called.
- Parameters:
window- the window to destroy- Since:
- version 1.0
-
glfwWindowShouldClose
public static boolean glfwWindowShouldClose(long window) Returns the value of the close flag of the specified window.This function may be called from any thread.
- Parameters:
window- the window to query- Returns:
- the value of the close flag
- Since:
- version 3.0
-
glfwSetWindowShouldClose
public static void glfwSetWindowShouldClose(long window, boolean value) 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.This function may be called from any thread. Access is not synchronized.
- Parameters:
window- the window whose flag to changevalue- the new value- Since:
- version 3.0
-
nglfwGetWindowTitle
public static long nglfwGetWindowTitle(long window) Unsafe version of:GetWindowTitle -
glfwGetWindowTitle
Returns the title of the specified window.This function returns the window title, encoded as UTF-8, of the specified window. This is the title set previously by
CreateWindoworSetWindowTitle.The returned title is currently a copy of the title last set by
CreateWindoworSetWindowTitle. It does not include any additional text which may be appended by the platform or another program.The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to
GetWindowTitleorSetWindowTitle, or until the library is terminated.This function must only be called from the main thread.
- Parameters:
window- the window to query- Returns:
- the UTF-8 encoded window title, or
NULLif an error occurred - Since:
- version 3.4
-
nglfwSetWindowTitle
public static void nglfwSetWindowTitle(long window, long title) Unsafe version of:SetWindowTitle -
glfwSetWindowTitle
Sets the window title, encoded as UTF-8, of the specified window.This function must only be called from the main thread.
macOS: The window title will not be updated until the next time you process events.
- Parameters:
window- the window whose title to changetitle- the UTF-8 encoded window title- Since:
- version 1.0
-
glfwSetWindowTitle
Sets the window title, encoded as UTF-8, of the specified window.This function must only be called from the main thread.
macOS: The window title will not be updated until the next time you process events.
- Parameters:
window- the window whose title to changetitle- the UTF-8 encoded window title- Since:
- version 1.0
-
nglfwSetWindowIcon
public static void nglfwSetWindowIcon(long window, int count, long images) Unsafe version of:SetWindowIcon- Parameters:
count- the number of images in the specified array, or zero to revert to the default window icon
-
glfwSetWindowIcon
Sets the icon for the specified window.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 pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner.
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.
Notes:
- This function must only be called from the main thread.
- The specified image data is copied before this function returns.
- macOS: Regular windows do not have icons on macOS. This function will emit
FEATURE_UNAVAILABLE. 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. - Wayland: There is no existing protocol to change an icon, the window will thus inherit the one defined in the application's desktop file.
This function will emit
FEATURE_UNAVAILABLE.
- Parameters:
window- the window whose icon to setimages- the images to create the icon from. This is ignored if count is zero.- Since:
- version 3.2
-
nglfwGetWindowPos
public static void nglfwGetWindowPos(long window, long xpos, long ypos) Unsafe version of:GetWindowPos -
glfwGetWindowPos
public static void glfwGetWindowPos(long window, @Nullable IntBuffer xpos, @Nullable IntBuffer ypos) Retrieves the position, in screen coordinates, of the upper-left corner of the content area of the specified window.Any or all of the position arguments may be
NULL. If an error occurs, all non-NULLposition arguments will be set to zero.Notes:
- This function must only be called from the main thread.
- Wayland: There is no way for an application to retrieve the global position of its windows. This function will emit
FEATURE_UNAVAILABLE.
- Parameters:
window- the window to queryxpos- where to store the x-coordinate of the upper-left corner of the content area, orNULLypos- where to store the y-coordinate of the upper-left corner of the content area, orNULL- Since:
- version 3.0
-
glfwSetWindowPos
public static void glfwSetWindowPos(long window, int xpos, int ypos) Sets the position, in screen coordinates, of the upper-left corner of the content 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.
Notes:
- This function must only be called from the main thread.
- Wayland: There is no way for an application to set the global position of its windows. This function will emit
FEATURE_UNAVAILABLE.
- Parameters:
window- the window to queryxpos- the x-coordinate of the upper-left corner of the content areaypos- the y-coordinate of the upper-left corner of the content area- Since:
- version 1.0
-
nglfwGetWindowSize
public static void nglfwGetWindowSize(long window, long width, long height) Unsafe version of:GetWindowSize -
glfwGetWindowSize
public static void glfwGetWindowSize(long window, @Nullable IntBuffer width, @Nullable IntBuffer height) Retrieves the size, in screen coordinates, of the content area of the specified window. If you wish to retrieve the size of the framebuffer of the window in pixels, seeGetFramebufferSize.Any or all of the size arguments may be
NULL. If an error occurs, all non-NULLsize arguments will be set to zero.This function must only be called from the main thread.
- Parameters:
window- the window whose size to retrievewidth- where to store the width, in screen coordinates, of the content area, orNULLheight- where to store the height, in screen coordinates, of the content area, orNULL- Since:
- version 1.0
-
glfwSetWindowSizeLimits
public static void glfwSetWindowSizeLimits(long window, int minwidth, int minheight, int maxwidth, int maxheight) Sets the size limits of the content area of the specified window. If the window is full screen, the size limits only take effect if 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.
Notes:
- This function must only be called from the main thread.
- Wayland: The size limits will not be applied until the window is actually resized, either by the user or by the compositor.
- Parameters:
window- the window to set limits forminwidth- the minimum width, in screen coordinates, of the content area, orDONT_CAREminheight- the minimum height, in screen coordinates, of the content area, orDONT_CAREmaxwidth- the maximum width, in screen coordinates, of the content area, orDONT_CAREmaxheight- the maximum height, in screen coordinates, of the content area, orDONT_CARE- Since:
- version 3.2
-
glfwSetWindowAspectRatio
public static void glfwSetWindowAspectRatio(long window, int numer, int denom) Sets the required aspect ratio of the content 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
DONT_CAREthen the aspect ratio limit is disabled.The aspect ratio is applied immediately to a windowed mode window and may cause it to be resized.
Notes:
- This function must only be called from the main thread.
- Wayland: The aspect ratio will not be applied until the window is actually resized, either by the user or by the compositor.
-
glfwSetWindowSize
public static void glfwSetWindowSize(long window, int width, int height) Sets the size, in pixels, of the content 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
SetWindowMonitor.The window manager may put limits on what sizes are allowed. GLFW cannot and should not override these limits.
This function must only be called from the main thread.
- Parameters:
window- the window to resizewidth- the desired width, in screen coordinates, of the window content areaheight- the desired height, in screen coordinates, of the window content area- Since:
- version 1.0
-
nglfwGetFramebufferSize
public static void nglfwGetFramebufferSize(long window, long width, long height) Unsafe version of:GetFramebufferSize -
glfwGetFramebufferSize
public static void glfwGetFramebufferSize(long window, @Nullable IntBuffer width, @Nullable IntBuffer height) 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, seeGetWindowSize.Any or all of the size arguments may be
NULL. If an error occurs, all non-NULLsize arguments will be set to zero.This function must only be called from the main thread.
- Parameters:
window- the window whose framebuffer to querywidth- where to store the width, in pixels, of the framebuffer, orNULLheight- where to store the height, in pixels, of the framebuffer, orNULL- Since:
- version 3.0
-
nglfwGetWindowFrameSize
public static void nglfwGetWindowFrameSize(long window, long left, long top, long right, long bottom) Unsafe version of:GetWindowFrameSize -
glfwGetWindowFrameSize
public static void glfwGetWindowFrameSize(long window, @Nullable IntBuffer left, @Nullable IntBuffer top, @Nullable IntBuffer right, @Nullable IntBuffer bottom) 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.
Any or all of the size arguments may be
NULL. If an error occurs, all non-NULLsize arguments will be set to zero.This function must only be called from the main thread.
- Parameters:
window- the window whose frame size to queryleft- where to store the size, in screen coordinates, of the left edge of the window frame, orNULLtop- where to store the size, in screen coordinates, of the top edge of the window frame, orNULLright- where to store the size, in screen coordinates, of the right edge of the window frame, orNULLbottom- where to store the size, in screen coordinates, of the bottom edge of the window frame, orNULL- Since:
- version 3.1
-
nglfwGetWindowContentScale
public static void nglfwGetWindowContentScale(long window, long xscale, long yscale) Unsafe version of:GetWindowContentScale -
glfwGetWindowContentScale
public static void glfwGetWindowContentScale(long window, @Nullable FloatBuffer xscale, @Nullable FloatBuffer yscale) Retrieves the content scale for the specified window.This function retrieves the content scale for the specified window. The content scale is the ratio between the current DPI and the platform's default DPI. This is especially important for text and any UI elements. If the pixel dimensions of your UI scaled by this look appropriate on your machine then it should appear at a reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system DPI and scaling settings being somewhat correct.
On platforms where each monitor can have its own content scale, the window content scale will depend on which monitor the system considers the window to be on.
- Parameters:
window- the window to queryxscale- where to store the x-axis content scale, orNULLyscale- where to store the y-axis content scale, orNULL- Since:
- version 3.3
-
glfwGetWindowOpacity
public static float glfwGetWindowOpacity(long window) Returns the opacity of the whole window.This function returns the opacity of the window, including any decorations.
The opacity (or alpha) value is a positive finite number between zero and one, where zero is fully transparent and one is fully opaque. If the system does not support whole window transparency, this function always returns one.
The initial opacity value for newly created windows is one.
This function must only be called from the main thread.
- Parameters:
window- the window to query- Returns:
- the opacity value of the specified window
- Since:
- version 3.3
-
glfwSetWindowOpacity
public static void glfwSetWindowOpacity(long window, float opacity) Sets the opacity of the whole window.This function sets the opacity of the window, including any decorations.
The opacity (or alpha) value is a positive finite number between zero and one, where zero is fully transparent and one is fully opaque.
The initial opacity value for newly created windows is one.
A window created with framebuffer transparency may not use whole window transparency. The results of doing this are undefined.
Notes:
- This function must only be called from the main thread.
- Wayland: There is no way to set an opacity factor for a window. This function will emit
FEATURE_UNAVAILABLE.
- Parameters:
window- the window to set the opacity foropacity- the desired opacity of the specified window- Since:
- version 3.3
-
glfwIconifyWindow
public static void glfwIconifyWindow(long window) 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, GLFW restores the original video mode of the monitor. The window's desired video mode is set again when the window is restored.
Notes:
- This function must only be called from the main thread.
- Wayland: Once a window is iconified,
RestoreWindowwon’t be able to restore it. This is a design decision of thexdg-shell.
- Parameters:
window- the window to iconify- Since:
- version 2.1
-
glfwRestoreWindow
public static void glfwRestoreWindow(long window) 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 an iconified full screen window, its desired video mode is set again for its monitor when the window is restored.
This function must only be called from the main thread.
- Parameters:
window- the window to restore- Since:
- version 2.1
-
glfwMaximizeWindow
public static void glfwMaximizeWindow(long window) 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.
This function may only be called from the main thread.
- Parameters:
window- the window to maximize- Since:
- version 3.2
-
glfwShowWindow
public static void glfwShowWindow(long window) 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.By default, windowed mode windows are focused when shown. Set the
FOCUS_ON_SHOWwindow hint to change this behavior for all newly created windows, or change the behavior for an existing window withSetWindowAttrib.Notes:
- This function must only be called from the main thread.
- Wayland: Because Wayland wants every frame of the desktop to be complete, this function does not immediately make the window visible. Instead it will become visible the next time the window framebuffer is updated after this call.
- Parameters:
window- the window to make visible- Since:
- version 3.0
-
glfwHideWindow
public static void glfwHideWindow(long window) 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.This function must only be called from the main thread.
- Parameters:
window- the window to hide- Since:
- version 3.0
-
glfwFocusWindow
public static void glfwFocusWindow(long window) 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
FOCUSEDhint to disable this behavior.Also by default, windowed mode windows are focused when shown with
ShowWindow. Set theFOCUS_ON_SHOWwindow 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.
For a less disruptive way of getting the user's attention, see
RequestWindowAttention.Notes:
- This function must only be called from the main thread.
- Wayland: The compositor will likely ignore focus requests unless another window created by the same application already has input focus.
- Parameters:
window- the window to give input focus- Since:
- version 3.2
-
glfwRequestWindowAttention
public static void glfwRequestWindowAttention(long window) Requests user attention to the specified window.This function requests user attention to the specified window. On platforms where this is not supported, attention is requested to the application as a whole.
Once the user has given attention, usually by focusing the window or application, the system will end the request automatically.
Note
- This function must only be called from the main thread.
- macOS: Attention is requested to the application as a whole, not the specific window.
- Parameters:
window- the window to request attention to- Since:
- version 3.3
-
glfwGetWindowMonitor
public static long glfwGetWindowMonitor(long window) Returns the handle of the monitor that the specified window is in full screen on.This function must only be called from the main thread.
- Parameters:
window- the window to query- Returns:
- the monitor, or
NULLif the window is in windowed mode or an error occurred - Since:
- version 3.0
-
glfwSetWindowMonitor
public static void glfwSetWindowMonitor(long window, long monitor, int xpos, int ypos, int width, int height, int refreshRate) Sets the mode, monitor, video mode and placement of a window.This function sets the monitor that the window uses for full screen mode or, if the monitor is
NULL, makes it windowed mode.When setting a monitor, this function updates the width, height and refresh rate of the desired video mode and switches to the video mode closest to it. The window position is ignored when setting a monitor.
When the monitor is
NULL, the position, width and height are used to place the window content 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.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.
Notes:
- This function must only be called from the main thread.
- Wayland: The desired window position is ignored, as there is no way for an application to set this property.
- Parameters:
window- the window whose monitor, size or video mode to setmonitor- the desired monitor, orNULLto set windowed modexpos- the desired x-coordinate of the upper-left corner of the content areaypos- the desired y-coordinate of the upper-left corner of the content areawidth- the desired with, in screen coordinates, of the content area or video modeheight- the desired height, in screen coordinates, of the content area or video moderefreshRate- the desired refresh rate, in Hz, of the video mode, orDONT_CARE- Since:
- version 3.2
-
glfwGetWindowAttrib
public static int glfwGetWindowAttrib(long window, int attrib) Returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context.This function must only be called from the main thread.
Framebuffer related hints are not window attributes.
Zero is a valid value for many window and context related attributes so you cannot use a return value of zero as an indication of errors. However, this function should not fail as long as it is passed valid arguments and the library has been initialized.
Wayland: The Wayland protocol provides no way to check whether a window is iconfied, so
ICONIFIEDalways returnsFALSE.- Parameters:
window- the window to queryattrib- the window attribute whose value to return. One of:- Returns:
- the value of the attribute, or zero if an error occurred
- Since:
- version 3.0
-
glfwSetWindowAttrib
public static void glfwSetWindowAttrib(long window, int attrib, int value) Sets an attribute of the specified window.This function must only be called from the main thread.
- Parameters:
window- the window to set the attribute forattrib- the attribute to set.Some of these attributes are ignored for full screen windows. The new value will take effect if the window is later made windowed.
Some of these attributes are ignored for windowed mode windows. The new value will take effect if the window is later made full screen.
Calling
GetWindowAttribwill always return the latest value, even if that value is ignored by the current mode of the window.Wayland: The
FLOATINGwindow attribute is not supported. Setting this will emitFEATURE_UNAVAILABLE. One of:DECORATEDRESIZABLEFLOATINGAUTO_ICONIFYFOCUS_ON_SHOWMOUSE_PASSTHROUGHvalue- the value to set- Since:
- version 3.3
-
glfwSetWindowUserPointer
public static void glfwSetWindowUserPointer(long window, long pointer) Sets the user-defined pointer of the specified window. The current value is retained until the window is destroyed. The initial value isNULL.This function may be called from any thread. Access is not synchronized.
- Parameters:
window- the window whose pointer to setpointer- the new value- Since:
- version 3.0
-
glfwGetWindowUserPointer
public static long glfwGetWindowUserPointer(long window) Returns the current value of the user-defined pointer of the specified window. The initial value isNULL.This function may be called from any thread. Access is not synchronized.
- Parameters:
window- the window whose pointer to return- Since:
- version 3.0
-
nglfwSetWindowPosCallback
public static long nglfwSetWindowPosCallback(long window, long cbfun) Unsafe version of:SetWindowPosCallback -
glfwSetWindowPosCallback
public static @Nullable GLFWWindowPosCallback glfwSetWindowPosCallback(long window, @Nullable GLFWWindowPosCallbackI cbfun) Sets the position callback of the specified window, which is called when the window is moved. The callback is provided with the position, in screen coordinates, of the upper-left corner of the content area of the window.Notes:
- This function must only be called from the main thread.
- Wayland: This callback will never be called, as there is no way for an application to know its global position.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 1.0
-
nglfwSetWindowSizeCallback
public static long nglfwSetWindowSizeCallback(long window, long cbfun) Unsafe version of:SetWindowSizeCallback -
glfwSetWindowSizeCallback
public static @Nullable GLFWWindowSizeCallback glfwSetWindowSizeCallback(long window, @Nullable GLFWWindowSizeCallbackI cbfun) 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 content area of the window.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 1.0
-
nglfwSetWindowCloseCallback
public static long nglfwSetWindowCloseCallback(long window, long cbfun) Unsafe version of:SetWindowCloseCallback -
glfwSetWindowCloseCallback
public static @Nullable GLFWWindowCloseCallback glfwSetWindowCloseCallback(long window, @Nullable GLFWWindowCloseCallbackI cbfun) 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.The close callback is not triggered by
DestroyWindow.Note
- This function must only be called from the main thread.
- macOS: Selecting Quit from the application menu will trigger the close callback for all windows.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 2.5
-
nglfwSetWindowRefreshCallback
public static long nglfwSetWindowRefreshCallback(long window, long cbfun) Unsafe version of:SetWindowRefreshCallback -
glfwSetWindowRefreshCallback
public static @Nullable GLFWWindowRefreshCallback glfwSetWindowRefreshCallback(long window, @Nullable GLFWWindowRefreshCallbackI cbfun) Sets the refresh callback of the specified window, which is called when the content 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.
This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 2.5
-
nglfwSetWindowFocusCallback
public static long nglfwSetWindowFocusCallback(long window, long cbfun) Unsafe version of:SetWindowFocusCallback -
glfwSetWindowFocusCallback
public static @Nullable GLFWWindowFocusCallback glfwSetWindowFocusCallback(long window, @Nullable GLFWWindowFocusCallbackI cbfun) 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
SetKeyCallbackandSetMouseButtonCallback.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.0
-
nglfwSetWindowIconifyCallback
public static long nglfwSetWindowIconifyCallback(long window, long cbfun) Unsafe version of:SetWindowIconifyCallback -
glfwSetWindowIconifyCallback
public static @Nullable GLFWWindowIconifyCallback glfwSetWindowIconifyCallback(long window, @Nullable GLFWWindowIconifyCallbackI cbfun) Sets the iconification callback of the specified window, which is called when the window is iconified or restored.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.0
-
nglfwSetWindowMaximizeCallback
public static long nglfwSetWindowMaximizeCallback(long window, long cbfun) Unsafe version of:SetWindowMaximizeCallback -
glfwSetWindowMaximizeCallback
public static @Nullable GLFWWindowMaximizeCallback glfwSetWindowMaximizeCallback(long window, @Nullable GLFWWindowMaximizeCallbackI cbfun) Sets the maximization callback of the specified window, which is called when the window is maximized or restored.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.3
-
nglfwSetFramebufferSizeCallback
public static long nglfwSetFramebufferSizeCallback(long window, long cbfun) Unsafe version of:SetFramebufferSizeCallback -
glfwSetFramebufferSizeCallback
public static @Nullable GLFWFramebufferSizeCallback glfwSetFramebufferSizeCallback(long window, @Nullable GLFWFramebufferSizeCallbackI cbfun) Sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.0
-
nglfwSetWindowContentScaleCallback
public static long nglfwSetWindowContentScaleCallback(long window, long cbfun) Unsafe version of:SetWindowContentScaleCallback -
glfwSetWindowContentScaleCallback
public static @Nullable GLFWWindowContentScaleCallback glfwSetWindowContentScaleCallback(long window, @Nullable GLFWWindowContentScaleCallbackI cbfun) Sets the window content scale callback for the specified window, which is called when the content scale of the specified window changes.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.3
-
glfwPollEvents
public static void glfwPollEvents()Processes all pending events.This function processes only those events that are already in the event queue and then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback 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.
Note
- This function must only be called from the main thread.
- This function must not be called from a callback.
- Since:
- version 1.0
-
glfwWaitEvents
public static void glfwWaitEvents()Waits until events are queued and processes them.This function puts the calling thread to sleep until at least one event is available in the event queue. Once one or more events are available, it behaves exactly like
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.
Event processing is not required for joystick input to work.
Note
- This function must only be called from the main thread.
- This function must not be called from a callback.
- Since:
- version 2.5
-
glfwWaitEventsTimeout
public static void glfwWaitEventsTimeout(double timeout) Waits with timeout until events are queued and processes them.This function puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If 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.The timeout value must be a positive finite number.
Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback 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.
Event processing is not required for joystick input to work.
Note
- This function must only be called from the main thread.
- This function must not be called from a callback.
- Parameters:
timeout- the maximum amount of time, in seconds, to wait- Since:
- version 3.2
-
glfwPostEmptyEvent
public static void glfwPostEmptyEvent()Posts an empty event from the current thread to the main thread event queue, causingWaitEventsorWaitEventsTimeoutto return.This function may be called from any thread.
- Since:
- version 3.1
-
glfwGetInputMode
public static int glfwGetInputMode(long window, int mode) Returns the value of an input option for the specified window.This function must only be called from the main thread.
- Parameters:
window- the window to querymode- the input mode whose value to return. One of:CURSORSTICKY_KEYSSTICKY_MOUSE_BUTTONSLOCK_KEY_MODSRAW_MOUSE_MOTIONUNLIMITED_MOUSE_BUTTONSIME- Returns:
- the input mode value
- Since:
- version 3.0
-
glfwSetInputMode
public static void glfwSetInputMode(long window, int mode, int value) Sets an input option for the specified window.If
modeisCURSOR, the value must be one of the following cursor modes:CURSOR_NORMALmakes the cursor visible and behaving normally.CURSOR_HIDDENmakes the cursor invisible when it is over the content area of the window but does not restrict the cursor from leaving.CURSOR_DISABLEDhides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls.CURSOR_CAPTUREDmakes the cursor visible and confines it to the content area of the window.
If the
modeisSTICKY_KEYS, the value must be eitherTRUEto enable sticky keys, orFALSEto disable it. If sticky keys are enabled, a key press will ensure thatGetKeyreturnsPRESSthe 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
modeisSTICKY_MOUSE_BUTTONS, the value must be eitherTRUEto enable sticky mouse buttons, orFALSEto disable it. If sticky mouse buttons are enabled, a mouse button press will ensure thatGetMouseButtonreturnsPRESSthe 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.If the
modeisLOCK_KEY_MODS, the value must be eitherTRUEto enable lock key modifier bits, orFALSEto disable them. If enabled, callbacks that receive modifier bits will also have theMOD_CAPS_LOCKbit set when the event was generated with Caps Lock on, and theMOD_NUM_LOCKbit when Num Lock was on.If the mode is
RAW_MOUSE_MOTION, the value must be eitherTRUEto enable raw (unscaled and unaccelerated) mouse motion when the cursor is disabled, orFALSEto disable it. If raw motion is not supported, attempting to set this will emitFEATURE_UNAVAILABLE. CallRawMouseMotionSupportedto check for support.If the mode is
UNLIMITED_MOUSE_BUTTONS, the value must be eitherTRUEto disable the mouse button limit when calling the mouse button callback, orFALSEto limit the mouse buttons sent to the callback to the mouse button token values up toMOUSE_BUTTON_LAST.If the mode is
IME, the value must be eitherTRUEto turn on IME, orFALSEto turn off it.This function must only be called from the main thread.
- Parameters:
window- the window whose input mode to setmode- the input mode to set. One of:CURSORSTICKY_KEYSSTICKY_MOUSE_BUTTONSLOCK_KEY_MODSRAW_MOUSE_MOTIONUNLIMITED_MOUSE_BUTTONSIMEvalue- the new value of the specified input mode- Since:
- GFLW 3.0
-
glfwRawMouseMotionSupported
public static boolean glfwRawMouseMotionSupported()Returns whether raw mouse motion is supported.This function returns whether raw mouse motion is supported on the current system. This status does not change after GLFW has been initialized so you only need to check this once. If you attempt to enable raw motion on a system that does not support it,
PLATFORM_ERRORwill be emitted.Raw mouse motion is closer to the actual motion of the mouse across a surface. It is not affected by the scaling and acceleration applied to the motion of the desktop cursor. That processing is suitable for a cursor while raw motion is better for controlling for example a 3D camera. Because of this, raw mouse motion is only provided when the cursor is disabled.
This function must only be called from the main thread.
-
nglfwGetKeyName
public static long nglfwGetKeyName(int key, int scancode) Unsafe version of:GetKeyName -
glfwGetKeyName
Returns the layout-specific name of the specified printable key.This function returns the name of the specified printable key, encoded as UTF-8. This is typically the character that key would produce without any modifier keys, intended for displaying key bindings to the user. For dead keys, it is typically the diacritic it would add to a character.
Do not use this function for text input. You will break text input for many languages even if it happens to work for yours.
If the key is
KEY_UNKNOWN, the scancode is used to identify the key, otherwise the scancode is ignored. If you specify a non-printable key, orKEY_UNKNOWNand a scancode that maps to a non-printable key, this function returnsNULLbut does not emit an error.This behavior allows you to always pass in the arguments in the key callback without modification.
The printable keys are:
KEY_APOSTROPHEKEY_COMMAKEY_MINUSKEY_PERIODKEY_SLASHKEY_SEMICOLONKEY_EQUALKEY_LEFT_BRACKETKEY_RIGHT_BRACKETKEY_BACKSLASHKEY_WORLD_1KEY_WORLD_2KEY_0toKEY_9KEY_AtoKEY_ZKEY_KP_0toKEY_KP_9KEY_KP_DECIMALKEY_KP_DIVIDEKEY_KP_MULTIPLYKEY_KP_SUBTRACTKEY_KP_ADDKEY_KP_EQUAL
Names for printable keys depend on keyboard layout, while names for non-printable keys are the same across layouts but depend on the application language and should be localized along with other user interface text.
The contents of the returned string may change when a keyboard layout change event is received.
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the library is terminated.
This function must only be called from the main thread.
- Parameters:
key- the key to query, orKEY_UNKNOWNscancode- the scancode of the key to query- Returns:
- the UTF-8 encoded, layout-specific name of the key, or
NULL - Since:
- version 3.2
-
glfwGetKeyScancode
public static int glfwGetKeyScancode(int key) Returns the platform dependent scancode of the specified key.This function returns the platform dependent scancode of the specified key. This is intended for platform specific default keybindings.
If the specified key token corresponds to a physical key not supported on the current platform then this method will return
-1. Calling this function with anything other than a key token will return-1and generate anINVALID_ENUMerror.This function may be called from any thread.
- Parameters:
key- any key token- Returns:
- the platform-specific scancode for the key, or
-1if the key is not supported on the current platform or an error occurred - Since:
- version 3.3
-
glfwGetKey
public static int glfwGetKey(long window, int key) Returns the last state reported for the specified key to the specified window. The returned state is one ofPRESSorRELEASE. The actionREPEATis only reported to the key callback.If the
STICKY_KEYSinput mode is enabled, this function returnsPRESSthe 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.
Note
- This function must only be called from the main thread.
KEY_UNKNOWNis not a valid key for this function.
-
glfwGetMouseButton
public static int glfwGetMouseButton(long window, int button) Returns the last state reported for the specified mouse button to the specified window. The returned state is one ofPRESSorRELEASE. The higher-level actionREPEATis only reported to the mouse button callback.If the
STICKY_MOUSE_BUTTONSinput mode is enabled, this function returnsPRESSthe first time you call it for a mouse button that was pressed, even if that mouse button has already been released.The
UNLIMITED_MOUSE_BUTTONSinput mode does not effect the limit on buttons which can be polled with this function.This function must only be called from the main thread.
-
nglfwGetCursorPos
public static void nglfwGetCursorPos(long window, long xpos, long ypos) Unsafe version of:GetCursorPos -
glfwGetCursorPos
public static void glfwGetCursorPos(long window, @Nullable DoubleBuffer xpos, @Nullable DoubleBuffer ypos) Returns the position of the cursor, in screen coordinates, relative to the upper-left corner of the content area of the specified window.If the cursor is disabled (with
CURSOR_DISABLED) then the cursor position is unbounded and limited only by the minimum and maximum values of a double.The coordinates can be converted to their integer equivalents with the
Math.floor(double)function. Casting directly to an integer type works for positive coordinates, but fails for negative ones.Any or all of the position arguments may be
NULL. If an error occurs, all non-NULLposition arguments will be set to zero.This function must only be called from the main thread.
- Parameters:
window- the desired windowxpos- where to store the cursor x-coordinate, relative to the left edge of the content area, orNULLypos- where to store the cursor y-coordinate, relative to the to top edge of the content area, orNULL.- Since:
- version 1.0
-
glfwSetCursorPos
public static void glfwSetCursorPos(long window, double xpos, double ypos) Sets the position, in screen coordinates, of the cursor relative to the upper-left corner of the content 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
CURSOR_DISABLEDcursor mode that hides the cursor, transparently re-centers it and provides unconstrained cursor motion. SeeSetInputModefor more information.If the cursor mode is
CURSOR_DISABLEDthen the cursor position is unconstrained and limited only by the minimum and maximum values of double.Notes:
- This function must only be called from the main thread.
- Wayland: This function will only work when the cursor mode is
CURSOR_DISABLED, otherwise it will emitFEATURE_UNAVAILABLE.
- Parameters:
window- the desired windowxpos- the desired x-coordinate, relative to the left edge of the content areaypos- the desired y-coordinate, relative to the top edge of the content area- Since:
- version 1.0
-
nglfwCreateCursor
public static long nglfwCreateCursor(long image, int xhot, int yhot) Unsafe version of:CreateCursor -
glfwCreateCursor
Creates a new custom cursor image that can be set for a window withSetCursor. The cursor can be destroyed withDestroyCursor. Any remaining cursors are destroyed byTerminate.The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. 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.
Note
- This function must only be called from the main thread.
- The specified image data is copied before this function returns.
- Parameters:
image- the desired cursor imagexhot- the desired x-coordinate, in pixels, of the cursor hotspotyhot- the desired y-coordinate, in pixels, of the cursor hotspot- Returns:
- the handle of the created cursor, or
NULLif an error occurred - Since:
- version 3.1
-
glfwCreateStandardCursor
public static long glfwCreateStandardCursor(int shape) Returns a cursor with a standard shape, that can be set for a window withSetCursor.The images for these cursors come from the system cursor theme and their exact appearance will vary between platforms.
Most of these shapes are guaranteed to exist on every supported platform but a few may not be present. See the table below for details.
Cursor shape Windows macOS X11 Wayland ARROW_CURSORYes Yes Yes Yes IBEAM_CURSORYes Yes Yes Yes CROSSHAIR_CURSORYes Yes Yes Yes POINTING_HAND_CURSORYes Yes Yes Yes RESIZE_EW_CURSORYes Yes Yes Yes RESIZE_NS_CURSORYes Yes Yes Yes RESIZE_NWSE_CURSORYes Yes1 Maybe2 Maybe2 RESIZE_NESW_CURSORYes Yes1 Maybe2 Maybe2 RESIZE_ALL_CURSORYes Yes Yes Yes NOT_ALLOWED_CURSORYes Yes Maybe2 Maybe2 Note
- This uses a private system API and may fail in the future.
- This uses a newer standard that not all cursor themes support.
If the requested shape is not available, this function emits a
CURSOR_UNAVAILABLEerror and returnsNULL.This function must only be called from the main thread.
- Parameters:
shape- one of the standard shapes. One of:ARROW_CURSORIBEAM_CURSORCROSSHAIR_CURSORPOINTING_HAND_CURSORRESIZE_EW_CURSORRESIZE_NS_CURSORRESIZE_NWSE_CURSORRESIZE_NESW_CURSORRESIZE_ALL_CURSORNOT_ALLOWED_CURSOR- Returns:
- a new cursor ready to use or
NULLif an error occurred. Possible errors includeNOT_INITIALIZED,INVALID_ENUM,CURSOR_UNAVAILABLEandPLATFORM_ERROR. - Since:
- version 3.1
-
glfwDestroyCursor
public static void glfwDestroyCursor(long cursor) Destroys a cursor previously created withCreateCursor. Any remaining cursors will be destroyed byTerminate.Note
- This function must only be called from the main thread.
- This function must not be called from a callback.
- Parameters:
cursor- the cursor object to destroy- Since:
- version 3.1
-
glfwSetCursor
public static void glfwSetCursor(long window, long cursor) Sets the cursor image to be used when the cursor is over the content area of the specified window. The set cursor will only be visible when the cursor mode of the window isCURSOR_NORMAL.On some platforms, the set cursor may not be visible unless the window also has input focus.
This function must only be called from the main thread.
- Parameters:
window- the window to set the system cursor forcursor- the cursor to set, orNULLto switch back to the default arrow cursor- Since:
- version 3.1
-
nglfwGetPreeditCursorRectangle
public static void nglfwGetPreeditCursorRectangle(long window, long x, long y, long w, long h) Unsafe version of:GetPreeditCursorRectangle -
glfwGetPreeditCursorRectangle
public static void glfwGetPreeditCursorRectangle(long window, @Nullable IntBuffer x, @Nullable IntBuffer y, @Nullable IntBuffer w, @Nullable IntBuffer h) Retrieves the area of the preedit text cursor.This area is used to decide the position of the candidate window. The cursor position is relative to the window.
This function may only be called from the main thread.
- Parameters:
window- the window to set the preedit text cursor forx- the preedit text cursor x position (relative position from window coordinates)y- the preedit text cursor y position (relative position from window coordinates)w- the preedit text cursor widthh- the preedit text cursor height- Since:
- version 3.X
-
glfwSetPreeditCursorRectangle
public static void glfwSetPreeditCursorRectangle(long window, int x, int y, int w, int h) Sets the area of the preedit text cursor.This area is used to decide the position of the candidate window. The cursor position is relative to the window.
This function may only be called from the main thread.
- Parameters:
window- the window to set the text cursor forx- the preedit text cursor x position (relative position from window coordinates)y- the preedit text cursor y position (relative position from window coordinates)w- the preedit text cursor widthh- the preedit text cursor height- Since:
- version 3.X
-
glfwResetPreeditText
public static void glfwResetPreeditText(long window) Resets IME's preedit text.This function may only be called from the main thread.
Note
- X11: Since over-the-spot style is used by default, you don't need to use this function.
- Wayland: This function is currently not supported.
- Parameters:
window- the window- Since:
- version 3.X
-
nglfwGetPreeditCandidate
public static long nglfwGetPreeditCandidate(long window, int index, long textCount) Unsafe version of:GetPreeditCandidate- Parameters:
textCount- the text-count of the candidate
-
glfwGetPreeditCandidate
Returns the text and the text-count of the preedit candidate.By default, the IME manages the preedit candidates, so there is no need to use this function. See
SetPreeditCandidateCallbackandMANAGE_PREEDIT_CANDIDATEhint for details.This function may only be called from the main thread.
Note
- macOS: This function is currently not supported.
- X11: This function is currently not supported.
- Wayland: This function is currently not supported.
- Parameters:
window- the windowindex- the index of the candidate- Returns:
- the text of the candidate as Unicode code points
- Since:
- version 3.X
-
nglfwSetKeyCallback
public static long nglfwSetKeyCallback(long window, long cbfun) Unsafe version of:SetKeyCallback -
glfwSetKeyCallback
public static @Nullable GLFWKeyCallback glfwSetKeyCallback(long window, @Nullable GLFWKeyCallbackI cbfun) 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
SetCharCallbackinstead.When a window loses input focus, it will generate synthetic key release events for all pressed keys with associated key tokens. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the window focus callback 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
keyset toKEY_UNKNOWN, their state is not saved and so it cannot be queried withGetKey.Sometimes GLFW needs to generate synthetic key events, in which case the scancode may be zero.
This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 1.0
-
nglfwSetCharCallback
public static long nglfwSetCharCallback(long window, long cbfun) Unsafe version of:SetCharCallback -
glfwSetCharCallback
public static @Nullable GLFWCharCallback glfwSetCharCallback(long window, @Nullable GLFWCharCallbackI cbfun) 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
SetKeyCallbackis 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 macOS or Alt key on Windows.
This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 2.4
-
nglfwSetCharModsCallback
public static long nglfwSetCharModsCallback(long window, long cbfun) Unsafe version of:SetCharModsCallback -
glfwSetCharModsCallback
public static @Nullable GLFWCharModsCallback glfwSetCharModsCallback(long window, @Nullable GLFWCharModsCallbackI cbfun) Sets the character with modifiers callback of the specified window, which is called when a Unicode character is input regardless of what modifier keys are used.The character with modifiers callback is intended for implementing custom Unicode character input. For regular Unicode text input, see
SetCharCallback. 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, seeSetKeyCallbackinstead.This function must only be called from the main thread.
Deprecated: scheduled for removal in version 4.0.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 3.1
-
nglfwSetPreeditCallback
public static long nglfwSetPreeditCallback(long window, long cbfun) Unsafe version of:SetPreeditCallback -
glfwSetPreeditCallback
public static @Nullable GLFWPreeditCallback glfwSetPreeditCallback(long window, @Nullable GLFWPreeditCallbackI cbfun) Sets the preedit callback of the specified window, which is called when an IME is processing text before committed.Callback receives relative position of input cursor inside preedit text and attributed text blocks. This callback is used for on-the-spot text editing with IME.
This function must only be called from the main thread.
Note
- X11: Since over-the-spot style is used by default, you don't need to use this function.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or an error occurred - Since:
- version 3.X
-
nglfwSetIMEStatusCallback
public static long nglfwSetIMEStatusCallback(long window, long cbfun) Unsafe version of:SetIMEStatusCallback -
glfwSetIMEStatusCallback
public static @Nullable GLFWIMEStatusCallback glfwSetIMEStatusCallback(long window, @Nullable GLFWIMEStatusCallbackI cbfun) Sets the IME status change callback of the specified window, which is called when an IME is switched on and off.This function must only be called from the main thread.
Note
- X11: Doesn't support this function. The callback is not called.
- Wayland: Doesn't support this function. The callback is not called.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or an error occurred - Since:
- version 3.X
-
nglfwSetPreeditCandidateCallback
public static long nglfwSetPreeditCandidateCallback(long window, long cbfun) Unsafe version of:SetPreeditCandidateCallback -
glfwSetPreeditCandidateCallback
public static @Nullable GLFWPreeditCandidateCallback glfwSetPreeditCandidateCallback(long window, @Nullable GLFWPreeditCandidateCallbackI cbfun) Sets the preedit candidate change callback of the specified window, which is called when the candidates are updated and can be used to display them by the application side.By default, this callback is not called because the IME displays the candidates and there is nothing to do on the application side. Only when the application side needs to use this to manage the displaying of IME candidates, you can set
MANAGE_PREEDIT_CANDIDATEinit hint and stop the IME from managing it.This function must only be called from the main thread.
Note
- macOS: Doesn't support this function. The callback is not called.
- X11: Doesn't support this function. The callback is not called.
- Wayland: Doesn't support this function. The callback is not called.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or an error occurred - Since:
- version 3.X
-
nglfwSetMouseButtonCallback
public static long nglfwSetMouseButtonCallback(long window, long cbfun) Unsafe version of:SetMouseButtonCallback -
glfwSetMouseButtonCallback
public static @Nullable GLFWMouseButtonCallback glfwSetMouseButtonCallback(long window, @Nullable GLFWMouseButtonCallbackI cbfun) 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 with associated button tokens. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the window focus callback has been called.
The reported
buttonvalue can be higher thanMOUSE_BUTTON_LASTif the button does not have an associated button token and theUNLIMITED_MOUSE_BUTTONSinput mode is set.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 1.0
-
nglfwSetCursorPosCallback
public static long nglfwSetCursorPosCallback(long window, long cbfun) Unsafe version of:SetCursorPosCallback -
glfwSetCursorPosCallback
public static @Nullable GLFWCursorPosCallback glfwSetCursorPosCallback(long window, @Nullable GLFWCursorPosCallbackI cbfun) 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 content area of the window.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 1.0
-
nglfwSetCursorEnterCallback
public static long nglfwSetCursorEnterCallback(long window, long cbfun) Unsafe version of:SetCursorEnterCallback -
glfwSetCursorEnterCallback
public static @Nullable GLFWCursorEnterCallback glfwSetCursorEnterCallback(long window, @Nullable GLFWCursorEnterCallbackI cbfun) Sets the cursor boundary crossing callback of the specified window, which is called when the cursor enters or leaves the content area of the window.This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 3.0
-
nglfwSetScrollCallback
public static long nglfwSetScrollCallback(long window, long cbfun) Unsafe version of:SetScrollCallback -
glfwSetScrollCallback
public static @Nullable GLFWScrollCallback glfwSetScrollCallback(long window, @Nullable GLFWScrollCallbackI cbfun) Sets the scroll callback of the specified window, which is called when a scrolling device is used.The scroll callback receives all scrolling input, like that from a mouse wheel or a touchpad scrolling area.
This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 2.1
-
nglfwSetDropCallback
public static long nglfwSetDropCallback(long window, long cbfun) Unsafe version of:SetDropCallback -
glfwSetDropCallback
public static @Nullable GLFWDropCallback glfwSetDropCallback(long window, @Nullable GLFWDropCallbackI cbfun) Sets the file drop callback of the specified window, which is called when one or more dragged files are dropped on the window.Because the path array and its strings may have been generated specifically for that event, they are not guaranteed to be valid after the callback has returned. If you wish to use them after the callback returns, you need to make a deep copy.
This function must only be called from the main thread.
- Parameters:
window- the window whose callback to setcbfun- the new callback orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set - Since:
- version 3.1
-
glfwJoystickPresent
public static boolean glfwJoystickPresent(int jid) Returns whether the specified joystick is present.This function must only be called from the main thread.
-
nglfwGetJoystickAxes
public static long nglfwGetJoystickAxes(int jid, long count) Unsafe version of:GetJoystickAxes- Parameters:
count- where to store the number of axis values in the returned array. This is set to zero if the joystick is not present or an error occurred.
-
glfwGetJoystickAxes
Returns the values of all axes of the specified joystick. Each element in the array is a value between -1.0 and 1.0.If the specified joystick is not present this function will return
NULLbut will not generate an error. This can be used instead of first callingJoystickPresent.The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
This function must only be called from the main thread.
- Parameters:
jid- the joystick to query- Returns:
- an array of axis values, or
NULLif the joystick is not present - Since:
- version 2.2
-
nglfwGetJoystickButtons
public static long nglfwGetJoystickButtons(int jid, long count) Unsafe version of:GetJoystickButtons- Parameters:
count- where to store the number of button states in the returned array. This is set to zero if the joystick is not present or an error occurred.
-
glfwGetJoystickButtons
Returns the state of all buttons of the specified joystick. Each element in the array is eitherPRESSorRELEASE.For backward compatibility with earlier versions that did not have
GetJoystickHats, the button array also includes all hats, each represented as four buttons. The hats are in the same order as returned byGetJoystickHatsand are in the order up, right, down and left. To disable these extra buttons, set theJOYSTICK_HAT_BUTTONSinit hint before initialization.If the specified joystick is not present this function will return
NULLbut will not generate an error. This can be used instead of first callingJoystickPresent.The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
This function must only be called from the main thread.
- Parameters:
jid- the joystick to query- Returns:
- an array of button states, or
NULLif the joystick is not present - Since:
- version 2.2
-
nglfwGetJoystickHats
public static long nglfwGetJoystickHats(int jid, long count) Unsafe version of:GetJoystickHats- Parameters:
count- where to store the number of hat states in the returned array. This is set to zero if the joystick is not present or an error occurred.
-
glfwGetJoystickHats
Returns the state of all hats of the specified joystick.This function returns the state of all hats of the specified joystick. Each element in the array is one of the following values:
Name | Value ------------------- | ------------------------------ GLFW_HAT_CENTERED | 0 GLFW_HAT_UP | 1 GLFW_HAT_RIGHT | 2 GLFW_HAT_DOWN | 4 GLFW_HAT_LEFT | 8 GLFW_HAT_RIGHT_UP | GLFW_HAT_RIGHT | GLFW_HAT_UP GLFW_HAT_RIGHT_DOWN | GLFW_HAT_RIGHT | GLFW_HAT_DOWN GLFW_HAT_LEFT_UP | GLFW_HAT_LEFT | GLFW_HAT_UP GLFW_HAT_LEFT_DOWN | GLFW_HAT_LEFT | GLFW_HAT_DOWNThe diagonal directions are bitwise combinations of the primary (up, right, down and left) directions and you can test for these individually by ANDing it with the corresponding direction.
if (hats[2] & GLFW_HAT_RIGHT) { // State of hat 2 could be right-up, right or right-down }If the specified joystick is not present this function will return
NULLbut will not generate an error. This can be used instead of first callingJoystickPresent.Note
- This function must only be called from the main thread.
- The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
- Parameters:
jid- the joystick to query- Returns:
- an array of hat states, or
NULLif the joystick is not present or an error occurred - Since:
- version 3.3
-
nglfwGetJoystickName
public static long nglfwGetJoystickName(int jid) Unsafe version of:GetJoystickName -
glfwGetJoystickName
Returns the name, encoded as UTF-8, of the specified joystick.If the specified joystick is not present this function will return
NULLbut will not generate an error. This can be used instead of first callingJoystickPresent.The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
This function must only be called from the main thread.
- Parameters:
jid- the joystick to query- Returns:
- the UTF-8 encoded name of the joystick, or
NULLif the joystick is not present - Since:
- version 3.0
-
nglfwGetJoystickGUID
public static long nglfwGetJoystickGUID(int jid) Unsafe version of:GetJoystickGUID -
glfwGetJoystickGUID
Returns the SDL compatible GUID, as a UTF-8 encoded hexadecimal string, of the specified joystick.The GUID is what connects a joystick to a gamepad mapping. A connected joystick will always have a GUID even if there is no gamepad mapping assigned to it.
The GUID uses the format introduced in SDL 2.0.5. This GUID tries to uniquely identify the make and model of a joystick but does not identify a specific unit, e.g. all wired Xbox 360 controllers will have the same GUID on that platform. The GUID for a unit may vary between platforms depending on what hardware information the platform specific APIs provide.
If the specified joystick is not present this function will return
NULLbut will not generate an error. This can be used instead of first callingJoystickPresent.The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the library is terminated.
This function must only be called from the main thread.
- Parameters:
jid- the joystick to query- Returns:
- the UTF-8 encoded GUID of the joystick, or
NULLif the joystick is not present or an error occurred - Since:
- version 3.3
-
glfwSetJoystickUserPointer
public static void glfwSetJoystickUserPointer(int jid, long pointer) Sets the user pointer of the specified joystick.This function sets the user-defined pointer of the specified joystick. The current value is retained until the joystick is disconnected. The initial value is
NULL.This function may be called from the joystick callback, even for a joystick that is being disconnected.
This function may be called from any thread. Access is not synchronized.
- Parameters:
jid- the joystick whose pointer to setpointer- the new value- Since:
- version 3.3
-
glfwGetJoystickUserPointer
public static long glfwGetJoystickUserPointer(int jid) Returns the user pointer of the specified joystick.This function returns the current value of the user-defined pointer of the specified joystick. The initial value is
NULL.This function may be called from the joystick callback, even for a joystick that is being disconnected.
This function may be called from any thread. Access is not synchronized.
- Parameters:
jid- the joystick whose pointer to set- Since:
- version 3.3
-
glfwJoystickIsGamepad
public static boolean glfwJoystickIsGamepad(int jid) Returns whether the specified joystick is both present and has a gamepad mapping.If the specified joystick is present but does not have a gamepad mapping this function will return
falsebut will not generate an error. CallJoystickPresentto check if a joystick is present regardless of whether it has a mapping.This function must only be called from the main thread.
- Parameters:
jid- the joystick id to query- Returns:
trueif a joystick is both present and has a gamepad mapping orfalseotherwise- Since:
- version 3.3
-
nglfwSetJoystickCallback
public static long nglfwSetJoystickCallback(long cbfun) Unsafe version of:SetJoystickCallback -
glfwSetJoystickCallback
public static @Nullable GLFWJoystickCallback glfwSetJoystickCallback(@Nullable GLFWJoystickCallbackI cbfun) 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.For joystick connection and disconnection events to be delivered on all platforms, you need to call one of the event processing functions. Joystick disconnection may also be detected and the callback called by joystick functions. The function will then return whatever it returns if the joystick is not present.
This function must only be called from the main thread.
- Parameters:
cbfun- the new callback, orNULLto remove the currently set callback- Returns:
- the previously set callback, or
NULLif no callback was set or the library had not been initialized - Since:
- version 3.2
-
nglfwUpdateGamepadMappings
public static int nglfwUpdateGamepadMappings(long string) Unsafe version of:UpdateGamepadMappings -
glfwUpdateGamepadMappings
Adds the specified SDL_GameControllerDB gamepad mappings.This function parses the specified ASCII encoded string and updates the internal list with any gamepad mappings it finds. This string may contain either a single gamepad mapping or many mappings separated by newlines. The parser supports the full format of the
gamecontrollerdb.txtsource file including empty lines and comments.See gamepad_mapping for a description of the format.
If there is already a gamepad mapping for a given GUID in the internal list, it will be replaced by the one passed to this function. If the library is terminated and re-initialized the internal list will revert to the built-in default.
This function must only be called from the main thread.
- Parameters:
string- the string containing the gamepad mappings- Returns:
true, orfalseif an error occurred- Since:
- version 3.3
-
nglfwGetGamepadName
public static long nglfwGetGamepadName(int jid) Unsafe version of:GetGamepadName -
glfwGetGamepadName
Returns the human-readable name of the gamepad from the gamepad mapping assigned to the specified joystick.If the specified joystick is not present or does not have a gamepad mapping this function will return
NULLbut will not generate an error. CallJoystickIsGamepadto check if a joystick is present regardless of whether it has a mapping.The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, the gamepad mappings are updated or the library is terminated.
This function must only be called from the main thread.
- Parameters:
jid- the joystick to query- Returns:
- the UTF-8 encoded name of the gamepad, or
NULLif the joystick is not present, does not have a mapping or an error occurred - Since:
- version 3.3
-
nglfwGetGamepadState
public static int nglfwGetGamepadState(int jid, long state) Unsafe version of:GetGamepadState -
glfwGetGamepadState
Retrieves the state of the specified joystick remapped to an Xbox-like gamepad.If the specified joystick is not present or does not have a gamepad mapping this function will return
FALSEbut will not generate an error. CallJoystickPresentto check whether it is present regardless of whether it has a mapping.The Guide button may not be available for input as it is often hooked by the system or the Steam client.
Not all devices have all the buttons or axes provided by
GLFWGamepadState. Unavailable buttons and axes will always reportRELEASEand 0.0 respectively.This function must only be called from the main thread.
- Parameters:
jid- the joystick to querystate- the gamepad input state of the joystick- Returns:
trueif successful, orfalseif no joystick is connected, it has no gamepad mapping or an error occurred- Since:
- version 3.3
-
nglfwSetClipboardString
public static void nglfwSetClipboardString(long window, long string) Unsafe version of:SetClipboardString -
glfwSetClipboardString
Sets the system clipboard to the specified, UTF-8 encoded string.The specified string is copied before this function returns.
Win32: The clipboard on Windows has a single global lock for reading and writing. GLFW tries to acquire it a few times, which is almost always enough. If it cannot acquire the lock then this function emits
PLATFORM_ERRORand returns. It is safe to try this multiple times.This function must only be called from the main thread.
- Parameters:
window- deprecated, any valid window orNULL.string- a UTF-8 encoded string- Since:
- version 3.0
-
glfwSetClipboardString
Sets the system clipboard to the specified, UTF-8 encoded string.The specified string is copied before this function returns.
Win32: The clipboard on Windows has a single global lock for reading and writing. GLFW tries to acquire it a few times, which is almost always enough. If it cannot acquire the lock then this function emits
PLATFORM_ERRORand returns. It is safe to try this multiple times.This function must only be called from the main thread.
- Parameters:
window- deprecated, any valid window orNULL.string- a UTF-8 encoded string- Since:
- version 3.0
-
nglfwGetClipboardString
public static long nglfwGetClipboardString(long window) Unsafe version of:GetClipboardString -
glfwGetClipboardString
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,NULLis returned and aFORMAT_UNAVAILABLEerror is generated.Win32: The clipboard on Windows has a single global lock for reading and writing. GLFW tries to acquire it a few times, which is almost always enough. If it cannot acquire the lock then this function emits
PLATFORM_ERRORand returns. It is safe to try this multiple times.The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to
GetClipboardStringorSetClipboardString, or until the library is terminated.Note
- This function must only be called from the main thread.
- The returned string is allocated and freed by GLFW. You should not free it yourself.
- The returned string is valid only until the next call to
GetClipboardStringorSetClipboardString.
- Parameters:
window- deprecated, any valid window orNULL.- Returns:
- the contents of the clipboard as a UTF-8 encoded string, or
NULLif an error occurred - Since:
- version 3.0
-
glfwGetTime
public static double glfwGetTime()Returns the value of the GLFW timer. Unless the timer has been set usingSetTime, 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 operating system.
This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized with calls to
SetTime.- Returns:
- the current value, in seconds, or zero if an error occurred
- Since:
- version 1.0
-
glfwSetTime
public static void glfwSetTime(double time) 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.The upper limit of the timer is calculated as
floor((264 - 1) / 109)and is due to implementations storing nanoseconds in 64 bits. The limit may be increased in the future.This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized with calls to
GetTime.- Parameters:
time- the new value, in seconds- Since:
- version 2.2
-
glfwGetTimerValue
public static long glfwGetTimerValue()Returns the current value of the raw timer.This function returns the current value of the raw timer, measured in
1 / frequencyseconds. To get the frequency, callGetTimerFrequency.This function may be called from any thread.
- Returns:
- the value of the timer, or zero if an error occurred
- Since:
- version 3.2
-
glfwGetTimerFrequency
public static long glfwGetTimerFrequency()Returns the frequency, in Hz, of the raw timer.This function may be called from any thread.
- Returns:
- the frequency of the timer, in Hz, or zero if an error occurred
- Since:
- version 3.2
-
glfwMakeContextCurrent
public static void glfwMakeContextCurrent(long window) Makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. It can also detach the current context from the calling thread without making a new one current by passing inNULL.A context must only be made current on a single thread at a time and each thread can have only a single current context at a time. Making a context current detaches any previously current context on the calling thread.
When moving a context between threads, you must detach it (make it non-current) on the old thread before making it current on the new one.
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
CONTEXT_RELEASE_BEHAVIORwindow hint.The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a
NO_WINDOW_CONTEXTerror.If the previously current context was created via a different context creation API than the one passed to this function, GLFW will still detach the previous one from its API before making the new one current.
This function may be called from any thread.
- Parameters:
window- the window whose context to make current, orNULLto detach the current context- Since:
- version 3.0
-
glfwGetCurrentContext
public static long glfwGetCurrentContext()Returns the window whose OpenGL or OpenGL ES context is current on the calling thread.This function may be called from any thread.
- Returns:
- the window whose context is current, or
NULLif no window's context is current - Since:
- version 3.0
-
glfwSwapBuffers
public static void glfwSwapBuffers(long window) 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
NO_WINDOW_CONTEXTerror.This function does not apply to Vulkan. If you are rendering with Vulkan,
vkQueuePresentKHRinstead.EGL: The context of the specified window must be current on the calling thread.
This function may be called from any thread.
- Parameters:
window- the window whose buffers to swap- Since:
- version 1.0
-
glfwSwapInterval
public static void glfwSwapInterval(int interval) Sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the timeSwapBufferswas called before swapping the buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization or just vsync.A context that supports either of the WGL_EXT_swap_control_tear and GLX_EXT_swap_control_tear extensions also accepts negative swap intervals, which allows the driver to swap immediately even if a frame arrives a little bit late. You can check for these extensions with
ExtensionSupported. 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
NO_CURRENT_CONTEXTerror.This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead.
Note
- This function may be called from any thread.
- This function is not called during window creation, leaving the swap interval set to whatever is the default for that API. 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.
- Parameters:
interval- the minimum number of screen updates to wait for until the buffers are swapped bySwapBuffers- Since:
- version 1.0
-
nglfwExtensionSupported
public static int nglfwExtensionSupported(long extension) Unsafe version of:ExtensionSupported -
glfwExtensionSupported
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
NO_CURRENT_CONTEXTerror.As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.
This function does not apply to Vulkan. If you are using Vulkan, see
glfwGetRequiredInstanceExtensions,vkEnumerateInstanceExtensionPropertiesandvkEnumerateDeviceExtensionPropertiesinstead.This function may be called from any thread.
-
glfwExtensionSupported
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
NO_CURRENT_CONTEXTerror.As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.
This function does not apply to Vulkan. If you are using Vulkan, see
glfwGetRequiredInstanceExtensions,vkEnumerateInstanceExtensionPropertiesandvkEnumerateDeviceExtensionPropertiesinstead.This function may be called from any thread.
-
nglfwGetProcAddress
public static long nglfwGetProcAddress(long procname) Unsafe version of:GetProcAddress -
glfwGetProcAddress
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
NO_CURRENT_CONTEXTerror.This function does not apply to Vulkan. If you are rendering with Vulkan,
glfwGetInstanceProcAddress,vkGetInstanceProcAddrandvkGetDeviceProcAddrinstead.Note
- The address of a given function is not guaranteed to be the same between contexts.
- This function may return a non-
NULLaddress despite the associated version or extension not being available. Always check the context version or extension string first. - The returned function pointer is valid until the context is destroyed or the library is terminated.
- This function may be called from any thread.
- Parameters:
procname- the ASCII encoded name of the function- Returns:
- the address of the function, or
NULLif an error occurred - Since:
- version 1.0
-
glfwGetProcAddress
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
NO_CURRENT_CONTEXTerror.This function does not apply to Vulkan. If you are rendering with Vulkan,
glfwGetInstanceProcAddress,vkGetInstanceProcAddrandvkGetDeviceProcAddrinstead.Note
- The address of a given function is not guaranteed to be the same between contexts.
- This function may return a non-
NULLaddress despite the associated version or extension not being available. Always check the context version or extension string first. - The returned function pointer is valid until the context is destroyed or the library is terminated.
- This function may be called from any thread.
- Parameters:
procname- the ASCII encoded name of the function- Returns:
- the address of the function, or
NULLif an error occurred - Since:
- version 1.0
-
glfwGetVersion
public static void glfwGetVersion(int @Nullable [] major, int @Nullable [] minor, int @Nullable [] rev) Array version of:GetVersion -
glfwGetMonitorPos
public static void glfwGetMonitorPos(long monitor, int @Nullable [] xpos, int @Nullable [] ypos) Array version of:GetMonitorPos -
glfwGetMonitorWorkarea
public static void glfwGetMonitorWorkarea(long monitor, int @Nullable [] xpos, int @Nullable [] ypos, int @Nullable [] width, int @Nullable [] height) Array version of:GetMonitorWorkarea -
glfwGetMonitorPhysicalSize
public static void glfwGetMonitorPhysicalSize(long monitor, int @Nullable [] widthMM, int @Nullable [] heightMM) Array version of:GetMonitorPhysicalSize -
glfwGetMonitorContentScale
public static void glfwGetMonitorContentScale(long monitor, float @Nullable [] xscale, float @Nullable [] yscale) Array version of:GetMonitorContentScale -
glfwGetWindowPos
public static void glfwGetWindowPos(long window, int @Nullable [] xpos, int @Nullable [] ypos) Array version of:GetWindowPos -
glfwGetWindowSize
public static void glfwGetWindowSize(long window, int @Nullable [] width, int @Nullable [] height) Array version of:GetWindowSize -
glfwGetFramebufferSize
public static void glfwGetFramebufferSize(long window, int @Nullable [] width, int @Nullable [] height) Array version of:GetFramebufferSize -
glfwGetWindowFrameSize
public static void glfwGetWindowFrameSize(long window, int @Nullable [] left, int @Nullable [] top, int @Nullable [] right, int @Nullable [] bottom) Array version of:GetWindowFrameSize -
glfwGetWindowContentScale
public static void glfwGetWindowContentScale(long window, float @Nullable [] xscale, float @Nullable [] yscale) Array version of:GetWindowContentScale -
glfwGetCursorPos
public static void glfwGetCursorPos(long window, double @Nullable [] xpos, double @Nullable [] ypos) Array version of:GetCursorPos -
glfwGetPreeditCursorRectangle
public static void glfwGetPreeditCursorRectangle(long window, int @Nullable [] x, int @Nullable [] y, int @Nullable [] w, int @Nullable [] h) Array version of:GetPreeditCursorRectangle
-