Class GLFW

java.lang.Object
overrungl.glfw.GLFW

public final class GLFW extends Object
GLFW relies on preview features of the Java platform:
Programs can only use GLFW when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
The GLFW binding.
Since:
0.1.0
Author:
squid233
  • Field Details

    • VERSION_MAJOR

      public static final int VERSION_MAJOR
      The major version number of the GLFW header.

      This is incremented when the API is changed in non-compatible ways.

      See Also:
    • VERSION_MINOR

      public static final int VERSION_MINOR
      The minor version number of the GLFW header.

      This is incremented when features are added to the API, but it remains backward-compatible.

      See Also:
    • VERSION_REVISION

      public static final int VERSION_REVISION
      The 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:
    • TRUE

      public static final int TRUE
      One.

      This is only semantic sugar for the number 1. You can instead use 1 or true or _True or GL_TRUE or VK_TRUE or anything else that is equal to one.

      See Also:
    • FALSE

      public static final int FALSE
      Zero.

      This is only semantic sugar for the number 0. You can instead use 0 or false or _False or GL_FALSE or VK_FALSE or anything else that is equal to zero.

      See Also:
    • RELEASE

      public static final int RELEASE
      The key or mouse button was released.
      See Also:
    • PRESS

      public static final int PRESS
      The key or mouse button was pressed.
      See Also:
    • REPEAT

      public static final int REPEAT
      The key was held down until it repeated.
      See Also:
    • HAT_CENTERED

      public static final int HAT_CENTERED
      Joystick hat states.
      See Also:
    • HAT_UP

      public static final int HAT_UP
      Joystick hat states.
      See Also:
    • HAT_RIGHT

      public static final int HAT_RIGHT
      Joystick hat states.
      See Also:
    • HAT_DOWN

      public static final int HAT_DOWN
      Joystick hat states.
      See Also:
    • HAT_LEFT

      public static final int HAT_LEFT
      Joystick hat states.
      See Also:
    • HAT_RIGHT_UP

      public static final int HAT_RIGHT_UP
      Joystick hat states.
      See Also:
    • HAT_RIGHT_DOWN

      public static final int HAT_RIGHT_DOWN
      Joystick hat states.
      See Also:
    • HAT_LEFT_UP

      public static final int HAT_LEFT_UP
      Joystick hat states.
      See Also:
    • HAT_LEFT_DOWN

      public static final int HAT_LEFT_DOWN
      Joystick hat states.
      See Also:
    • KEY_UNKNOWN

      public static final int KEY_UNKNOWN
      The unknown key
      See Also:
    • KEY_SPACE

      public static final int KEY_SPACE
      Printable keys
      See Also:
    • KEY_APOSTROPHE

      public static final int KEY_APOSTROPHE
      Printable keys
      See Also:
    • KEY_COMMA

      public static final int KEY_COMMA
      Printable keys
      See Also:
    • KEY_MINUS

      public static final int KEY_MINUS
      Printable keys
      See Also:
    • KEY_PERIOD

      public static final int KEY_PERIOD
      Printable keys
      See Also:
    • KEY_SLASH

      public static final int KEY_SLASH
      Printable keys
      See Also:
    • KEY_0

      public static final int KEY_0
      Printable keys
      See Also:
    • KEY_1

      public static final int KEY_1
      Printable keys
      See Also:
    • KEY_2

      public static final int KEY_2
      Printable keys
      See Also:
    • KEY_3

      public static final int KEY_3
      Printable keys
      See Also:
    • KEY_4

      public static final int KEY_4
      Printable keys
      See Also:
    • KEY_5

      public static final int KEY_5
      Printable keys
      See Also:
    • KEY_6

      public static final int KEY_6
      Printable keys
      See Also:
    • KEY_7

      public static final int KEY_7
      Printable keys
      See Also:
    • KEY_8

      public static final int KEY_8
      Printable keys
      See Also:
    • KEY_9

      public static final int KEY_9
      Printable keys
      See Also:
    • KEY_SEMICOLON

      public static final int KEY_SEMICOLON
      Printable keys
      See Also:
    • KEY_EQUAL

      public static final int KEY_EQUAL
      Printable keys
      See Also:
    • KEY_A

      public static final int KEY_A
      Printable keys
      See Also:
    • KEY_B

      public static final int KEY_B
      Printable keys
      See Also:
    • KEY_C

      public static final int KEY_C
      Printable keys
      See Also:
    • KEY_D

      public static final int KEY_D
      Printable keys
      See Also:
    • KEY_E

      public static final int KEY_E
      Printable keys
      See Also:
    • KEY_F

      public static final int KEY_F
      Printable keys
      See Also:
    • KEY_G

      public static final int KEY_G
      Printable keys
      See Also:
    • KEY_H

      public static final int KEY_H
      Printable keys
      See Also:
    • KEY_I

      public static final int KEY_I
      Printable keys
      See Also:
    • KEY_J

      public static final int KEY_J
      Printable keys
      See Also:
    • KEY_K

      public static final int KEY_K
      Printable keys
      See Also:
    • KEY_L

      public static final int KEY_L
      Printable keys
      See Also:
    • KEY_M

      public static final int KEY_M
      Printable keys
      See Also:
    • KEY_N

      public static final int KEY_N
      Printable keys
      See Also:
    • KEY_O

      public static final int KEY_O
      Printable keys
      See Also:
    • KEY_P

      public static final int KEY_P
      Printable keys
      See Also:
    • KEY_Q

      public static final int KEY_Q
      Printable keys
      See Also:
    • KEY_R

      public static final int KEY_R
      Printable keys
      See Also:
    • KEY_S

      public static final int KEY_S
      Printable keys
      See Also:
    • KEY_T

      public static final int KEY_T
      Printable keys
      See Also:
    • KEY_U

      public static final int KEY_U
      Printable keys
      See Also:
    • KEY_V

      public static final int KEY_V
      Printable keys
      See Also:
    • KEY_W

      public static final int KEY_W
      Printable keys
      See Also:
    • KEY_X

      public static final int KEY_X
      Printable keys
      See Also:
    • KEY_Y

      public static final int KEY_Y
      Printable keys
      See Also:
    • KEY_Z

      public static final int KEY_Z
      Printable keys
      See Also:
    • KEY_LEFT_BRACKET

      public static final int KEY_LEFT_BRACKET
      Printable keys
      See Also:
    • KEY_BACKSLASH

      public static final int KEY_BACKSLASH
      Printable keys
      See Also:
    • KEY_RIGHT_BRACKET

      public static final int KEY_RIGHT_BRACKET
      Printable keys
      See Also:
    • KEY_GRAVE_ACCENT

      public static final int KEY_GRAVE_ACCENT
      Printable keys
      See Also:
    • KEY_WORLD_1

      public static final int KEY_WORLD_1
      Printable keys
      See Also:
    • KEY_WORLD_2

      public static final int KEY_WORLD_2
      Printable keys
      See Also:
    • KEY_ESCAPE

      public static final int KEY_ESCAPE
      Function keys
      See Also:
    • KEY_ENTER

      public static final int KEY_ENTER
      Function keys
      See Also:
    • KEY_TAB

      public static final int KEY_TAB
      Function keys
      See Also:
    • KEY_BACKSPACE

      public static final int KEY_BACKSPACE
      Function keys
      See Also:
    • KEY_INSERT

      public static final int KEY_INSERT
      Function keys
      See Also:
    • KEY_DELETE

      public static final int KEY_DELETE
      Function keys
      See Also:
    • KEY_RIGHT

      public static final int KEY_RIGHT
      Function keys
      See Also:
    • KEY_LEFT

      public static final int KEY_LEFT
      Function keys
      See Also:
    • KEY_DOWN

      public static final int KEY_DOWN
      Function keys
      See Also:
    • KEY_UP

      public static final int KEY_UP
      Function keys
      See Also:
    • KEY_PAGE_UP

      public static final int KEY_PAGE_UP
      Function keys
      See Also:
    • KEY_PAGE_DOWN

      public static final int KEY_PAGE_DOWN
      Function keys
      See Also:
    • KEY_HOME

      public static final int KEY_HOME
      Function keys
      See Also:
    • KEY_END

      public static final int KEY_END
      Function keys
      See Also:
    • KEY_CAPS_LOCK

      public static final int KEY_CAPS_LOCK
      Function keys
      See Also:
    • KEY_SCROLL_LOCK

      public static final int KEY_SCROLL_LOCK
      Function keys
      See Also:
    • KEY_NUM_LOCK

      public static final int KEY_NUM_LOCK
      Function keys
      See Also:
    • KEY_PRINT_SCREEN

      public static final int KEY_PRINT_SCREEN
      Function keys
      See Also:
    • KEY_PAUSE

      public static final int KEY_PAUSE
      Function keys
      See Also:
    • KEY_F1

      public static final int KEY_F1
      Function keys
      See Also:
    • KEY_F2

      public static final int KEY_F2
      Function keys
      See Also:
    • KEY_F3

      public static final int KEY_F3
      Function keys
      See Also:
    • KEY_F4

      public static final int KEY_F4
      Function keys
      See Also:
    • KEY_F5

      public static final int KEY_F5
      Function keys
      See Also:
    • KEY_F6

      public static final int KEY_F6
      Function keys
      See Also:
    • KEY_F7

      public static final int KEY_F7
      Function keys
      See Also:
    • KEY_F8

      public static final int KEY_F8
      Function keys
      See Also:
    • KEY_F9

      public static final int KEY_F9
      Function keys
      See Also:
    • KEY_F10

      public static final int KEY_F10
      Function keys
      See Also:
    • KEY_F11

      public static final int KEY_F11
      Function keys
      See Also:
    • KEY_F12

      public static final int KEY_F12
      Function keys
      See Also:
    • KEY_F13

      public static final int KEY_F13
      Function keys
      See Also:
    • KEY_F14

      public static final int KEY_F14
      Function keys
      See Also:
    • KEY_F15

      public static final int KEY_F15
      Function keys
      See Also:
    • KEY_F16

      public static final int KEY_F16
      Function keys
      See Also:
    • KEY_F17

      public static final int KEY_F17
      Function keys
      See Also:
    • KEY_F18

      public static final int KEY_F18
      Function keys
      See Also:
    • KEY_F19

      public static final int KEY_F19
      Function keys
      See Also:
    • KEY_F20

      public static final int KEY_F20
      Function keys
      See Also:
    • KEY_F21

      public static final int KEY_F21
      Function keys
      See Also:
    • KEY_F22

      public static final int KEY_F22
      Function keys
      See Also:
    • KEY_F23

      public static final int KEY_F23
      Function keys
      See Also:
    • KEY_F24

      public static final int KEY_F24
      Function keys
      See Also:
    • KEY_F25

      public static final int KEY_F25
      Function keys
      See Also:
    • KEY_KP_0

      public static final int KEY_KP_0
      Function keys
      See Also:
    • KEY_KP_1

      public static final int KEY_KP_1
      Function keys
      See Also:
    • KEY_KP_2

      public static final int KEY_KP_2
      Function keys
      See Also:
    • KEY_KP_3

      public static final int KEY_KP_3
      Function keys
      See Also:
    • KEY_KP_4

      public static final int KEY_KP_4
      Function keys
      See Also:
    • KEY_KP_5

      public static final int KEY_KP_5
      Function keys
      See Also:
    • KEY_KP_6

      public static final int KEY_KP_6
      Function keys
      See Also:
    • KEY_KP_7

      public static final int KEY_KP_7
      Function keys
      See Also:
    • KEY_KP_8

      public static final int KEY_KP_8
      Function keys
      See Also:
    • KEY_KP_9

      public static final int KEY_KP_9
      Function keys
      See Also:
    • KEY_KP_DECIMAL

      public static final int KEY_KP_DECIMAL
      Function keys
      See Also:
    • KEY_KP_DIVIDE

      public static final int KEY_KP_DIVIDE
      Function keys
      See Also:
    • KEY_KP_MULTIPLY

      public static final int KEY_KP_MULTIPLY
      Function keys
      See Also:
    • KEY_KP_SUBTRACT

      public static final int KEY_KP_SUBTRACT
      Function keys
      See Also:
    • KEY_KP_ADD

      public static final int KEY_KP_ADD
      Function keys
      See Also:
    • KEY_KP_ENTER

      public static final int KEY_KP_ENTER
      Function keys
      See Also:
    • KEY_KP_EQUAL

      public static final int KEY_KP_EQUAL
      Function keys
      See Also:
    • KEY_LEFT_SHIFT

      public static final int KEY_LEFT_SHIFT
      Function keys
      See Also:
    • KEY_LEFT_CONTROL

      public static final int KEY_LEFT_CONTROL
      Function keys
      See Also:
    • KEY_LEFT_ALT

      public static final int KEY_LEFT_ALT
      Function keys
      See Also:
    • KEY_LEFT_SUPER

      public static final int KEY_LEFT_SUPER
      Function keys
      See Also:
    • KEY_RIGHT_SHIFT

      public static final int KEY_RIGHT_SHIFT
      Function keys
      See Also:
    • KEY_RIGHT_CONTROL

      public static final int KEY_RIGHT_CONTROL
      Function keys
      See Also:
    • KEY_RIGHT_ALT

      public static final int KEY_RIGHT_ALT
      Function keys
      See Also:
    • KEY_RIGHT_SUPER

      public static final int KEY_RIGHT_SUPER
      Function keys
      See Also:
    • KEY_MENU

      public static final int KEY_MENU
      Function keys
      See Also:
    • KEY_LAST

      public static final int KEY_LAST
      See Also:
    • MOD_SHIFT

      public static final int MOD_SHIFT
      If this bit is set one or more Shift keys were held down.
      See Also:
    • MOD_CONTROL

      public static final int MOD_CONTROL
      If this bit is set one or more Control keys were held down.
      See Also:
    • MOD_ALT

      public static final int MOD_ALT
      If this bit is set one or more Alt keys were held down.
      See Also:
    • MOD_SUPER

      public static final int MOD_SUPER
      If this bit is set one or more Super keys were held down.
      See Also:
    • MOD_CAPS_LOCK

      public static final int MOD_CAPS_LOCK
      If this bit is set the Caps Lock key is enabled and the LOCK_KEY_MODS input mode is set.
      See Also:
    • MOD_NUM_LOCK

      public static final int MOD_NUM_LOCK
      If this bit is set the Num Lock key is enabled and the LOCK_KEY_MODS input mode is set.
      See Also:
    • MOUSE_BUTTON_1

      public static final int MOUSE_BUTTON_1
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_2

      public static final int MOUSE_BUTTON_2
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_3

      public static final int MOUSE_BUTTON_3
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_4

      public static final int MOUSE_BUTTON_4
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_5

      public static final int MOUSE_BUTTON_5
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_6

      public static final int MOUSE_BUTTON_6
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_7

      public static final int MOUSE_BUTTON_7
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_8

      public static final int MOUSE_BUTTON_8
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_LAST

      public static final int MOUSE_BUTTON_LAST
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_LEFT

      public static final int MOUSE_BUTTON_LEFT
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_RIGHT

      public static final int MOUSE_BUTTON_RIGHT
      Mouse button IDs.
      See Also:
    • MOUSE_BUTTON_MIDDLE

      public static final int MOUSE_BUTTON_MIDDLE
      Mouse button IDs.
      See Also:
    • JOYSTICK_1

      public static final int JOYSTICK_1
      Joystick IDs.
      See Also:
    • JOYSTICK_2

      public static final int JOYSTICK_2
      Joystick IDs.
      See Also:
    • JOYSTICK_3

      public static final int JOYSTICK_3
      Joystick IDs.
      See Also:
    • JOYSTICK_4

      public static final int JOYSTICK_4
      Joystick IDs.
      See Also:
    • JOYSTICK_5

      public static final int JOYSTICK_5
      Joystick IDs.
      See Also:
    • JOYSTICK_6

      public static final int JOYSTICK_6
      Joystick IDs.
      See Also:
    • JOYSTICK_7

      public static final int JOYSTICK_7
      Joystick IDs.
      See Also:
    • JOYSTICK_8

      public static final int JOYSTICK_8
      Joystick IDs.
      See Also:
    • JOYSTICK_9

      public static final int JOYSTICK_9
      Joystick IDs.
      See Also:
    • JOYSTICK_10

      public static final int JOYSTICK_10
      Joystick IDs.
      See Also:
    • JOYSTICK_11

      public static final int JOYSTICK_11
      Joystick IDs.
      See Also:
    • JOYSTICK_12

      public static final int JOYSTICK_12
      Joystick IDs.
      See Also:
    • JOYSTICK_13

      public static final int JOYSTICK_13
      Joystick IDs.
      See Also:
    • JOYSTICK_14

      public static final int JOYSTICK_14
      Joystick IDs.
      See Also:
    • JOYSTICK_15

      public static final int JOYSTICK_15
      Joystick IDs.
      See Also:
    • JOYSTICK_16

      public static final int JOYSTICK_16
      Joystick IDs.
      See Also:
    • JOYSTICK_LAST

      public static final int JOYSTICK_LAST
      Joystick IDs.
      See Also:
    • GAMEPAD_BUTTON_A

      public static final int GAMEPAD_BUTTON_A
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_B

      public static final int GAMEPAD_BUTTON_B
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_X

      public static final int GAMEPAD_BUTTON_X
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_Y

      public static final int GAMEPAD_BUTTON_Y
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_LEFT_BUMPER

      public static final int GAMEPAD_BUTTON_LEFT_BUMPER
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_RIGHT_BUMPER

      public static final int GAMEPAD_BUTTON_RIGHT_BUMPER
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_BACK

      public static final int GAMEPAD_BUTTON_BACK
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_START

      public static final int GAMEPAD_BUTTON_START
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_GUIDE

      public static final int GAMEPAD_BUTTON_GUIDE
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_LEFT_THUMB

      public static final int GAMEPAD_BUTTON_LEFT_THUMB
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_RIGHT_THUMB

      public static final int GAMEPAD_BUTTON_RIGHT_THUMB
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_DPAD_UP

      public static final int GAMEPAD_BUTTON_DPAD_UP
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_DPAD_RIGHT

      public static final int GAMEPAD_BUTTON_DPAD_RIGHT
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_DPAD_DOWN

      public static final int GAMEPAD_BUTTON_DPAD_DOWN
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_DPAD_LEFT

      public static final int GAMEPAD_BUTTON_DPAD_LEFT
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_LAST

      public static final int GAMEPAD_BUTTON_LAST
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_CROSS

      public static final int GAMEPAD_BUTTON_CROSS
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_CIRCLE

      public static final int GAMEPAD_BUTTON_CIRCLE
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_SQUARE

      public static final int GAMEPAD_BUTTON_SQUARE
      Gamepad buttons.
      See Also:
    • GAMEPAD_BUTTON_TRIANGLE

      public static final int GAMEPAD_BUTTON_TRIANGLE
      Gamepad buttons.
      See Also:
    • GAMEPAD_AXIS_LEFT_X

      public static final int GAMEPAD_AXIS_LEFT_X
      Gamepad axes.
      See Also:
    • GAMEPAD_AXIS_LEFT_Y

      public static final int GAMEPAD_AXIS_LEFT_Y
      Gamepad axes.
      See Also:
    • GAMEPAD_AXIS_RIGHT_X

      public static final int GAMEPAD_AXIS_RIGHT_X
      Gamepad axes.
      See Also:
    • GAMEPAD_AXIS_RIGHT_Y

      public static final int GAMEPAD_AXIS_RIGHT_Y
      Gamepad axes.
      See Also:
    • GAMEPAD_AXIS_LEFT_TRIGGER

      public static final int GAMEPAD_AXIS_LEFT_TRIGGER
      Gamepad axes.
      See Also:
    • GAMEPAD_AXIS_RIGHT_TRIGGER

      public static final int GAMEPAD_AXIS_RIGHT_TRIGGER
      Gamepad axes.
      See Also:
    • GAMEPAD_AXIS_LAST

      public static final int GAMEPAD_AXIS_LAST
      Gamepad axes.
      See Also:
    • NO_ERROR

      public static final int NO_ERROR
      No error has occurred.

      Analysis

      Yay.
      See Also:
    • NOT_INITIALIZED

      public static final int NOT_INITIALIZED
      GLFW has not been initialized.

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

      Analysis

      Application programmer error. Initialize GLFW before calling any function that requires initialization.
      See Also:
    • NO_CURRENT_CONTEXT

      public static final int 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 @ref glfwSwapInterval.

      Analysis

      Application programmer error. Ensure a context is current before calling functions that require a current context.
      See Also:
    • INVALID_ENUM

      public static final int INVALID_ENUM
      One of the arguments to the function was an invalid enum value, for example requesting RED_BITS with getWindowAttrib(java.lang.foreign.MemorySegment, int)PREVIEW.

      Analysis

      Application programmer error. Fix the offending call.
      See Also:
    • INVALID_VALUE

      public static final int 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_UNAVAILABLE error.

      Analysis

      Application programmer error. Fix the offending call.
      See Also:
    • OUT_OF_MEMORY

      public static final int OUT_OF_MEMORY
      A memory allocation failed.

      Analysis

      A bug in GLFW or the underlying operating system. Report the bug to the issue tracker.
      See Also:
    • API_UNAVAILABLE

      public static final int API_UNAVAILABLE
      GLFW could not find support for the requested API on the system.

      Analysis

      The installed graphics driver does not support the requested API, or does not support it via the chosen context creation backend. 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.

      See Also:
    • VERSION_UNAVAILABLE

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

      Analysis

      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.

      See Also:
    • PLATFORM_ERROR

      public static final int PLATFORM_ERROR
      A platform-specific error occurred that does not match any of the more specific categories.

      Analysis

      A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to the issue tracker.
      See Also:
    • FORMAT_UNAVAILABLE

      public static final int FORMAT_UNAVAILABLE
      The requested format is not supported or available.

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

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

      Analysis

      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.

      See Also:
    • NO_WINDOW_CONTEXT

      public static final int 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.

      Analysis

      Application programmer error. Fix the offending call.
      See Also:
    • FOCUSED

      public static final int FOCUSED
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • ICONIFIED

      public static final int ICONIFIED
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • RESIZABLE

      public static final int RESIZABLE
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • VISIBLE

      public static final int VISIBLE
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • DECORATED

      public static final int DECORATED
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • AUTO_ICONIFY

      public static final int AUTO_ICONIFY
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • FLOATING

      public static final int FLOATING
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • MAXIMIZED

      public static final int MAXIMIZED
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • CENTER_CURSOR

      public static final int CENTER_CURSOR
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • TRANSPARENT_FRAMEBUFFER

      public static final int TRANSPARENT_FRAMEBUFFER
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • FOCUS_ON_SHOW

      public static final int FOCUS_ON_SHOW
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • SCALE_TO_MONITOR

      public static final int SCALE_TO_MONITOR
      • RESIZABLE: specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the setWindowSize(java.lang.foreign.MemorySegment, int, int)PREVIEW function. Possible values are TRUE and FALSE. This hint is ignored for full screen and undecorated windows.
      • VISIBLE: specifies whether the windowed mode window will be initially visible. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • DECORATED: specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window will not be resizable by the user but will still allow the user to generate close events on some platforms. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • FOCUSED: specifies whether the windowed mode window will be given input focus when created. Possible values are TRUE and FALSE. This hint is ignored for full screen and initially hidden windows.
      • AUTO_ICONIFY: specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • FLOATING: specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • MAXIMIZED: specifies whether the windowed mode window will be maximized when created. Possible values are TRUE and FALSE. This hint is ignored for full screen windows.
      • CENTER_CURSOR: specifies whether the cursor should be centered over newly created full screen windows. Possible values are TRUE and FALSE. This hint is ignored for windowed mode windows.
      • TRANSPARENT_FRAMEBUFFER: 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. Possible values are TRUE and FALSE.
      • FOCUS_ON_SHOW: specifies whether the window will be given input focus when showWindow(java.lang.foreign.MemorySegment)PREVIEW is called. Possible values are TRUE and FALSE.
      • SCALE_TO_MONITOR: specified 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 are TRUE and FALSE.

        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.

      See Also:
    • HOVERED

      public static final int HOVERED
      HOVERED indicates whether the cursor is currently directly over the content area of the window, with no other windows between. See Cursor enter/leave events for details.
      See Also:
    • RED_BITS

      public static final int RED_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • GREEN_BITS

      public static final int GREEN_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • BLUE_BITS

      public static final int BLUE_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • ALPHA_BITS

      public static final int ALPHA_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • DEPTH_BITS

      public static final int DEPTH_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • STENCIL_BITS

      public static final int STENCIL_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • ACCUM_RED_BITS

      public static final int ACCUM_RED_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • ACCUM_GREEN_BITS

      public static final int ACCUM_GREEN_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • ACCUM_BLUE_BITS

      public static final int ACCUM_BLUE_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • ACCUM_ALPHA_BITS

      public static final int ACCUM_ALPHA_BITS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • AUX_BUFFERS

      public static final int AUX_BUFFERS
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • STEREO

      public static final int STEREO
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • SAMPLES

      public static final int SAMPLES
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • SRGB_CAPABLE

      public static final int SRGB_CAPABLE
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • DOUBLEBUFFER

      public static final int DOUBLEBUFFER
      • RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS and STENCIL_BITS: specify the desired bit depths of the various components of the default framebuffer. A value of DONT_CARE means the application has no preference.
      • ACCUM_RED_BITS, ACCUM_GREEN_BITS, ACCUM_BLUE_BITS and ACCUM_ALPHA_BITS: specify the desired bit depths of the various components of the accumulation buffer. A value of DONT_CARE means the application has no preference.

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

      • AUX_BUFFERS: specifies the desired number of auxiliary buffers. A value of DONT_CARE means the application has no preference.

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

      • STEREO: specifies whether to use OpenGL stereoscopic rendering. Possible values are TRUE and FALSE. This is a hard constraint.
      • SAMPLES: specifies the desired number of samples to use for multisampling. Zero disables multisampling. A value of DONT_CARE means the application has no preference.
      • SRGB_CAPABLE: specifies whether the framebuffer should be sRGB capable. Possible values are TRUE and FALSE.

        Note
        OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB enable will control sRGB rendering. By default, sRGB rendering will be disabled.
        OpenGL ES: If enabled and supported by the system, the context will always have sRGB rendering enabled.

      • DOUBLEBUFFER: specifies whether the framebuffer should be double buffered. You nearly always want to use double buffering. This is a hard constraint. Possible values are TRUE and FALSE.
      See Also:
    • REFRESH_RATE

      public static final int REFRESH_RATE
      REFRESH_RATE specifies the desired refresh rate for full screen windows. A value of DONT_CARE means the highest available refresh rate will be used. This hint is ignored for windowed mode windows.
      See Also:
    • CLIENT_API

      public static final int CLIENT_API
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_VERSION_MAJOR

      public static final int CONTEXT_VERSION_MAJOR
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_VERSION_MINOR

      public static final int CONTEXT_VERSION_MINOR
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_ROBUSTNESS

      public static final int CONTEXT_ROBUSTNESS
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • OPENGL_FORWARD_COMPAT

      public static final int OPENGL_FORWARD_COMPAT
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • OPENGL_DEBUG_CONTEXT

      public static final int OPENGL_DEBUG_CONTEXT
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • OPENGL_PROFILE

      public static final int OPENGL_PROFILE
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_RELEASE_BEHAVIOR

      public static final int CONTEXT_RELEASE_BEHAVIOR
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_NO_ERROR

      public static final int CONTEXT_NO_ERROR
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_CREATION_API

      public static final int CONTEXT_CREATION_API
      • CLIENT_API: specifies which client API to create the context for. Possible values are OPENGL_API, OPENGL_ES_API and NO_API. This is a hard constraint.
      • CONTEXT_CREATION_API: specifies which context creation API to use to create the context. Possible values are NATIVE_CONTEXT_API, EGL_CONTEXT_API and OSMESA_CONTEXT_API. This is a hard constraint. If no client API is requested, this hint is ignored.

        An extension loader library that assumes it knows which API was used to create the current context may fail if you change this hint. This can be resolved by having it load functions via getProcAddressPREVIEW.

        Note
        Wayland: The EGL API is the native context creation API, so this hint will have no effect.
        X11: On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.
        OSMesa: As its name implies, an OpenGL context created with OSMesa does not update the window contents when its buffers are swapped. Use OpenGL functions or the OSMesa native access functions getOSMesaColorBufferPREVIEW and getOSMesaDepthBufferPREVIEW to retrieve the framebuffer contents.

      • CONTEXT_VERSION_MAJOR and CONTEXT_VERSION_MINOR: specify the client API version that the created context must be compatible with. The exact behavior of these hints depend on the requested client API.

        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.

        Do not confuse these hints with VERSION_MAJOR and VERSION_MINOR, which provide the API version of the GLFW header.

        Note
        OpenGL: These hints are 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: These hints are 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.
        macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.

      • OPENGL_FORWARD_COMPAT: 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.

        Forward-compatibility is described in detail in the OpenGL Reference Manual.

      • OPENGL_DEBUG_CONTEXT: specifies whether the context should be created in debug mode, which may provide additional error and diagnostic reporting functionality. Possible values are TRUE and FALSE.

        Debug contexts for OpenGL and OpenGL ES are described in detail by the GL_KHR_debug extension.

      • OPENGL_PROFILE: specifies which OpenGL profile to create the context for. Possible values are one of OPENGL_CORE_PROFILE or OPENGL_COMPAT_PROFILE, or OPENGL_ANY_PROFILE to not request a specific profile. If requesting an OpenGL version below 3.2, OPENGL_ANY_PROFILE must be used. If OpenGL ES is requested, this hint is ignored.

        OpenGL profiles are described in detail in the OpenGL Reference Manual.

      • CONTEXT_ROBUSTNESS: specifies the robustness strategy to be used by the context. This can be one of NO_RESET_NOTIFICATION or LOSE_CONTEXT_ON_RESET, or NO_ROBUSTNESS to not request a robustness strategy.
      • CONTEXT_RELEASE_BEHAVIOR: specifies the release behavior to be used by the context. Possible values are one of ANY_RELEASE_BEHAVIOR, RELEASE_BEHAVIOR_FLUSH or RELEASE_BEHAVIOR_NONE. If the behavior is ANY_RELEASE_BEHAVIOR, the default behavior of the context creation API will be used. If the behavior is RELEASE_BEHAVIOR_FLUSH, the pipeline will be flushed whenever the context is released from being the current one. If the behavior is RELEASE_BEHAVIOR_NONE, the pipeline will not be flushed on release.

        Context release behaviors are described in detail by the GL_KHR_context_flush_control extension.

      • CONTEXT_NO_ERROR: specifies whether errors should be generated by the context. Possible values are TRUE and FALSE. If enabled, situations that would have generated errors instead cause undefined behavior.

        The no error mode for OpenGL and OpenGL ES is described in detail by the GL_KHR_no_error extension.

      See Also:
    • CONTEXT_REVISION

      public static final int CONTEXT_REVISION
      CONTEXT_VERSION_MAJOR, CONTEXT_VERSION_MINOR and CONTEXT_REVISION indicate the client API version of the window's context.
      See Also:
    • COCOA_RETINA_FRAMEBUFFER

      public static final int COCOA_RETINA_FRAMEBUFFER

      macOS specific window hints

      • COCOA_RETINA_FRAMEBUFFER: specifies whether to use full resolution framebuffers on Retina displays. Possible values are TRUE and FALSE. This is ignored on other platforms.
      • COCOA_FRAME_NAME: specifies 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. This is set with windowHintString(int, java.lang.String).
      • COCOA_GRAPHICS_SWITCHING: specifies whether to in 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. Possible values are TRUE and FALSE. This is ignored on other platforms.

        Simpler programs and tools may want to enable this to save power, while games and other applications performing advanced rendering will want to leave it disabled.

        A bundled application that wishes to participate in Automatic Graphics Switching should also declare this in its Info.plist by setting the NSSupportsAutomaticGraphicsSwitching key to true.

      See Also:
    • COCOA_FRAME_NAME

      public static final int COCOA_FRAME_NAME

      macOS specific window hints

      • COCOA_RETINA_FRAMEBUFFER: specifies whether to use full resolution framebuffers on Retina displays. Possible values are TRUE and FALSE. This is ignored on other platforms.
      • COCOA_FRAME_NAME: specifies 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. This is set with windowHintString(int, java.lang.String).
      • COCOA_GRAPHICS_SWITCHING: specifies whether to in 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. Possible values are TRUE and FALSE. This is ignored on other platforms.

        Simpler programs and tools may want to enable this to save power, while games and other applications performing advanced rendering will want to leave it disabled.

        A bundled application that wishes to participate in Automatic Graphics Switching should also declare this in its Info.plist by setting the NSSupportsAutomaticGraphicsSwitching key to true.

      See Also:
    • COCOA_GRAPHICS_SWITCHING

      public static final int COCOA_GRAPHICS_SWITCHING

      macOS specific window hints

      • COCOA_RETINA_FRAMEBUFFER: specifies whether to use full resolution framebuffers on Retina displays. Possible values are TRUE and FALSE. This is ignored on other platforms.
      • COCOA_FRAME_NAME: specifies 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. This is set with windowHintString(int, java.lang.String).
      • COCOA_GRAPHICS_SWITCHING: specifies whether to in 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. Possible values are TRUE and FALSE. This is ignored on other platforms.

        Simpler programs and tools may want to enable this to save power, while games and other applications performing advanced rendering will want to leave it disabled.

        A bundled application that wishes to participate in Automatic Graphics Switching should also declare this in its Info.plist by setting the NSSupportsAutomaticGraphicsSwitching key to true.

      See Also:
    • X11_CLASS_NAME

      public static final int X11_CLASS_NAME

      X11 specific window hints

      X11_CLASS_NAME and X11_INSTANCE_NAME specifies the desired ASCII encoded class and instance parts of the ICCCM WM_CLASS window property. These are set with windowHintString(int, java.lang.String).
      See Also:
    • X11_INSTANCE_NAME

      public static final int X11_INSTANCE_NAME

      X11 specific window hints

      X11_CLASS_NAME and X11_INSTANCE_NAME specifies the desired ASCII encoded class and instance parts of the ICCCM WM_CLASS window property. These are set with windowHintString(int, java.lang.String).
      See Also:
    • NO_API

      public static final int NO_API
      value for CLIENT_API
      See Also:
    • OPENGL_API

      public static final int OPENGL_API
      value for CLIENT_API
      See Also:
    • OPENGL_ES_API

      public static final int OPENGL_ES_API
      value for CLIENT_API
      See Also:
    • NO_ROBUSTNESS

      public static final int NO_ROBUSTNESS
      value for CONTEXT_ROBUSTNESS
      See Also:
    • NO_RESET_NOTIFICATION

      public static final int NO_RESET_NOTIFICATION
      value for CONTEXT_ROBUSTNESS
      See Also:
    • LOSE_CONTEXT_ON_RESET

      public static final int LOSE_CONTEXT_ON_RESET
      value for CONTEXT_ROBUSTNESS
      See Also:
    • OPENGL_ANY_PROFILE

      public static final int OPENGL_ANY_PROFILE
      value for OPENGL_PROFILE
      See Also:
    • OPENGL_CORE_PROFILE

      public static final int OPENGL_CORE_PROFILE
      value for OPENGL_PROFILE
      See Also:
    • OPENGL_COMPAT_PROFILE

      public static final int OPENGL_COMPAT_PROFILE
      value for OPENGL_PROFILE
      See Also:
    • CURSOR

      public static final int CURSOR
      See Also:
    • STICKY_KEYS

      public static final int STICKY_KEYS
      See Also:
    • STICKY_MOUSE_BUTTONS

      public static final int STICKY_MOUSE_BUTTONS
      See Also:
    • LOCK_KEY_MODS

      public static final int LOCK_KEY_MODS
      See Also:
    • RAW_MOUSE_MOTION

      public static final int RAW_MOUSE_MOTION
      See Also:
    • CURSOR_NORMAL

      public static final int CURSOR_NORMAL

      Cursor mode

      The CURSOR input mode provides several cursor modes for special forms of mouse motion input. By default, the cursor mode is CURSOR_NORMAL, meaning the regular arrow cursor (or another cursor set with setCursor(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)PREVIEW) is used and cursor motion is not limited.

      If you wish to implement mouse motion based camera controls or other input schemes that require unlimited mouse movement, set the cursor mode to CURSOR_DISABLED.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_DISABLED);
      
      This will hide the cursor and lock it to the specified window. GLFW will then take care of all the details of cursor re-centering and offset calculation and providing the application with a virtual cursor position. This virtual position is provided normally via both the cursor position callback and through polling.

      Note
      You should not implement your own version of this functionality using other features of GLFW. It is not supported and will not work as robustly as CURSOR_DISABLED.

      If you only wish the cursor to become hidden when it is over a window but still want it to behave normally, set the cursor mode to CURSOR_HIDDEN.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_HIDDEN);
      
      This mode puts no limit on the motion of the cursor.

      To exit out of either of these special modes, restore the CURSOR_NORMAL cursor mode.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_NORMAL);
      
      See Also:
    • CURSOR_HIDDEN

      public static final int CURSOR_HIDDEN

      Cursor mode

      The CURSOR input mode provides several cursor modes for special forms of mouse motion input. By default, the cursor mode is CURSOR_NORMAL, meaning the regular arrow cursor (or another cursor set with setCursor(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)PREVIEW) is used and cursor motion is not limited.

      If you wish to implement mouse motion based camera controls or other input schemes that require unlimited mouse movement, set the cursor mode to CURSOR_DISABLED.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_DISABLED);
      
      This will hide the cursor and lock it to the specified window. GLFW will then take care of all the details of cursor re-centering and offset calculation and providing the application with a virtual cursor position. This virtual position is provided normally via both the cursor position callback and through polling.

      Note
      You should not implement your own version of this functionality using other features of GLFW. It is not supported and will not work as robustly as CURSOR_DISABLED.

      If you only wish the cursor to become hidden when it is over a window but still want it to behave normally, set the cursor mode to CURSOR_HIDDEN.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_HIDDEN);
      
      This mode puts no limit on the motion of the cursor.

      To exit out of either of these special modes, restore the CURSOR_NORMAL cursor mode.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_NORMAL);
      
      See Also:
    • CURSOR_DISABLED

      public static final int CURSOR_DISABLED

      Cursor mode

      The CURSOR input mode provides several cursor modes for special forms of mouse motion input. By default, the cursor mode is CURSOR_NORMAL, meaning the regular arrow cursor (or another cursor set with setCursor(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)PREVIEW) is used and cursor motion is not limited.

      If you wish to implement mouse motion based camera controls or other input schemes that require unlimited mouse movement, set the cursor mode to CURSOR_DISABLED.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_DISABLED);
      
      This will hide the cursor and lock it to the specified window. GLFW will then take care of all the details of cursor re-centering and offset calculation and providing the application with a virtual cursor position. This virtual position is provided normally via both the cursor position callback and through polling.

      Note
      You should not implement your own version of this functionality using other features of GLFW. It is not supported and will not work as robustly as CURSOR_DISABLED.

      If you only wish the cursor to become hidden when it is over a window but still want it to behave normally, set the cursor mode to CURSOR_HIDDEN.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_HIDDEN);
      
      This mode puts no limit on the motion of the cursor.

      To exit out of either of these special modes, restore the CURSOR_NORMAL cursor mode.

      GLFW.setInputMode(window, GLFW.CURSOR, GLFW.CURSOR_NORMAL);
      
      See Also:
    • ANY_RELEASE_BEHAVIOR

      public static final int ANY_RELEASE_BEHAVIOR
      See Also:
    • RELEASE_BEHAVIOR_FLUSH

      public static final int RELEASE_BEHAVIOR_FLUSH
      See Also:
    • RELEASE_BEHAVIOR_NONE

      public static final int RELEASE_BEHAVIOR_NONE
      See Also:
    • NATIVE_CONTEXT_API

      public static final int NATIVE_CONTEXT_API
      See Also:
    • EGL_CONTEXT_API

      public static final int EGL_CONTEXT_API
      See Also:
    • OSMESA_CONTEXT_API

      public static final int OSMESA_CONTEXT_API
      See Also:
    • ARROW_CURSOR

      public static final int ARROW_CURSOR
      The regular arrow cursor.
      See Also:
    • IBEAM_CURSOR

      public static final int IBEAM_CURSOR
      The text input I-beam cursor shape.
      See Also:
    • CROSSHAIR_CURSOR

      public static final int CROSSHAIR_CURSOR
      The crosshair shape.
      See Also:
    • HAND_CURSOR

      public static final int HAND_CURSOR
      The hand shape.
      See Also:
    • HRESIZE_CURSOR

      public static final int HRESIZE_CURSOR
      The horizontal resize arrow shape.
      See Also:
    • VRESIZE_CURSOR

      public static final int VRESIZE_CURSOR
      The vertical resize arrow shape.
      See Also:
    • CONNECTED

      public static final int CONNECTED
      See Also:
    • DISCONNECTED

      public static final int DISCONNECTED
      See Also:
    • JOYSTICK_HAT_BUTTONS

      public static final int JOYSTICK_HAT_BUTTONS
      JOYSTICK_HAT_BUTTONS specifies whether to also expose joystick hats as buttons, for compatibility with earlier versions of GLFW that did not have getJoystickHats(int). Possible values are TRUE and FALSE.
      See Also:
    • COCOA_CHDIR_RESOURCES

      public static final int COCOA_CHDIR_RESOURCES

      macOS specific init hints

      • COCOA_CHDIR_RESOURCES: specifies whether to set the current directory to the application to the Contents/Resources subdirectory of the application's bundle, if present. Set this with initHint(int, int).
      • COCOA_MENUBAR: specifies whether to create a basic menu bar, either from a nib or manually, when the first window is created, which is when AppKit is initialized. Set this with initHint(int, int).
      See Also:
    • COCOA_MENUBAR

      public static final int COCOA_MENUBAR

      macOS specific init hints

      • COCOA_CHDIR_RESOURCES: specifies whether to set the current directory to the application to the Contents/Resources subdirectory of the application's bundle, if present. Set this with initHint(int, int).
      • COCOA_MENUBAR: specifies whether to create a basic menu bar, either from a nib or manually, when the first window is created, which is when AppKit is initialized. Set this with initHint(int, int).
      See Also:
    • DONT_CARE

      public static final int DONT_CARE
      Don't care value.
      See Also:
  • Method Details

    • getErrorString

      public static String getErrorString(int errorCode)
      Converts the given error code to a readable string.
      Parameters:
      errorCode - the error code.
      Returns:
      the error string.
    • init

      public static boolean init()
      Initializes the GLFW library.

      This function initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before an application terminates GLFW should be terminated in order to free any resources allocated during or after initialization.

      If this function fails, it calls terminate() before returning. If it succeeds, you should call terminate() before the application exits.

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

      Returns:
      true if successful, or false if an error occurred.
      See Also:
      Errors:
      Possible errors include PLATFORM_ERROR.
      Remarks:
      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_RESOURCES init hint.
      X11: This function will set the LC_CTYPE category 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.
      Thread safety:
      This function must only be called from the main thread.
    • terminate

      public static void terminate()
      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 init() successfully before you will be able to use most GLFW functions.

      If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to call this function, as it is called by init() before it returns failure.

      This function has no effect if GLFW is not initialized.

      See Also:
      Errors:
      Possible errors include PLATFORM_ERROR.
      Remarks:
      This function may be called before init().
      Thread safety:
      This function must only be called from the main thread.
      Warning:
      The contexts of any remaining windows must not be current on any other thread when this function is called.
      Reentrancy:
      This function must not be called from a callback.
    • initHint

      public static void initHint(int hint, int value)
      Sets the specified init hint to the desired value.

      This function 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 ignore them. Setting these hints requires no platform specific headers or functions.

      Parameters:
      hint - The init hint to set.
      value - The new value of the init hint.
      See Also:
      Errors:
      Possible errors include INVALID_ENUM and INVALID_VALUE.
      Remarks:
      This function may be called before init().
      Thread safety:
      This function must only be called from the main thread.
    • ngetVersion

      public static void ngetVersion(MemorySegmentPREVIEW major, MemorySegmentPREVIEW minor, MemorySegmentPREVIEW rev)
      Retrieves the version of the GLFW library.

      This function retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure that you are using the minimum required version.

      Any or all of the version arguments may be NULLPREVIEW.

      Parameters:
      major - Where to store the major version number, or NULLPREVIEW.
      minor - Where to store the minor version number, or NULLPREVIEW.
      rev - Where to store the revision number, or NULLPREVIEW.
      See Also:
      Errors:
      None.
      Remarks:
      This function may be called before init().
      Thread safety:
      This function may be called from any thread.
    • getVersion

      public static void getVersion(int @Nullable [] major, int @Nullable [] minor, int @Nullable [] rev)
      Retrieves the version of the GLFW library.
      Parameters:
      major - Where to store the major version number, or null.
      minor - Where to store the minor version number, or null.
      rev - Where to store the revision number, or null.
      See Also:
    • getVersion

      public static Triplet.OfInt getVersion()
      Retrieves the version of the GLFW library.
      Returns:
      the major, minor and revision version number
      See Also:
    • ngetVersionString

      public static MemorySegmentPREVIEW ngetVersionString()
      Returns a string describing the compile-time configuration.

      This function returns the compile-time generated version string of the GLFW library binary. It describes the version, platform, compiler and any platform-specific compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried with GL.getString.

      Do not use the version string to parse the GLFW library version. The getVersionPREVIEW function provides the version of the running library binary in numerical format.

      Returns:
      The ASCII encoded GLFW version string.
      See Also:
      Errors:
      None.
      Remarks:
      This function may be called before init().
      Thread safety:
      This function may be called from any thread.
    • getVersionString

      public static String getVersionString()
      Returns a string describing the compile-time configuration.
      Returns:
      The ASCII encoded GLFW version string.
      See Also:
    • ngetError

      public static int ngetError(MemorySegmentPREVIEW 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 to NULLPREVIEW.

      Parameters:
      description - Where to store the error description pointer, or NULLPREVIEW.
      Returns:
      The last error code for the calling thread, or NO_ERROR (zero).
      See Also:
      Errors:
      None.
      Remarks:
      This function may be called before init().
      Thread safety:
      This function may be called from any thread.
      Pointer lifetime:
      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.
    • getError

      public static int getError(String @Nullable [] description)
      Returns and clears the last error for the calling thread.
      Parameters:
      description - Where to store the error description pointer, or null.
      Returns:
      The last error code for the calling thread, or NO_ERROR (zero).
      See Also:
    • getError

      public static Tuple2.OfObjInt<String> getError()
      Returns and clears the last error for the calling thread.
      Returns:
      the error description pointer. and the last error code for the calling thread, or NO_ERROR (zero)
      See Also:
    • nsetErrorCallback

      public static MemorySegmentPREVIEW nsetErrorCallback(MemorySegmentPREVIEW callback)
      Sets the error callback.

      This function sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.

      The error code is set before the callback is called. Calling getError(java.lang.String[]) from 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.

      Parameters:
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set.
      See Also:
      Errors:
      None.
      Remarks:
      This function may be called before init().
      Thread safety:
      This function must only be called from the main thread.
    • setErrorCallback

      public static MemorySegmentPREVIEW setErrorCallback(@Nullable @Nullable IGLFWErrorFun callback)
      Sets the error callback.
      Parameters:
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set.
      See Also:
    • ngetMonitors

      public static MemorySegmentPREVIEW ngetMonitors(MemorySegmentPREVIEW count)
      Returns the currently connected monitors.

      This function returns an array of handles for all currently connected monitors. The primary monitor is always first in the returned array. If no monitors were found, this function returns NULLPREVIEW.

      Parameters:
      count - Where to store the number of monitors in the returned array. This is set to zero if an error occurred.
      Returns:
      An array of monitor handles, or NULLPREVIEW if no monitors were found or if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated.
    • getMonitors

      public static MemorySegmentPREVIEW @Nullable [] getMonitors()
      Returns the currently connected monitors.
      Returns:
      An array of monitor handles, or null if no monitors were found or if an error occurred.
      See Also:
    • getPrimaryMonitor

      public static MemorySegmentPREVIEW getPrimaryMonitor()
      Returns the primary monitor.

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

      Returns:
      The primary monitor, or NULLPREVIEW if no monitors were found or if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Remarks:
      The primary monitor is always first in the array returned by getMonitorsPREVIEW.
      Thread safety:
      This function must only be called from the main thread.
    • ngetMonitorPos

      public static void ngetMonitorPos(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW xpos, MemorySegmentPREVIEW ypos)
      Returns the position of the monitor's viewport on the virtual screen.

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

      Any or all of the position arguments may be NULLPREVIEW. If an error occurs, all non-NULLPREVIEW position arguments will be set to zero.

      Parameters:
      monitor - The monitor to query.
      xpos - Where to store the monitor x-coordinate, or NULLPREVIEW.
      ypos - Where to store the monitor y-coordinate, or NULLPREVIEW.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getMonitorPos

      public static void getMonitorPos(MemorySegmentPREVIEW monitor, int @Nullable [] xpos, int @Nullable [] ypos)
      Returns the position of the monitor's viewport on the virtual screen.
      Parameters:
      monitor - The monitor to query.
      xpos - Where to store the monitor x-coordinate, or null.
      ypos - Where to store the monitor y-coordinate, or null.
      See Also:
    • getMonitorPos

      public static Pair.OfInt getMonitorPos(MemorySegmentPREVIEW monitor)
      Returns the position of the monitor's viewport on the virtual screen.
      Parameters:
      monitor - The monitor to query.
      Returns:
      the monitor xy-coordinate
      See Also:
    • ngetMonitorWorkarea

      public static void ngetMonitorWorkarea(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW xpos, MemorySegmentPREVIEW ypos, MemorySegmentPREVIEW width, MemorySegmentPREVIEW 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 operating 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 NULLPREVIEW. If an error occurs, all non-NULLPREVIEW position and size arguments will be set to zero.

      Parameters:
      monitor - The monitor to query.
      xpos - Where to store the monitor x-coordinate, or NULLPREVIEW.
      ypos - Where to store the monitor y-coordinate, or NULLPREVIEW.
      width - Where to store the monitor width, or NULLPREVIEW.
      height - Where to store the monitor height, or NULLPREVIEW.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getMonitorWorkarea

      public static void getMonitorWorkarea(MemorySegmentPREVIEW monitor, int @Nullable [] xpos, int @Nullable [] ypos, int @Nullable [] width, int @Nullable [] height)
      Retrieves the work area of the monitor.
      Parameters:
      monitor - The monitor to query.
      xpos - Where to store the monitor x-coordinate, or null.
      ypos - Where to store the monitor y-coordinate, or null.
      width - Where to store the monitor width, or null.
      height - Where to store the monitor height, or null.
      See Also:
    • getMonitorWorkarea

      public static Quad.OfInt getMonitorWorkarea(MemorySegmentPREVIEW monitor)
      Retrieves the work area of the monitor.
      Parameters:
      monitor - The monitor to query.
      Returns:
      the monitor xy-coordinate, the monitor width and the monitor height
      See Also:
    • ngetMonitorPhysicalSize

      public static void ngetMonitorPhysicalSize(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW widthMM, MemorySegmentPREVIEW heightMM)
      Returns the physical size of the monitor.

      This function returns the size, in millimetres, of the display area of the specified monitor.

      Some systems do not provide accurate monitor size information, either because the monitor EDID data is incorrect or because the driver does not report it accurately.

      Any or all of the size arguments may be NULLPREVIEW. If an error occurs, all non-NULLPREVIEW size arguments will be set to zero.

      Parameters:
      monitor - The monitor to query.
      widthMM - Where to store the width, in millimetres, of the monitor's display area, or NULLPREVIEW.
      heightMM - Where to store the height, in millimetres, of the monitor's display area, or NULLPREVIEW.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Remarks:
      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.
      Thread safety:
      This function must only be called from the main thread.
    • getMonitorPhysicalSize

      public static void getMonitorPhysicalSize(MemorySegmentPREVIEW monitor, int @Nullable [] widthMM, int @Nullable [] heightMM)
      Returns the physical size of the monitor.
      Parameters:
      monitor - The monitor to query.
      widthMM - Where to store the width, in millimetres, of the monitor's display area, or null.
      heightMM - Where to store the height, in millimetres, of the monitor's display area, or null.
      See Also:
    • getMonitorPhysicalSize

      public static Pair.OfInt getMonitorPhysicalSize(MemorySegmentPREVIEW monitor)
      Returns the physical size of the monitor.
      Parameters:
      monitor - The monitor to query.
      Returns:
      the width and height, in millimetres, of the monitor's display area.
      See Also:
    • ngetMonitorContentScale

      public static void ngetMonitorContentScale(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW xscale, MemorySegmentPREVIEW 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.

      Parameters:
      monitor - The monitor to query.
      xscale - Where to store the x-axis content scale, or NULLPREVIEW.
      yscale - Where to store the y-axis content scale, or NULLPREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getMonitorContentScale

      public static void getMonitorContentScale(MemorySegmentPREVIEW monitor, float @Nullable [] xscale, float @Nullable [] yscale)
      Retrieves the content scale for the specified monitor.
      Parameters:
      monitor - The monitor to query.
      xscale - Where to store the x-axis content scale, or null.
      yscale - Where to store the y-axis content scale, or null.
      See Also:
    • getMonitorContentScale

      public static Pair.OfFloat getMonitorContentScale(MemorySegmentPREVIEW monitor)
      Retrieves the content scale for the specified monitor.
      Parameters:
      monitor - The monitor to query.
      Returns:
      the xy-axis content scale
      See Also:
    • ngetMonitorName

      public static MemorySegmentPREVIEW ngetMonitorName(MemorySegmentPREVIEW monitor)
      Returns the name of the specified monitor.

      This function returns a human-readable name, encoded as UTF-8, of the specified monitor. The name typically reflects the make and model of the monitor and is not guaranteed to be unique among the connected monitors.

      Parameters:
      monitor - The monitor to query.
      Returns:
      The UTF-8 encoded name of the monitor, or NULLPREVIEW if an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.
    • getMonitorName

      @Nullable public static @Nullable String getMonitorName(MemorySegmentPREVIEW monitor)
      Returns the name of the specified monitor.
      Parameters:
      monitor - The monitor to query.
      Returns:
      The UTF-8 encoded name of the monitor, or null if an error occurred.
      See Also:
    • setMonitorUserPointer

      public static void setMonitorUserPointer(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW 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 NULLPREVIEW.

      This function may be called from the monitor callback, even for a monitor that is being disconnected.

      Parameters:
      monitor - The monitor whose pointer to set.
      pointer - The new value.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • getMonitorUserPointer

      public static MemorySegmentPREVIEW getMonitorUserPointer(MemorySegmentPREVIEW 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 NULLPREVIEW.

      This function may be called from the monitor callback, even for a monitor that is being disconnected.

      Parameters:
      monitor - The monitor whose pointer to return.
      Returns:
      the user pointer of the specified monitor
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • nsetMonitorCallback

      public static MemorySegmentPREVIEW nsetMonitorCallback(MemorySegmentPREVIEW callback)
      Sets the monitor configuration callback.

      This function sets the monitor configuration callback, or removes the currently set callback. This is called when a monitor is connected to or disconnected from the system.

      Parameters:
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWmonitor* monitor, int event)
      For more information about the callback parameters, see the function pointer type.
    • setMonitorCallback

      public static MemorySegmentPREVIEW setMonitorCallback(@Nullable @Nullable IGLFWMonitorFun callback)
      Sets the monitor configuration callback.
      Parameters:
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • ngetVideoModes

      public static MemorySegmentPREVIEW ngetVideoModes(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW count)
      Returns the available video modes for the specified monitor.

      This function returns an array of all video modes supported by the specified monitor. The returned array is sorted in ascending order, first by color bit depth (the sum of all channel depths), then by resolution area (the product of width and height), then resolution width and finally by refresh rate.

      Parameters:
      monitor - The monitor to query.
      count - Where to store the number of video modes in the returned array. This is set to zero if an error occurred.
      Returns:
      An array of video modes, or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
    • getVideoModes

      @Nullable public static GLFWVidMode.Buffer getVideoModes(SegmentAllocatorPREVIEW allocator, MemorySegmentPREVIEW monitor)
      Returns the available video modes for the specified monitor.
      Parameters:
      allocator - The allocator that allocates the result.
      monitor - The monitor to query.
      Returns:
      An array of video modes, or null if an error occurred.
      See Also:
    • ngetVideoMode

      public static MemorySegmentPREVIEW ngetVideoMode(MemorySegmentPREVIEW monitor)
      Returns the current mode of the specified monitor.

      This function returns the current video mode of the specified monitor. If you have created a full screen window for that monitor, the return value will depend on whether that window is iconified.

      Parameters:
      monitor - The monitor to query.
      Returns:
      The current mode of the monitor, or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.
    • getVideoMode

      @Nullable public static GLFWVidMode.Value getVideoMode(MemorySegmentPREVIEW monitor)
      Returns the current mode of the specified monitor.
      Parameters:
      monitor - The monitor to query.
      Returns:
      The current mode of the monitor, or null if an error occurred.
      See Also:
    • setGamma

      public static void setGamma(MemorySegmentPREVIEW 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 setGammaRampPREVIEW with 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_CAPABLE hint.

      Parameters:
      monitor - The monitor whose gamma ramp to set.
      gamma - The desired exponent.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_VALUE and PLATFORM_ERROR.
      Remarks:
      Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • ngetGammaRamp

      public static MemorySegmentPREVIEW ngetGammaRamp(MemorySegmentPREVIEW monitor)
      Returns the current gamma ramp for the specified monitor.

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

      Parameters:
      monitor - The monitor to query.
      Returns:
      The current gamma ramp, or NULLPREVIEW if an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits PLATFORM_ERROR while returning NULLPREVIEW.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned structure and its arrays are allocated and freed by GLFW. You should not free them yourself. They are valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
    • getGammaRamp

      @Nullable public static @Nullable GLFWGammaRamp getGammaRamp(MemorySegmentPREVIEW monitor)
      Returns the current gamma ramp for the specified monitor.
      Parameters:
      monitor - The monitor to query.
      Returns:
      The current gamma ramp, or null if an error occurred.
      See Also:
    • nsetGammaRamp

      public static void nsetGammaRamp(MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW ramp)
      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_CAPABLE hint.

      Parameters:
      monitor - The monitor whose gamma ramp to set.
      ramp - The gamma ramp to use.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      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.

      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The specified gamma ramp is copied before this function returns.
    • setGammaRamp

      public static void setGammaRamp(MemorySegmentPREVIEW monitor, GLFWGammaRamp ramp)
      Sets the current gamma ramp for the specified monitor.
      Parameters:
      monitor - The monitor whose gamma ramp to set.
      ramp - The gamma ramp to use.
      See Also:
    • defaultWindowHints

      public static void defaultWindowHints()
      Resets all window hints to their default values.

      This function resets all window hints to their default values.

      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
    • windowHint

      public static void windowHint(int hint, int value)
      Sets the specified window hint to the desired value.

      This function sets hints for the next call to createWindowPREVIEW. The hints, once set, retain their values until changed by a call to this function or defaultWindowHints(), or until the library is terminated.

      Only integer value hints can be set with this function. String value hints are set with windowHintStringPREVIEW.

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

      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.

      Parameters:
      hint - The window hint to set.
      value - The new value of the window hint.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
    • windowHint

      public static void windowHint(int hint, boolean value)
      Sets the specified window hint to the desired value.
      Parameters:
      hint - The window hint to set.
      value - The new value of the window hint.
      See Also:
    • nwindowHintString

      public static void nwindowHintString(int hint, MemorySegmentPREVIEW value)
      Sets the specified window hint to the desired value.

      This function sets hints for the next call to createWindowPREVIEW. The hints, once set, retain their values until changed by a call to this function or defaultWindowHints(), 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 ncreateWindow(int, int, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)PREVIEW.

      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.

      Parameters:
      hint - The window hint to set.
      value - The new value of the window hint.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The specified string is copied before this function returns.
    • windowHintString

      public static void windowHintString(int hint, String value)
      Sets the specified window hint to the desired value.
      Parameters:
      hint - The window hint to set.
      value - The new value of the window hint.
      See Also:
    • ncreateWindow

      public static MemorySegmentPREVIEW ncreateWindow(int width, int height, MemorySegmentPREVIEW title, MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW share)
      Creates a window and its associated context.

      This function creates a window and its associated OpenGL or OpenGL ES context. Most of the options controlling how the window and its context should be created are specified with window hints.

      Successful creation does not change which context is current. Before you can use the newly created context, you need to make it current. For information about the share parameter, see Context object 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, see getWindowAttrib(java.lang.foreign.MemorySegment, int)PREVIEW, getWindowSizePREVIEW and getFramebufferSizePREVIEW.

      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 Retrieving 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 "Windowed full screen" windows.

      Once you have created the window, you can switch it between windowed and full screen mode with setWindowMonitor(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, int, int, int, int, int)PREVIEW. This will not affect its OpenGL or OpenGL ES context.

      By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, make it initially invisible using the VISIBLE window hint, set its position and then show it.

      As long as at least one full screen window is not iconified, the screensaver is prohibited from starting.

      Window systems put limits on window sizes. Very large or very small window dimensions may be overridden by the window system on creation. Check the actual size after creation.

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

      Parameters:
      width - The desired width, in screen coordinates, of the window. This must be greater than zero.
      height - The desired height, in screen coordinates, of the window. This must be greater than zero.
      title - The initial, UTF-8 encoded window title.
      monitor - The monitor to use for full screen mode, or NULLPREVIEW for windowed mode.
      share - The window whose context to share resources with, or NULLPREVIEW to not share resources.
      Returns:
      The handle of the created window, or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM, INVALID_VALUE, API_UNAVAILABLE, VERSION_UNAVAILABLE, FORMAT_UNAVAILABLE and PLATFORM_ERROR.
      Remarks:
      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, the IDI_APPLICATION icon will be used instead. To set a different icon, see setWindowIconPREVIEW.

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

      macOS: The OS only supports forward-compatible 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_FORWARD_COMPAT and OPENGL_PROFILE hints 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 first time a window is created the menu bar is created. If GLFW finds a MainMenu.nib it 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. Menu bar creation can be disabled entirely with the COCOA_MENUBAR init hint.

      macOS: On OS X 10.10 and later the window frame will not be rendered at full resolution on Retina displays unless the COCOA_RETINA_FRAMEBUFFER hint is TRUE and the NSHighResolutionCapable key is enabled in the application bundle's Info.plist. For more information, see High Resolution Guidelines for OS X in the Mac Developer Library. The GLFW test and example programs use a custom Info.plist template for this, which can be found as CMake/MacOSXBundleInfo.plist.in in the source tree.

      macOS: When activating frame autosaving with COCOA_FRAME_NAME, the specified window size and position may be overridden by previously saved values.

      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_CLASS window property will by default be set to the window title passed to this function. The instance part will use the contents of the RESOURCE_NAME environment variable, if present and not empty, or fall back to the window title. Set the X11_CLASS_NAME and X11_INSTANCE_NAME window hints to override this.

      Wayland: Compositors should implement the xdg-decoration protocol for GLFW to decorate the window properly. If this protocol isn't supported, or if the compositor prefers client-side decorations, a very simple fallback frame will be drawn using the wp_viewporter protocol. A compositor can still emit close, maximize or fullscreen events, using for instance a keybind mechanism. If neither of these protocols is supported, the window won't be decorated.

      Wayland: A full screen window will not attempt to change the mode, no matter what the requested size or refresh rate.

      Wayland: Screensaver inhibition requires the idle-inhibit protocol to be implemented in the user's compositor.

      Thread safety:
      This function must only be called from the main thread.
    • createWindow

      public static MemorySegmentPREVIEW createWindow(int width, int height, String title, MemorySegmentPREVIEW monitor, MemorySegmentPREVIEW share)
      Creates a window and its associated context.
      Parameters:
      width - The desired width, in screen coordinates, of the window. This must be greater than zero.
      height - The desired height, in screen coordinates, of the window. This must be greater than zero.
      title - The initial, UTF-8 encoded window title.
      monitor - The monitor to use for full screen mode, or NULLPREVIEW for windowed mode.
      share - The window whose context to share resources with, or NULLPREVIEW to not share resources.
      Returns:
      The handle of the created window, or NULLPREVIEW if an error occurred.
      See Also:
    • destroyWindow

      public static void destroyWindow(MemorySegmentPREVIEW window)
      Destroys the specified window and its context.

      This function destroys the specified window and its context. On calling this function, no further callbacks will be called for that window.

      If the context of the specified window is current on the main thread, it is detached before being destroyed.

      Parameters:
      window - The window to destroy.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Reentrancy:
      This function must not be called from a callback.
      Note:
      The context of the specified window must not be current on any other thread when this function is called.
    • windowShouldClose

      public static boolean windowShouldClose(MemorySegmentPREVIEW window)
      Checks the close flag of the specified window.

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

      Parameters:
      window - The window to query.
      Returns:
      The value of the close flag.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • setWindowShouldClose

      public static void setWindowShouldClose(MemorySegmentPREVIEW window, boolean value)
      Sets the close flag of the specified window.

      This function sets the value of the close flag of the specified window. This can be used to override the user's attempt to close the window, or to signal that it should be closed.

      Parameters:
      window - The window whose flag to change.
      value - The new value.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • nsetWindowTitle

      public static void nsetWindowTitle(MemorySegmentPREVIEW window, MemorySegmentPREVIEW title)
      Sets the title of the specified window.

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

      Parameters:
      window - The window whose title to change.
      title - The UTF-8 encoded window title.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      macOS: The window title will not be updated until the next time you process events.
      Thread safety:
      This function must only be called from the main thread.
    • setWindowTitle

      public static void setWindowTitle(MemorySegmentPREVIEW window, String title)
      Sets the title of the specified window.
      Parameters:
      window - The window whose title to change.
      title - The UTF-8 encoded window title.
      See Also:
    • nsetWindowIcon

      public static void nsetWindowIcon(MemorySegmentPREVIEW window, int count, MemorySegmentPREVIEW images)
      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.

      Parameters:
      window - The window whose icon to set.
      count - The number of images in the specified array, or zero to revert to the default window icon.
      images - The images to create the icon from. This is ignored if count is zero.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_VALUE and PLATFORM_ERROR.
      Remarks:
      macOS: The GLFW window has no icon, as it is not a document window, so this function does nothing. The dock icon will be the same as the application bundle's icon. For more information on bundles, see the Bundle Programming Guide in the Mac Developer Library.

      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 always emits PLATFORM_ERROR.

      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The specified image data is copied before this function returns.
    • setWindowIcon

      public static void setWindowIcon(MemorySegmentPREVIEW window, int count, GLFWImage.Buffer images)
      Sets the icon for the specified window.
      Parameters:
      window - The window whose icon to set.
      count - The number of images in the specified array, or zero to revert to the default window icon.
      images - The images to create the icon from. This is ignored if count is zero.
      See Also:
    • setWindowIcon

      public static void setWindowIcon(MemorySegmentPREVIEW window, @Nullable GLFWImage.Buffer images)
      Sets the icon for the specified window.
      Parameters:
      window - The window whose icon to set.
      images - The images to create the icon from, or null to revert to the default window icon.
      See Also:
    • ngetWindowPos

      public static void ngetWindowPos(MemorySegmentPREVIEW window, MemorySegmentPREVIEW xpos, MemorySegmentPREVIEW ypos)
      Retrieves the position of the content area of the specified window.

      This function 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 NULLPREVIEW. If an error occurs, all non-NULLPREVIEW position arguments will be set to zero.

      Parameters:
      window - The window to query.
      xpos - Where to store the x-coordinate of the upper-left corner of the content area, or NULLPREVIEW.
      ypos - Where to store the y-coordinate of the upper-left corner of the content area, or NULLPREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      Wayland: There is no way for an application to retrieve the global position of its windows, this function will always emit PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getWindowPos

      public static void getWindowPos(MemorySegmentPREVIEW window, int @Nullable [] xpos, int @Nullable [] ypos)
      Retrieves the position of the content area of the specified window.
      Parameters:
      window - The window to query.
      xpos - Where to store the x-coordinate of the upper-left corner of the content area, or null.
      ypos - Where to store the y-coordinate of the upper-left corner of the content area, or null.
    • getWindowPos

      public static Pair.OfInt getWindowPos(MemorySegmentPREVIEW window)
      Retrieves the position of the content area of the specified window.
      Parameters:
      window - The window to query.
      Returns:
      the xy-coordinate of the upper-left corner of the content area.
    • setWindowPos

      public static void setWindowPos(MemorySegmentPREVIEW window, int xpos, int ypos)
      Sets the position of the content area of the specified window.

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

      Parameters:
      window - The window to query.
      xpos - The x-coordinate of the upper-left corner of the content area.
      ypos - The y-coordinate of the upper-left corner of the content area.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      Wayland: There is no way for an application to set the global position of its windows, this function will always emit PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • ngetWindowSize

      public static void ngetWindowSize(MemorySegmentPREVIEW window, MemorySegmentPREVIEW width, MemorySegmentPREVIEW height)
      Retrieves the size of the content area of the specified window.

      This function 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, see getFramebufferSizePREVIEW.

      Any or all of the size arguments may be NULLPREVIEW. If an error occurs, all non-NULLPREVIEW size arguments will be set to zero.

      Parameters:
      window - The window whose size to retrieve.
      width - Where to store the width, in screen coordinates, of the content area, or NULLPREVIEW.
      height - Where to store the height, in screen coordinates, of the content area, or NULLPREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getWindowSize

      public static void getWindowSize(MemorySegmentPREVIEW window, int @Nullable [] width, int @Nullable [] height)
      Retrieves the size of the content area of the specified window.
      Parameters:
      window - The window whose size to retrieve.
      width - Where to store the width, in screen coordinates, of the content area, or null.
      height - Where to store the height, in screen coordinates, of the content area, or null.
      See Also:
    • getWindowSize

      public static Pair.OfInt getWindowSize(MemorySegmentPREVIEW window)
      Retrieves the size of the content area of the specified window.
      Parameters:
      window - The window whose size to retrieve.
      Returns:
      the width and height, in screen coordinates, of the content area.
      See Also:
    • setWindowSizeLimits

      public static void setWindowSizeLimits(MemorySegmentPREVIEW window, int minWidth, int minHeight, int maxWidth, int maxHeight)
      Sets the size limits of the specified window.

      This function sets the size limits of the content area of the specified window. If the window is full screen, the size limits only take effect once it is made windowed. If the window is not resizable, this function does nothing.

      The size limits are applied immediately to a windowed mode window and may cause it to be resized.

      The maximum dimensions must be greater than or equal to the minimum dimensions and all must be greater than or equal to zero.

      Parameters:
      window - The window to set limits for.
      minWidth - The minimum width, in screen coordinates, of the content area, or DONT_CARE.
      minHeight - The minimum height, in screen coordinates, of the content area, or DONT_CARE.
      maxWidth - The maximum width, in screen coordinates, of the content area, or DONT_CARE.
      maxHeight - The maximum height, in screen coordinates, of the content area, or DONT_CARE.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_VALUE and PLATFORM_ERROR.
      Remarks:
      If you set size limits and an aspect ratio that conflict, the results are undefined.

      Wayland: The size limits will not be applied until the window is actually resized, either by the user or by the compositor.

      Thread safety:
      This function must only be called from the main thread.
    • setWindowAspectRatio

      public static void setWindowAspectRatio(MemorySegmentPREVIEW window, int numer, int denom)
      Sets the aspect ratio of the specified window.

      This function 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_CARE then the aspect ratio limit is disabled.

      The aspect ratio is applied immediately to a windowed mode window and may cause it to be resized.

      Parameters:
      window - The window to set limits for.
      numer - The numerator of the desired aspect ratio, or DONT_CARE.
      denom - The denominator of the desired aspect ratio, or DONT_CARE.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_VALUE and PLATFORM_ERROR.
      Remarks:
      If you set size limits and an aspect ratio that conflict, the results are undefined.

      Wayland: The aspect ratio will not be applied until the window is actually resized, either by the user or by the compositor.

      Thread safety:
      This function must only be called from the main thread.
    • setWindowSize

      public static void setWindowSize(MemorySegmentPREVIEW window, int width, int height)
      Sets the size of the content area of the specified window.

      This function sets the size, in screen coordinates, 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 setWindowMonitorPREVIEW.

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

      Parameters:
      window - The window to resize.
      width - The desired width, in screen coordinates, of the window content area.
      height - The desired height, in screen coordinates, of the window content area.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      Wayland: A full screen window will not attempt to change the mode, no matter what the requested size.
      Thread safety:
      This function must only be called from the main thread.
    • ngetFramebufferSize

      public static void ngetFramebufferSize(MemorySegmentPREVIEW window, MemorySegmentPREVIEW width, MemorySegmentPREVIEW height)
      Retrieves the size of the framebuffer of the specified window.

      This function retrieves the size, in pixels, of the framebuffer of the specified window. If you wish to retrieve the size of the window in screen coordinates, see getWindowSizePREVIEW.

      Any or all of the size arguments may be NULLPREVIEW. If an error occurs, all non-NULLPREVIEW size arguments will be set to zero.

      Parameters:
      window - The window whose framebuffer to query.
      width - Where to store the width, in pixels, of the framebuffer, or NULLPREVIEW.
      height - Where to store the height, in pixels, of the framebuffer, or NULLPREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getFramebufferSize

      public static void getFramebufferSize(MemorySegmentPREVIEW window, int @Nullable [] width, int @Nullable [] height)
      Retrieves the size of the framebuffer of the specified window.
      Parameters:
      window - The window whose framebuffer to query.
      width - Where to store the width, in pixels, of the framebuffer, or null.
      height - Where to store the height, in pixels, of the framebuffer, or null.
      See Also:
    • getFramebufferSize

      public static Pair.OfInt getFramebufferSize(MemorySegmentPREVIEW window)
      Retrieves the size of the framebuffer of the specified window.
      Parameters:
      window - The window whose framebuffer to query.
      Returns:
      the width and height, in pixels, of the framebuffer.
      See Also:
    • ngetWindowFrameSize

      public static void ngetWindowFrameSize(MemorySegmentPREVIEW window, MemorySegmentPREVIEW left, MemorySegmentPREVIEW top, MemorySegmentPREVIEW right, MemorySegmentPREVIEW bottom)
      Retrieves the size of the frame of the window.

      This function retrieves the size, in screen coordinates, of each edge of the frame of the specified window. This size includes the title bar, if the window has one. The size of the frame may vary depending on the window-related hints used to create it.

      Because this function retrieves the size of each window frame edge and not the offset along a particular coordinate axis, the retrieved values will always be zero or positive.

      Any or all of the size arguments may be NULLPREVIEW. If an error occurs, all non-NULLPREVIEW size arguments will be set to zero.

      Parameters:
      window - The window whose frame size to query.
      left - Where to store the size, in screen coordinates, of the left edge of the window frame, or NULLPREVIEW.
      top - Where to store the size, in screen coordinates, of the top edge of the window frame, or NULLPREVIEW.
      right - Where to store the size, in screen coordinates, of the right edge of the window frame, or NULLPREVIEW.
      bottom - Where to store the size, in screen coordinates, of the bottom edge of the window frame, or NULLPREVIEW.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getWindowFrameSize

      public static void getWindowFrameSize(MemorySegmentPREVIEW window, int @Nullable [] left, int @Nullable [] top, int @Nullable [] right, int @Nullable [] bottom)
      Retrieves the size of the frame of the window.
      Parameters:
      window - The window whose frame size to query.
      left - Where to store the size, in screen coordinates, of the left edge of the window frame, or null.
      top - Where to store the size, in screen coordinates, of the top edge of the window frame, or null.
      right - Where to store the size, in screen coordinates, of the right edge of the window frame, or null.
      bottom - Where to store the size, in screen coordinates, of the bottom edge of the window frame, or null.
      See Also:
    • getWindowFrameSize

      public static Quad.OfInt getWindowFrameSize(MemorySegmentPREVIEW window)
      Retrieves the size of the frame of the window.
      Parameters:
      window - The window whose frame size to query.
      Returns:
      the size, in screen coordinates, of the left, top, right and bottom edge of the window frame.
      See Also:
    • ngetWindowContentScale

      public static void ngetWindowContentScale(MemorySegmentPREVIEW window, MemorySegmentPREVIEW xscale, MemorySegmentPREVIEW 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 systems where each monitors 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 query.
      xscale - Where to store the x-axis content scale, or NULLPREVIEW.
      yscale - Where to store the y-axis content scale, or NULLPREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getWindowContentScale

      public static void getWindowContentScale(MemorySegmentPREVIEW window, float @Nullable [] xscale, float @Nullable [] yscale)
      Retrieves the content scale for the specified window.
      Parameters:
      window - The window to query.
      xscale - Where to store the x-axis content scale, or null.
      yscale - Where to store the y-axis content scale, or null.
      See Also:
    • getWindowContentScale

      public static Pair.OfFloat getWindowContentScale(MemorySegmentPREVIEW window)
      Retrieves the content scale for the specified window.
      Parameters:
      window - The window to query.
      Returns:
      the xy-axis content scale.
      See Also:
    • getWindowOpacity

      public static float getWindowOpacity(MemorySegmentPREVIEW 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.

      Parameters:
      window - The window to query.
      Returns:
      The opacity value of the specified window.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • setWindowOpacity

      public static void setWindowOpacity(MemorySegmentPREVIEW 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.

      Parameters:
      window - The window to set the opacity for.
      opacity - The desired opacity of the specified window.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • iconifyWindow

      public static void iconifyWindow(MemorySegmentPREVIEW window)
      Iconifies the specified window.

      This function iconifies (minimizes) the specified window if it was previously restored. If the window is already iconified, this function does nothing.

      If the specified window is a full screen window, GLFW restores the original video mode of the monitor. The window's desired video mode is set again when the window is restored.

      Parameters:
      window - The window to iconify.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • restoreWindow

      public static void restoreWindow(MemorySegmentPREVIEW window)
      Restores the specified window.

      This function restores the specified window if it was previously iconified (minimized) or maximized. If the window is already restored, this function does nothing.

      If the specified window is an iconified full screen window, its desired video mode is set again for its monitor when the window is restored.

      Parameters:
      window - The window to restore.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • maximizeWindow

      public static void maximizeWindow(MemorySegmentPREVIEW window)
      Maximizes the specified window.

      This function maximizes the specified window if it was previously not maximized. If the window is already maximized, this function does nothing.

      If the specified window is a full screen window, this function does nothing.

      Parameters:
      window - The window to maximize.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function may only be called from the main thread.
    • showWindow

      public static void showWindow(MemorySegmentPREVIEW window)
      Makes the specified window visible.

      This function makes the specified window visible if it was previously hidden. If the window is already visible or is in full screen mode, this function does nothing.

      By default, windowed mode windows are focused when shown Set the FOCUS_ON_SHOW window hint to change this behavior for all newly created windows, or change the behavior for an existing window with setWindowAttrib(java.lang.foreign.MemorySegment, int, boolean)PREVIEW.

      Parameters:
      window - The window to make visible.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      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.
      Thread safety:
      This function must only be called from the main thread.
    • hideWindow

      public static void hideWindow(MemorySegmentPREVIEW window)
      Hides the specified window.

      This function hides the specified window if it was previously visible. If the window is already hidden or is in full screen mode, this function does nothing.

      Parameters:
      window - The window to hide.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • focusWindow

      public static void focusWindow(MemorySegmentPREVIEW window)
      Brings the specified window to front and sets input focus.

      This function brings the specified window to front and sets input focus. The window should already be visible and not iconified.

      By default, both windowed and full screen mode windows are focused when initially created. Set the FOCUSED to disable this behavior.

      Also by default, windowed mode windows are focused when shown with showWindow(java.lang.foreign.MemorySegment)PREVIEW. Set the FOCUS_ON_SHOW 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 attention requests.

      Parameters:
      window - The window to give input focus.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      Wayland: It is not possible for an application to bring its windows to front, this function will always emit PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • requestWindowAttention

      public static void requestWindowAttention(MemorySegmentPREVIEW 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.

      Parameters:
      window - The window to request attention to.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      macOS: Attention is requested to the application as a whole, not the specific window.
      Thread safety:
      This function must only be called from the main thread.
    • getWindowMonitor

      public static MemorySegmentPREVIEW getWindowMonitor(MemorySegmentPREVIEW window)
      Returns the monitor that the window uses for full screen mode.

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

      Parameters:
      window - The window to query.
      Returns:
      The monitor, or NULLPREVIEW if the window is in windowed mode or an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
    • setWindowMonitor

      public static void setWindowMonitor(MemorySegmentPREVIEW window, MemorySegmentPREVIEW 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 NULLPREVIEW, 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 NULLPREVIEW, 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(java.lang.foreign.MemorySegment, int, int)PREVIEW.

      When a window transitions from full screen to windowed mode, this function restores any previous window settings such as whether it is decorated, floating, resizable, has size or aspect ratio limits, etc.

      Parameters:
      window - The window whose monitor, size or video mode to set.
      monitor - The desired monitor, or NULLPREVIEW to set windowed mode.
      xpos - The desired x-coordinate of the upper-left corner of the content area.
      ypos - The desired y-coordinate of the upper-left corner of the content area.
      width - The desired with, in screen coordinates, of the content area or video mode.
      height - The desired height, in screen coordinates, of the content area or video mode.
      refreshRate - The desired refresh rate, in Hz, of the video mode, or DONT_CARE.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      The OpenGL or OpenGL ES context will not be destroyed or otherwise affected by any resizing or mode switching, although you may need to update your viewport if the framebuffer size has changed.

      Wayland: The desired window position is ignored, as there is no way for an application to set this property.

      Wayland: Setting the window to full screen will not attempt to change the mode, no matter what the requested size or refresh rate.

      Thread safety:
      This function must only be called from the main thread.
    • getWindowAttrib

      public static int getWindowAttrib(MemorySegmentPREVIEW window, int attrib)
      Returns an attribute of the specified window.

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

      Parameters:
      window - The window to query.
      attrib - The window attribute whose value to return.
      Returns:
      The value of the attribute, or zero if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Remarks:
      Framebuffer related hints are not window attributes. See Framebuffer related attributes for more information., Zero is a valid value for many window and context related attributes, so you cannot use a return value of zero as an indication of errors. However, this function should not fail as long as it is passed valid arguments and the library has been initialized.

      Wayland: The Wayland protocol provides no way to check whether a window is iconfied, so ICONIFIED always returns FALSE.

      Thread safety:
      This function must only be called from the main thread.
    • setWindowAttrib

      public static void setWindowAttrib(MemorySegmentPREVIEW window, int attrib, boolean value)
      Sets an attribute of the specified window.

      This function sets the value of an attribute of the specified window.

      The supported attributes are DECORATED, RESIZABLE, FLOATING, AUTO_ICONIFY and FOCUS_ON_SHOW.

      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.

      Parameters:
      window - The window to set the attribute for.
      attrib - A supported window attribute.
      value - true of false.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM, INVALID_VALUE and PLATFORM_ERROR.
      Remarks:
      Calling getWindowAttrib(java.lang.foreign.MemorySegment, int)PREVIEW will always return the latest value, even if that value is ignored by the current mode of the window.
      Thread safety:
      This function must only be called from the main thread.
    • setWindowUserPointer

      public static void setWindowUserPointer(MemorySegmentPREVIEW window, MemorySegmentPREVIEW pointer)
      Sets the user pointer of the specified window.

      This function sets the user-defined pointer of the specified window. The current value is retained until the window is destroyed. The initial value is NULLPREVIEW.

      Parameters:
      window - The window whose pointer to set.
      pointer - The new value.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • getWindowUserPointer

      public static MemorySegmentPREVIEW getWindowUserPointer(MemorySegmentPREVIEW window)
      Returns the user pointer of the specified window.

      This function returns the current value of the user-defined pointer of the specified window. The initial value is NULLPREVIEW.

      Parameters:
      window - The window whose pointer to return.
      Returns:
      the user pointer of the specified window
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • nsetWindowPosCallback

      public static MemorySegmentPREVIEW nsetWindowPosCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the position callback for the specified window.

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

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Remarks:
      Wayland: This callback will never be called, as there is no way for an application to know its global position.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int xpos, int ypos)
      For more information about the callback parameters, see the function pointer type.
    • setWindowPosCallback

      public static MemorySegmentPREVIEW setWindowPosCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowPosFun callback)
      Sets the position callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowSizeCallback

      public static MemorySegmentPREVIEW nsetWindowSizeCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the size callback for the specified window.

      This function sets the size callback of the specified window, which is called when the window is resized. The callback is provided with the size, in screen coordinates, of the content area of the window.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int width, int height)
      For more information about the callback parameters, see the function pointer type.
    • setWindowSizeCallback

      public static MemorySegmentPREVIEW setWindowSizeCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowSizeFun callback)
      Sets the size callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowCloseCallback

      public static MemorySegmentPREVIEW nsetWindowCloseCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the close callback for the specified window.

      This function sets the close callback of the specified window, which is called when the user attempts to close the window, for example by clicking the close widget in the title bar.

      The close flag is set before this callback is called, but you can modify it at any time with setWindowShouldClose(java.lang.foreign.MemorySegment, boolean)PREVIEW.

      The close callback is not triggered by destroyWindow(java.lang.foreign.MemorySegment)PREVIEW.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Remarks:
      macOS: Selecting Quit from the application menu will trigger the close callback for all windows.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window)
      For more information about the callback parameters, see the function pointer type.
    • setWindowCloseCallback

      public static MemorySegmentPREVIEW setWindowCloseCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowCloseFun callback)
      Sets the close callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowRefreshCallback

      public static MemorySegmentPREVIEW nsetWindowRefreshCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the refresh callback for the specified window.

      This function 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, Aqua or Wayland, where the window contents are saved off-screen, this callback may be called only very infrequently or never at all.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window);
      For more information about the callback parameters, see the function pointer type.
    • setWindowRefreshCallback

      public static MemorySegmentPREVIEW setWindowRefreshCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowRefreshFun callback)
      Sets the refresh callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowFocusCallback

      public static MemorySegmentPREVIEW nsetWindowFocusCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the focus callback for the specified window.

      This function sets the focus callback of the specified window, which is called when the window gains or loses input focus.

      After the focus callback is called for a window that lost input focus, synthetic key and mouse button release events will be generated for all such that had been pressed. For more information, see setKeyCallbackPREVIEW and setMouseButtonCallbackPREVIEW.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int focused)
      For more information about the callback parameters, see the function pointer type.
    • setWindowFocusCallback

      public static MemorySegmentPREVIEW setWindowFocusCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowFocusFun callback)
      Sets the focus callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowIconifyCallback

      public static MemorySegmentPREVIEW nsetWindowIconifyCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the iconify callback for the specified window.

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

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Remarks:
      Wayland: The XDG-shell protocol has no event for iconification, so this callback will never be called.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int iconified)
      For more information about the callback parameters, see the function pointer type.
    • setWindowIconifyCallback

      public static MemorySegmentPREVIEW setWindowIconifyCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowIconifyFun callback)
      Sets the iconify callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowMaximizeCallback

      public static MemorySegmentPREVIEW nsetWindowMaximizeCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the maximize callback for the specified window.

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

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int maximized)
      For more information about the callback parameters, see the function pointer type.
    • setWindowMaximizeCallback

      public static MemorySegmentPREVIEW setWindowMaximizeCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowMaximizeFun callback)
      Sets the maximize callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetFramebufferSizeCallback

      public static MemorySegmentPREVIEW nsetFramebufferSizeCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the framebuffer resize callback for the specified window.

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

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int width, int height)
      For more information about the callback parameters, see the function pointer type.
    • setFramebufferSizeCallback

      public static MemorySegmentPREVIEW setFramebufferSizeCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWFramebufferSizeFun callback)
      Sets the framebuffer resize callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetWindowContentScaleCallback

      public static MemorySegmentPREVIEW nsetWindowContentScaleCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the window content scale callback for the specified window.

      This function sets the window content scale callback of the specified window, which is called when the content scale of the specified window changes.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, float xscale, float yscale)
      For more information about the callback parameters, see the function pointer type.
    • setWindowContentScaleCallback

      public static MemorySegmentPREVIEW setWindowContentScaleCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWWindowContentScaleFun callback)
      Sets the window content scale callback for the specified window.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • pollEvents

      public static void pollEvents()
      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.

      Do not assume that callbacks you set will only be called in response to event processing functions like this one. While it is necessary to poll for events, window systems that require GLFW to register callbacks of its own can pass events to GLFW in response to many window system function calls. GLFW will pass those events on to the application callbacks before returning.

      Event processing is not required for joystick input to work.

      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Reentrancy:
      This function must not be called from a callback.
    • waitEvents

      public static void waitEvents()
      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.

      Do not assume that callbacks you set will only be called in response to event processing functions like this one. While it is necessary to poll for events, window systems that require GLFW to register callbacks of its own can pass events to GLFW in response to many window system function calls. GLFW will pass those events on to the application callbacks before returning.

      Event processing is not required for joystick input to work.

      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Reentrancy:
      This function must not be called from a callback.
    • waitEventsTimeout

      public static void waitEventsTimeout(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.

      Do not assume that callbacks you set will only be called in response to event processing functions like this one. While it is necessary to poll for events, window systems that require GLFW to register callbacks of its own can pass events to GLFW in response to many window system function calls. GLFW will pass those events on to the application callbacks before returning.

      Event processing is not required for joystick input to work.

      Parameters:
      timeout - The maximum amount of time, in seconds, to wait.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_VALUE and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Reentrancy:
      This function must not be called from a callback.
    • postEmptyEvents

      public static void postEmptyEvents()
      Posts an empty event to the event queue.

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

      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function may be called from any thread.
    • getInputMode

      public static int getInputMode(MemorySegmentPREVIEW window, int mode)
      Returns the value of an input option for the specified window.

      This function returns the value of an input option for the specified window. The mode must be one of CURSOR, STICKY_KEYS, STICKY_MOUSE_BUTTONS, LOCK_KEY_MODS or RAW_MOUSE_MOTION.

      Parameters:
      window - The window to query.
      mode - One of CURSOR, STICKY_KEYS, STICKY_MOUSE_BUTTONS, LOCK_KEY_MODS or RAW_MOUSE_MOTION.
      Returns:
      the value of an input option for the specified window
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
    • setInputMode

      public static void setInputMode(MemorySegmentPREVIEW window, int mode, int value)
      Sets an input option for the specified window.

      This function sets an input mode option for the specified window. The mode must be one of CURSOR, STICKY_KEYS, STICKY_MOUSE_BUTTONS, LOCK_KEY_MODS or RAW_MOUSE_MOTION.

      If the mode is CURSOR, the value must be one of the following cursor modes:

      • CURSOR_NORMAL makes the cursor visible and behaving normally.
      • CURSOR_HIDDEN makes the cursor invisible when it is over the content area of the window but does not restrict the cursor from leaving.
      • CURSOR_DISABLED hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls.

      If the mode is STICKY_KEYS, the value must be either TRUE to enable sticky keys, or FALSE to disable it. If sticky keys are enabled, a key press will ensure that getKey(java.lang.foreign.MemorySegment, int)PREVIEW returns PRESS the next time it is called even if the key had been released before the call. This is useful when you are only interested in whether keys have been pressed but not when or in which order.

      If the mode is STICKY_MOUSE_BUTTONS, the value must be either TRUE to enable sticky mouse buttons, or FALSE to disable it. If sticky mouse buttons are enabled, a mouse button press will ensure that getMouseButton(java.lang.foreign.MemorySegment, int)PREVIEW returns PRESS the next time it is called even if the mouse button had been released before the call. This is useful when you are only interested in whether mouse buttons have been pressed but not when or in which order.

      If the mode is LOCK_KEY_MODS, the value must be either TRUE to enable lock key modifier bits, or FALSE to disable them. If enabled, callbacks that receive modifier bits will also have the MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on, and the MOD_NUM_LOCK bit when Num Lock was on.

      If the mode is RAW_MOUSE_MOTION, the value must be either TRUE to enable raw (unscaled and unaccelerated) mouse motion when the cursor is disabled, or FALSE to disable it. If raw motion is not supported, attempting to set this will emit PLATFORM_ERROR. Call rawMouseMotionSupported() to check for support.

      Parameters:
      window - The window whose input mode to set.
      mode - One of CURSOR, STICKY_KEYS, STICKY_MOUSE_BUTTONS, LOCK_KEY_MODS or RAW_MOUSE_MOTION.
      value - The new value of the specified input mode.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • rawMouseMotionSupported

      public static boolean rawMouseMotionSupported()
      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_ERROR will 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.

      Returns:
      TRUE if raw mouse motion is supported on the current machine, or FALSE otherwise.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
    • ngetKeyName

      public static MemorySegmentPREVIEW ngetKeyName(int key, int scancode)
      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, or KEY_UNKNOWN and a scancode that maps to a non-printable key, this function returns NULLPREVIEW but 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:

      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.

      Parameters:
      key - The key to query, or KEY_UNKNOWN.
      scancode - The scancode of the key to query.
      Returns:
      The UTF-8 encoded, layout-specific name of the key, or NULLPREVIEW.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      The contents of the returned string may change when a keyboard layout change event is received.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the library is terminated.
    • getKeyName

      @Nullable public static @Nullable String getKeyName(int key, int scancode)
      Returns the layout-specific name of the specified printable key.
      Parameters:
      key - The key to query, or KEY_UNKNOWN.
      scancode - The scancode of the key to query.
      Returns:
      The UTF-8 encoded, layout-specific name of the key, or null.
      See Also:
    • getKeyScancode

      public static int getKeyScancode(int key)
      Returns the platform-specific scancode of the specified key.

      This function returns the platform-specific scancode of the specified key.

      If the key is KEY_UNKNOWN or does not exist on the keyboard this method will return -1.

      Parameters:
      key - Any named key.
      Returns:
      The platform-specific scancode for the key, or -1 if an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function may be called from any thread.
    • getKey

      public static int getKey(MemorySegmentPREVIEW window, int key)
      Returns the last reported state of a keyboard key for the specified window.

      This function returns the last state reported for the specified key to the specified window. The returned state is one of PRESS or RELEASE. The action REPEAT is only reported to the key callback.

      If the STICKY_KEYS input mode is enabled, this function returns PRESS the first time you call it for a key that was pressed, even if that key has already been released.

      The key functions deal with physical keys, with key tokens named after their use on the standard US keyboard layout. If you want to input text, use the Unicode character callback instead.

      The modifier key bit masks are not key tokens and cannot be used with this function.

      Do not use this function to implement text input.

      Parameters:
      window - The desired window.
      key - The desired keyboard key. KEY_UNKNOWN is not a valid key for this function.
      Returns:
      One of PRESS or RELEASE.
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
    • getMouseButton

      public static int getMouseButton(MemorySegmentPREVIEW window, int button)
      Returns the last reported state of a mouse button for the specified window.

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

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

      Parameters:
      window - The desired window.
      button - The desired mouse button.
      Returns:
      One of PRESS or RELEASE.
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
    • ngetCursorPos

      public static void ngetCursorPos(MemorySegmentPREVIEW window, MemorySegmentPREVIEW xpos, MemorySegmentPREVIEW ypos)
      Retrieves the position of the cursor relative to the content area of the window.

      This function 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 coordinate can be converted to their integer equivalents with the floor function. Casting directly to an integer type works for positive coordinates, but fails for negative ones.

      Any or all of the position arguments may be NULLPREVIEW. If an error occurs, all non-NULLPREVIEW position arguments will be set to zero.

      Parameters:
      window - The desired window.
      xpos - Where to store the cursor x-coordinate, relative to the left edge of the content area, or NULLPREVIEW.
      ypos - Where to store the cursor y-coordinate, relative to the to top edge of the content area, or NULLPREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • getCursorPos

      public static void getCursorPos(MemorySegmentPREVIEW window, double @Nullable [] xpos, double @Nullable [] ypos)
      Retrieves the position of the cursor relative to the content area of the window.
      Parameters:
      window - The desired window.
      xpos - Where to store the cursor x-coordinate, relative to the left edge of the content area, or null.
      ypos - Where to store the cursor y-coordinate, relative to the to top edge of the content area, or null.
      See Also:
    • getCursorPos

      public static Pair.OfDouble getCursorPos(MemorySegmentPREVIEW window)
      Retrieves the position of the cursor relative to the content area of the window.
      Parameters:
      window - The desired window.
      Returns:
      the cursor xy-coordinate, relative to the left and top edge of the content area.
      See Also:
    • setCursorPos

      public static void setCursorPos(MemorySegmentPREVIEW window, double xpos, double ypos)
      Sets the position of the cursor, relative to the content area of the window.

      This function 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_DISABLED cursor mode that hides the cursor, transparently re-centers it and provides unconstrained cursor motion. See setInputMode(java.lang.foreign.MemorySegment, int, int)PREVIEW for more information.

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

      Parameters:
      window - The desired window.
      xpos - The desired x-coordinate, relative to the left edge of the content area.
      ypos - The desired y-coordinate, relative to the top edge of the content area.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Remarks:
      Wayland: This function will only work when the cursor mode is CURSOR_DISABLED, otherwise it will do nothing.
      Thread safety:
      This function must only be called from the main thread.
    • ncreateCursor

      public static MemorySegmentPREVIEW ncreateCursor(MemorySegmentPREVIEW image, int xhot, int yhot)
      Creates a custom cursor.

      Creates a new custom cursor image that can be set for a window with setCursor(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)PREVIEW. The cursor can be destroyed with destroyCursor(java.lang.foreign.MemorySegment)PREVIEW. Any remaining cursors are destroyed by terminate().

      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.

      Parameters:
      image - The desired cursor image.
      xhot - The desired x-coordinate, in pixels, of the cursor hotspot.
      yhot - The desired y-coordinate, in pixels, of the cursor hotspot.
      Returns:
      The handle of the created cursor, or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_VALUE and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The specified image data is copied before this function returns.
    • createCursor

      public static MemorySegmentPREVIEW createCursor(GLFWImage image, int xhot, int yhot)
      Creates a custom cursor.
      Parameters:
      image - The desired cursor image.
      xhot - The desired x-coordinate, in pixels, of the cursor hotspot.
      yhot - The desired y-coordinate, in pixels, of the cursor hotspot.
      Returns:
      The handle of the created cursor, or NULLPREVIEW if an error occurred.
      See Also:
    • createStandardCursor

      public static MemorySegmentPREVIEW createStandardCursor(int shape)
      Creates a cursor with a standard shape.

      Returns a cursor with a standard shape, that can be set for a window with setCursor(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)PREVIEW.

      Parameters:
      shape - One of the standard shapes.
      Returns:
      A new cursor ready to use or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • destroyCursor

      public static void destroyCursor(MemorySegmentPREVIEW cursor)
      Destroys a cursor.

      This function destroys a cursor previously created with createCursor(overrungl.glfw.GLFWImage, int, int)PREVIEW. Any remaining cursors will be destroyed by terminate().

      If the specified cursor is current for any window, that window will be reverted to the default cursor. This does not affect the cursor mode.

      Parameters:
      cursor - The cursor object to destroy.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Reentrancy:
      This function must not be called from a callback.
    • setCursor

      public static void setCursor(MemorySegmentPREVIEW window, MemorySegmentPREVIEW cursor)
      Sets the cursor for the window.

      This function 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 is CURSOR_NORMAL.

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

      Parameters:
      window - The window to set the cursor for.
      cursor - The cursor to set, or NULLPREVIEW to switch back to the default arrow cursor.
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • nsetKeyCallback

      public static MemorySegmentPREVIEW nsetKeyCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the key callback.

      This function sets the key callback of the specified window, which is called when a key is pressed, repeated or released.

      The key functions deal with physical keys, with layout independent key tokens named after their values in the standard US keyboard layout. If you want to input text, use the character callbackPREVIEW instead.

      When a window loses input focus, it will generate synthetic key release events for all pressed keys. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the window focus callbackPREVIEW has been called.

      The scancode of a key is specific to that platform or sometimes even to that machine. Scancodes are intended to allow users to bind keys that don't have a GLFW key token. Such keys have key set to KEY_UNKNOWN, their state is not saved and so it cannot be queried with getKey(java.lang.foreign.MemorySegment, int)PREVIEW.

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

      Parameters:
      window - The window whose callback to set.
      callback - The new key callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
      For more information about the callback parameters, see the function pointer type.
    • setKeyCallback

      public static MemorySegmentPREVIEW setKeyCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWKeyFun callback)
      Sets the key callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new key callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetCharCallback

      public static MemorySegmentPREVIEW nsetCharCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the Unicode character callback.

      This function sets the character callback of the specified window, which is called when a Unicode character is input.

      The character callback is intended for Unicode text input. As it deals with characters, it is keyboard layout dependent, whereas the key callbackPREVIEW is not. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback instead.

      The character callback behaves as system text input normally does and will not be called if modifier keys are held down that would prevent normal text input on that platform, for example a Super (Command) key on macOS or Alt key on Windows.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, unsigned int codepoint)
      For more information about the callback parameters, see the function pointer type.
    • setCharCallback

      public static MemorySegmentPREVIEW setCharCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWCharFun callback)
      Sets the Unicode character callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetMouseButtonCallback

      public static MemorySegmentPREVIEW nsetMouseButtonCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the mouse button callback.

      This function sets the mouse button callback of the specified window, which is called when a mouse button is pressed or released.

      When a window loses input focus, it will generate synthetic mouse button release events for all pressed mouse buttons. You can tell these events from user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the window focus callbackPREVIEW has been called.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int button, int action, int mods)
      For more information about the callback parameters, see the function pointer type.
    • setMouseButtonCallback

      public static MemorySegmentPREVIEW setMouseButtonCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWMouseButtonFun callback)
      Sets the mouse button callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetCursorPosCallback

      public static MemorySegmentPREVIEW nsetCursorPosCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the cursor position callback.

      This function sets the cursor position callback of the specified window, which is called when the cursor is moved. The callback is provided with the position, in screen coordinates, relative to the upper-left corner of the content area of the window.

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, double xpos, double ypos);
      For more information about the callback parameters, see the function pointer type.
    • setCursorPosCallback

      public static MemorySegmentPREVIEW setCursorPosCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWCursorPosFun callback)
      Sets the cursor position callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetCursorEnterCallback

      public static MemorySegmentPREVIEW nsetCursorEnterCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the cursor enter/leave callback.

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

      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int entered)
      For more information about the callback parameters, see the function pointer type.
    • setCursorEnterCallback

      public static MemorySegmentPREVIEW setCursorEnterCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWCursorEnterFun callback)
      Sets the cursor enter/leave callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetScrollCallback

      public static MemorySegmentPREVIEW nsetScrollCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the scroll callback.

      This function sets the scroll callback of the specified window, which is called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad.

      The scroll callback receives all scrolling input, like that from a mouse wheel or a touchpad scrolling area.

      Parameters:
      window - The window whose callback to set.
      callback - The new scroll callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, double xoffset, double yoffset)
      For more information about the callback parameters, see the function pointer type.
    • setScrollCallback

      public static MemorySegmentPREVIEW setScrollCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWScrollFun callback)
      Sets the scroll callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new scroll callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nsetDropCallback

      public static MemorySegmentPREVIEW nsetDropCallback(MemorySegmentPREVIEW window, MemorySegmentPREVIEW callback)
      Sets the path drop callback.

      This function sets the path drop callback of the specified window, which is called when one or more dragged paths 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.

      Parameters:
      window - The window whose callback to set.
      callback - The new file drop callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Remarks:
      Wayland: File drop is currently unimplemented.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(GLFWwindow* window, int path_count, const char* paths[])
      For more information about the callback parameters, see the function pointer type.
    • setDropCallback

      public static MemorySegmentPREVIEW setDropCallback(MemorySegmentPREVIEW window, @Nullable @Nullable IGLFWDropFun callback)
      Sets the path drop callback.
      Parameters:
      window - The window whose callback to set.
      callback - The new file drop callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • joystickPresent

      public static boolean joystickPresent(int jid)
      Returns whether the specified joystick is present.

      This function returns whether the specified joystick is present.

      There is no need to call this function before other functions that accept a joystick ID, as they all check for presence before performing any other work.

      Parameters:
      jid - The joystick to query.
      Returns:
      true if the joystick is present, or false otherwise.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
    • ngetJoystickAxes

      public static MemorySegmentPREVIEW ngetJoystickAxes(int jid, MemorySegmentPREVIEW count)
      Returns the values of all axes of the specified joystick.

      This function returns the values of all axes of the specified joystick. Each element in the array is a value between -1.0 and 1.0.

      If the specified joystick is not present this function will return NULLPREVIEW but will not generate an error. This can be used instead of first calling joystickPresent(int).

      Parameters:
      jid - The joystick to query.
      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.
      Returns:
      An array of axis values, or NULLPREVIEW if the joystick is not present or an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the library is terminated.
    • getJoystickAxes

      public static float @Nullable [] getJoystickAxes(int jid)
      Returns the values of all axes of the specified joystick.
      Parameters:
      jid - The joystick to query.
      Returns:
      An array of axis values, or null if the joystick is not present or an error occurred.
      See Also:
    • ngetJoystickButtons

      public static MemorySegmentPREVIEW ngetJoystickButtons(int jid, MemorySegmentPREVIEW count)
      Returns the state of all buttons of the specified joystick.

      This function returns the state of all buttons of the specified joystick. Each element in the array is either PRESS or RELEASE.

      For backward compatibility with earlier versions that did not have ngetJoystickHats(int, java.lang.foreign.MemorySegment)PREVIEW, the button array also includes all hats, each represented as four buttons. The hats are in the same order as returned by getJoystickHats and are in the order up, right, down and left. To disable these extra buttons, set the JOYSTICK_HAT_BUTTONS init hint before initialization.

      If the specified joystick is not present this function will return NULLPREVIEW but will not generate an error. This can be used instead of first calling joystickPresent(int).

      Parameters:
      jid - The joystick to query.
      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.
      Returns:
      An array of button states, or NULLPREVIEW if the joystick is not present or an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the library is terminated.
    • getJoystickButtons

      public static boolean @Nullable [] getJoystickButtons(int jid)
      Returns the state of all buttons of the specified joystick.
      Parameters:
      jid - The joystick to query.
      Returns:
      An array of button states, or null if the joystick is not present or an error occurred.
      See Also:
    • ngetJoystickHats

      public static MemorySegmentPREVIEW ngetJoystickHats(int jid, MemorySegmentPREVIEW count)
      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:

      Values Table
      NameValue
      HAT_CENTERED0
      HAT_UP1
      HAT_RIGHT2
      HAT_DOWN4
      HAT_LEFT8
      HAT_RIGHT_UPHAT_RIGHT | HAT_UP
      HAT_RIGHT_DOWNHAT_RIGHT | HAT_DOWN
      HAT_LEFT_UPHAT_LEFT | HAT_UP
      HAT_LEFT_DOWNHAT_LEFT | HAT_DOWN

      The 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] & 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 NULLPREVIEW but will not generate an error. This can be used instead of first calling joystickPresent(int).

      Parameters:
      jid - The joystick to query.
      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.
      Returns:
      An array of hat states, or NULLPREVIEW if the joystick is not present or an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
    • getJoystickHats

      public static byte[] getJoystickHats(int jid)
      Returns the state of all hats of the specified joystick.
      Parameters:
      jid - The joystick to query.
      Returns:
      An array of hat states, or null if the joystick is not present or an error occurred.
      See Also:
    • ngetJoystickName

      public static MemorySegmentPREVIEW ngetJoystickName(int jid)
      Returns the name of the specified joystick.

      This function returns the name, encoded as UTF-8, of the specified joystick. The returned string is allocated and freed by GLFW. You should not free it yourself.

      If the specified joystick is not present this function will return NULLPREVIEW but will not generate an error. This can be used instead of first calling joystickPresent(int).

      Parameters:
      jid - The joystick to query.
      Returns:
      The UTF-8 encoded name of the joystick, or NULLPREVIEW if the joystick is not present or an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the library is terminated.
    • getJoystickName

      @Nullable public static @Nullable String getJoystickName(int jid)
      Returns the name of the specified joystick.
      Parameters:
      jid - The joystick to query.
      Returns:
      The UTF-8 encoded name of the joystick, or null if the joystick is not present or an error occurred.
      See Also:
    • ngetJoystickGUID

      public static MemorySegmentPREVIEW ngetJoystickGUID(int jid)
      Returns the SDL compatible GUID of the specified joystick.

      This function returns the SDL compatible GUID, as a UTF-8 encoded hexadecimal string, of the specified joystick. The returned string is allocated and freed by GLFW. You should not free it yourself.

      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.

      If the specified joystick is not present this function will return NULLPREVIEW but will not generate an error. This can be used instead of first calling joystickPresent(int).

      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.

      Parameters:
      jid - The joystick to query.
      Returns:
      The UTF-8 encoded GUID of the joystick, or NULLPREVIEW if the joystick is not present or an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED, INVALID_ENUM and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the library is terminated.
    • getJoystickGUID

      @Nullable public static @Nullable String getJoystickGUID(int jid)
      Returns the SDL compatible GUID of the specified joystick.
      Parameters:
      jid - The joystick to query.
      Returns:
      The UTF-8 encoded GUID of the joystick, or null if the joystick is not present or an error occurred.
      See Also:
    • setJoystickUserPointer

      public static void setJoystickUserPointer(int jid, MemorySegmentPREVIEW 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 NULLPREVIEW.

      This function may be called from the joystick callback, even for a joystick that is being disconnected.

      Parameters:
      jid - The joystick whose pointer to set.
      pointer - The new value.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • getJoystickUserPointer

      public static MemorySegmentPREVIEW getJoystickUserPointer(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 NULLPREVIEW.

      This function may be called from the joystick callback, even for a joystick that is being disconnected.

      Parameters:
      jid - The joystick whose pointer to return.
      Returns:
      the user pointer of the specified joystick
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Access is not synchronized.
    • joystickIsGamepad

      public static boolean joystickIsGamepad(int jid)
      Returns whether the specified joystick has a gamepad mapping.

      This function 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 false but will not generate an error. Call joystickPresent(int) to check if a joystick is present regardless of whether it has a mapping.

      Parameters:
      jid - The joystick to query.
      Returns:
      true if a joystick is both present and has a gamepad mapping, or false otherwise.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
    • nsetJoystickCallback

      public static MemorySegmentPREVIEW nsetJoystickCallback(MemorySegmentPREVIEW callback)
      Sets the joystick configuration callback.

      This function sets the joystick configuration callback, or removes the currently set callback. This is called when a joystick is connected to or disconnected from the system.

      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.

      Parameters:
      callback - The new callback, or NULLPREVIEW to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function must only be called from the main thread.
      Callback signature:
      void function_name(int jid, int event)
      For more information about the callback parameters, see the function pointer type.
    • setJoystickCallback

      public static MemorySegmentPREVIEW setJoystickCallback(@Nullable @Nullable IGLFWJoystickFun callback)
      Sets the joystick configuration callback.
      Parameters:
      callback - The new callback, or null to remove the currently set callback.
      Returns:
      The previously set callback, or NULLPREVIEW if no callback was set or the library had not been initialized.
      See Also:
    • nupdateGamepadMappings

      public static boolean nupdateGamepadMappings(MemorySegmentPREVIEW string)
      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.txt source file including empty lines and comments.

      See Gamepad mappings 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.

      Parameters:
      string - The string containing the gamepad mappings.
      Returns:
      true if successful, or false if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_VALUE.
      Thread safety:
      This function must only be called from the main thread.
    • updateGamepadMappings

      public static boolean updateGamepadMappings(String string)
      Adds the specified SDL_GameControllerDB gamepad mappings.
      Parameters:
      string - The string containing the gamepad mappings.
      Returns:
      true if successful, or false if an error occurred.
      See Also:
    • ngetGamepadName

      public static MemorySegmentPREVIEW ngetGamepadName(int jid)
      Returns the human-readable gamepad name for the specified joystick.

      This function 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 NULLPREVIEW but will not generate an error. Call joystickPresent(int) to check whether it is present regardless of whether it has a mapping.

      Parameters:
      jid - The joystick to query.
      Returns:
      The UTF-8 encoded name of the gamepad, or NULLPREVIEW if the joystick is not present, does not have a mapping or an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, the gamepad mappings are updated or the library is terminated.
    • getGamepadName

      @Nullable public static @Nullable String getGamepadName(int jid)
      Returns the human-readable gamepad name for the specified joystick.
      Parameters:
      jid - The joystick to query.
      Returns:
      The UTF-8 encoded name of the gamepad, or null if the joystick is not present, does not have a mapping or an error occurred.
      See Also:
    • ngetGamepadState

      public static boolean ngetGamepadState(int jid, MemorySegmentPREVIEW state)
      Retrieves the state of the specified joystick remapped as a gamepad.

      This function 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 false but will not generate an error. Call joystickPresent(int) to 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 report RELEASE and 0.0 respectively.

      Parameters:
      jid - The joystick to query.
      state - The gamepad input state of the joystick.
      Returns:
      true if successful, or false if no joystick is connected, it has no gamepad mapping or an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_ENUM.
      Thread safety:
      This function must only be called from the main thread.
    • getGamepadState

      public static boolean getGamepadState(int jid, GLFWGamepadState state)
      Retrieves the state of the specified joystick remapped as a gamepad.
      Parameters:
      jid - The joystick to query.
      state - The gamepad input state of the joystick.
      Returns:
      true if successful, or false if no joystick is connected, it has no gamepad mapping or an error occurred.
      See Also:
    • nsetClipboardString

      public static void nsetClipboardString(MemorySegmentPREVIEW string)
      Sets the clipboard to the specified string.

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

      Parameters:
      string - A UTF-8 encoded string.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The specified string is copied before this function returns.
    • setClipboardString

      public static void setClipboardString(String string)
      Sets the clipboard to the specified string.
      Parameters:
      string - A UTF-8 encoded string.
      See Also:
    • ngetClipboardString

      public static MemorySegmentPREVIEW ngetClipboardString()
      Returns the contents of the clipboard as a string.

      This function returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string. If the clipboard is empty or if its contents cannot be converted, NULLPREVIEW is returned and a FORMAT_UNAVAILABLE error is generated.

      Returns:
      The contents of the clipboard as a UTF-8 encoded string, or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, FORMAT_UNAVAILABLE and PLATFORM_ERROR.
      Thread safety:
      This function must only be called from the main thread.
      Pointer lifetime:
      The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to getClipboardString or setClipboardStringPREVIEW, or until the library is terminated.
    • getClipboardString

      @Nullable public static @Nullable String getClipboardString(@Deprecated MemorySegmentPREVIEW window)
      Returns the contents of the clipboard as a string.
      Returns:
      The contents of the clipboard as a UTF-8 encoded string, or null if an error occurred.
      See Also:
    • getTime

      public static double getTime()
      Returns the GLFW time.

      This function returns the current GLFW time, in seconds. Unless the time has been set using setTime(double) it measures time elapsed since GLFW was initialized.

      This function and setTime(double) are helper functions on top of getTimerFrequency() and getTimerValue().

      The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic time source on each supported platform.

      Returns:
      The current time, in seconds, or zero if an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread. Reading and writing of the internal base time is not atomic, so it needs to be externally synchronized with calls to setTime(double).
    • setTime

      public static void setTime(double time)
      Sets the GLFW time.

      This function sets the current GLFW time, in seconds. The value must be a positive finite number less than or equal to 18446744073.0, which is approximately 584.5 years.

      This function and getTime() are helper functions on top of getTimerFrequency() and getTimerValue().

      Parameters:
      time - The new value, in seconds.
      Errors:
      Possible errors include NOT_INITIALIZED and INVALID_VALUE.
      Remarks:
      The upper limit of GLFW time 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.
      Thread safety:
      This function may be called from any thread. Reading and writing of the internal base time is not atomic, so it needs to be externally synchronized with calls to getTime().
    • getTimerValue

      public static long getTimerValue()
      Returns the current value of the raw timer.

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

      Returns:
      The value of the timer, or zero if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread.
    • getTimerFrequency

      public static long getTimerFrequency()
      Returns the frequency, in Hz, of the raw timer.

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

      Returns:
      The frequency of the timer, in Hz, or zero if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread.
    • makeContextCurrent

      public static void makeContextCurrent(MemorySegmentPREVIEW window)
      Makes the context of the specified window current for the calling thread.

      This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. 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.

      When moving a context between threads, you must 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_BEHAVIOR hint.

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

      Parameters:
      window - The window whose context to make current, or NULLPREVIEW to detach the current context.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, NO_WINDOW_CONTEXT and PLATFORM_ERROR.
      Thread safety:
      This function may be called from any thread.
    • getCurrentContext

      public static MemorySegmentPREVIEW getCurrentContext()
      Returns the window whose context is current on the calling thread.

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

      Returns:
      The window whose context is current, or NULLPREVIEW if no window's context is current.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread.
    • swapBuffers

      public static void swapBuffers(MemorySegmentPREVIEW window)
      Swaps the front and back buffers of the specified window.

      This function swaps the front and back buffers of the specified window when rendering with OpenGL or OpenGL ES. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.

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

      This function does not apply to Vulkan. If you are rendering with Vulkan, see vkQueuePresentKHR instead.

      Parameters:
      window - The window whose buffers to swap.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, NO_WINDOW_CONTEXT and PLATFORM_ERROR.
      Remarks:
      EGL: The context of the specified window must be current on the calling thread.
      Thread safety:
      This function may be called from any thread.
    • swapInterval

      public static void swapInterval(int interval)
      Sets the swap interval for the current context.

      This function sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time @ref glfwSwapBuffers was 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(java.lang.String).

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

      This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead.

      Parameters:
      interval - The minimum number of screen updates to wait for until the buffers are swapped by swapBuffers(java.lang.foreign.MemorySegment)PREVIEW.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, NO_CURRENT_CONTEXT and PLATFORM_ERROR.
      Remarks:
      This function is not called during context creation, leaving the swap interval set to whatever is the default on that platform. This is done because some swap interval extensions used by GLFW do not allow the swap interval to be reset to zero once it has been set to a non-zero value., Some GPU drivers do not honor the requested swap interval, either because of a user setting that overrides the application's request or due to bugs in the driver.
      Thread safety:
      This function may be called from any thread.
    • nextensionSupported

      public static boolean nextensionSupported(MemorySegmentPREVIEW extension)
      Returns whether the specified extension is available.

      This function returns whether the specified API extension is supported by the current OpenGL or OpenGL ES context. It searches both for client API extension and context creation API extensions.

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

      As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.

      This function does not apply to Vulkan. If you are using Vulkan, see ngetRequiredInstanceExtensions(java.lang.foreign.MemorySegment)PREVIEW, vkEnumerateInstanceExtensionProperties and vkEnumerateDeviceExtensionProperties instead.

      Parameters:
      extension - The ASCII encoded name of the extension.
      Returns:
      true if the extension is available, or false otherwise.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, NO_CURRENT_CONTEXT, INVALID_VALUE and PLATFORM_ERROR.
      Thread safety:
      This function may be called from any thread.
    • extensionSupported

      public static boolean extensionSupported(String extension)
      Returns whether the specified extension is available.
      Parameters:
      extension - The ASCII encoded name of the extension.
      Returns:
      true if the extension is available, or false otherwise.
      See Also:
    • ngetProcAddress

      public static MemorySegmentPREVIEW ngetProcAddress(MemorySegmentPREVIEW procName)
      Returns the address of the specified function for the current context.

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

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

      This function does not apply to Vulkan. If you are rendering with Vulkan, see glfwGetInstanceProcAddressPREVIEW, vkGetInstanceProcAddr and vkGetDeviceProcAddr instead.

      Parameters:
      procName - The ASCII encoded name of the function.
      Returns:
      The address of the function, or NULLPREVIEW if an error occurred.
      See Also:
      Errors:
      Possible errors include NOT_INITIALIZED, NO_CURRENT_CONTEXT and PLATFORM_ERROR.
      Remarks:
      The address of a given function is not guaranteed to be the same between contexts.

      This function may return a non-NULLPREVIEW address despite the associated version or extension not being available. Always check the context version or extension string first.

      Thread safety:
      This function may be called from any thread.
      Pointer lifetime:
      The returned function pointer is valid until the context is destroyed or the library is terminated.
    • getProcAddress

      public static MemorySegmentPREVIEW getProcAddress(String procName)
      Returns the address of the specified function for the current context.
      Parameters:
      procName - The ASCII encoded name of the function.
      Returns:
      The address of the function, or NULLPREVIEW if an error occurred.
      See Also:
    • vulkanSupported

      public static boolean vulkanSupported()
      Returns whether the Vulkan loader and an ICD have been found.

      This function returns whether the Vulkan loader and any minimally functional ICD have been found.

      The availability of a Vulkan loader and even an ICD does not by itself guarantee that surface creation or even instance creation is possible. Call getRequiredInstanceExtensionsPREVIEW to check whether the extensions necessary for Vulkan surface creation are available and glfwGetPhysicalDevicePresentationSupportPREVIEW to check whether a queue family of a physical device supports image presentation.

      Returns:
      true if Vulkan is minimally available, or false otherwise.
      Errors:
      Possible errors include NOT_INITIALIZED.
      Thread safety:
      This function may be called from any thread.
    • ngetRequiredInstanceExtensions

      public static MemorySegmentPREVIEW ngetRequiredInstanceExtensions(MemorySegmentPREVIEW count)
      Returns the Vulkan instance extensions required by GLFW.

      This function returns an array of names of Vulkan instance extensions required by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the list will always contain VK_KHR_surface, so if you don't require any additional extensions you can pass this list directly to the VkInstanceCreateInfo struct.

      If Vulkan is not available on the machine, this function returns NULLPREVIEW and generates a API_UNAVAILABLE error. Call vulkanSupported() to check whether Vulkan is at least minimally available.

      If Vulkan is available but no set of extensions allowing window surface creation was found, this function returns NULLPREVIEW. You may still use Vulkan for off-screen rendering and compute work.

      Parameters:
      count - Where to store the number of extensions in the returned array. This is set to zero if an error occurred.
      Returns:
      An array of ASCII encoded extension names, or NULLPREVIEW if an error occurred.
      Errors:
      Possible errors include NOT_INITIALIZED and API_UNAVAILABLE.
      Remarks:
      Additional extensions may be required by future versions of GLFW. You should check if any extensions you wish to enable are already in the returned array, as it is an error to specify an extension more than once in the VkInstanceCreateInfo struct.
      Thread safety:
      This function may be called from any thread.
      Pointer lifetime:
      The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the library is terminated.
    • getRequiredInstanceExtensions

      public static String @Nullable [] getRequiredInstanceExtensions()
      Returns the Vulkan instance extensions required by GLFW.
      Returns:
      An array of ASCII encoded extension names, or NULLPREVIEW if an error occurred.
      See Also: