GLFW is an library to work with windows (forms) for OpenGL, OpenGL ES, and Vulkan development on a desktop. It is an API for creating windows, contexts, surfaces, and receiving input and events.

The GLFW plugin is currently for Windows OS only at the moment.

---------------------------------------

Below is a list of most GLFW functions, and almost all functions have been included in the plugin.

Drag-and drop the Xojo plugin GLFW into the Plugins folder (C:\Program Files\Xojo\Xojo 2022r2\Plugins), and restart the Xojo IDE.

Plugin methods and functions can be accessed by typing GLFWSS (GLFWSS by Scientific Specialties) followed by a period, and available functions and constants are shown in the Xojo IDE.

Since GLFW is used for high-speed graphics, many parameters are used with pointers and memoryblocks.

A GLFW HelloWorld Xojo example program can be downloaded GLFWHelloWorld.zip.

GLFWSSDemoVideo

 

Details about the plugin:

Scientific Specialties                

Website:https://scispec.ca/index.php/blog/66-glfw-plugin-glfwss      

Language: Xojo                        

Xojo Version: 2022 r2                 

Date:  29 July 2022                   

Version 1.0.0                         

Target: Desktop                       

for Xojo 2022 r2                      

code API: API 2                       

GUI API: API 2                        

GLFW version: 3.3.8                  

OS: Windows           

Type: 64- bit only              

Libraries: glfw3.h, glfw3native.h    

Plugin: GLFWSS                       

Vulkan Dependencies: Install Vulkan Runtime (https://vulkan.lunarg.com/sdk/home) install: VulkanRT-1.3.216.0-Installer.exe

OpenGL 2.1 Dependencies: None - Included with Windows API

 

Do not use glfwSetWindowPos with Windows as this is incompatible with Xojo. Instead use Win API SetWindowPos

Can use GetWindowLongA to modify the style of a child window or use GLFWSS.glfwWindowHint(GLFWSS.GLFW_DECORATED, GLFWSS.GLFW_FALSE) so that the program contains typical child window properties. glfwWindowHint must be added before glfwCreateWindow, and GetWindowLongA is after the child window has been created.

 

A function with the suffix - Xojo has some or all Xojo friendly data types, such as: glfwCreateWindowXojo.

 

Var MyStyle as UInt32
MyStyle = WinSS.GetWindowLongA(hwNative, WinSS.GWL_STYLE)
MyStyle = BitwiseXor(MyStyle, WinSS.WS_CAPTION) //Remove caption from OpenGL window
MyStyle = BitwiseXor(MyStyle, WinSS.WS_THICKFRAME) //Remove thick border frame from OpenGL window
MyStyle = BitwiseXor(MyStyle, WinSS.WS_BORDER) //Remove the border from OpenGL window
Call WinSS.SetWindowLongA(hwNative, WinSS.GWL_STYLE, MyStyle)

 

GLFWSS.glfwCreateCursor(image as Ptr, xhot as integer, yhot as integer) as Ptr

Creates a new cursor image that can be set for a window with glfwSetCursor.

- 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 Nil if an error occured

 

GLFWSS.glfwCreateStandardCursor(shape as integer) as Ptr

Returns a cursor with a standard shape, that can be set for a window with glfwSetCursor.

- shape = One of the standard shapes.

- returns a new cursor ready to use or Nil if an error occurred.

 

GLFWSS.glfwCreateWindow(width as integer, height as integer, title as Ptr, monitor as Ptr, share as Ptr ) as Ptr

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.

- 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 title as a pointer, UTF-8 encoded window title.

- monitor = The monitor to use for full screen mode, or Nil for a windowed mode

- share = The window whose context to share resources with, or Nil to not share resources

- returns a pointer to the newly created window

 

GLFWSS.glfwCreateWindowXojo(width as integer, height as integer, ByRef title as String, monitor as Ptr, share as Ptr ) as Ptr

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.

- 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 title as a string, UTF-8 encoded window title (Xojo friendly).

- monitor = The monitor to use for full screen mode, or Nil for a windowed mode

- share = The window whose context to share resources with, or Nil to not share resources

- returns a pointer to the newly created window

 

GLFWSS.glfwDefaultWindowHints() 

This function resets all window hints to their default values.

 

GLFWSS.glfwDestroyCursor(cursor as Ptr)

This function destroys a cursor previously created with glfwCreateCursor. Any remaining cursors will be destroyed by glfwTerminate.

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.

- cursor = The cursor object to destroy.

Although not all GLFW methods and constants have been added, there is a large number which are included in the plugin. A good reference for describing and explaining current and future methods and constants is at: https://www.glfw.org/docs/3.3/window_guide.html

 

GLFWSS.glfwDestroyWindow(window as Ptr)

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.

- window =  The window to destroy.

 

GLFWSS.glfwExtensionSupported(extension as Ptr) as integer

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 GLFW_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 glfwGetRequiredInstanceExtensionsvkEnumerateInstanceExtensionProperties and vkEnumerateDeviceExtensionProperties instead.

- extension = The ASCII encoded name of the extension.

- returns GLFW_TRUE is teh extension is available, and GLFW_FALSE otherwise.

 

GLFWSS.glfwFocusWindow(window as Ptr)

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

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

Also by default, windowed mode windows are focused when shown with glfwShowWindow. Set the GLFW_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.

- window = The window to give input focus.

 

GLFWSS.glfwGetClipboardString(window as Ptr) as Ptr

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, Nil is returned and a GLFW_FORMAT_UNAVAILABLE error is generated.

- window Deprecated = Any valid window or Nil.

- returns the contents of the clipboard as a UTF-8 encoded string, or Nil if an error occurred.

 

GLFWSS.glfwGetCurrentContext() as Ptr

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 Nil if no window's context is current.

 

GLFWSS.glfwGetCursorPos(window as Ptr, ByRef xpos as Double, ByRef ypos as Double)

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 GLFW_CURSOR_DISABLED) then the cursor position is unbounded and limited only by the minimum and maximum values of a double.

The coordinate can be converted to their integer equivalents with the floor function. Casting directly to an integer type works for positive coordinates, but fails for negative ones.

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

- window = The desired window

- xpos = Where to store the cursor x-coordinate, relative to the left edge of the content area, or Nil.

- ypos = Where to store the cursor y-coordinate, relative to the to top edge of the content area, or Nil.

 

GLFWSS.glfwGetError(description as Ptr) as integer

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 GLFW_NO_ERROR (zero) and the description pointer is set to Nil.

- description = Where to store the error description pointer, or Nil.

- returns the last error code for the calling thread, or GLFW_NO_ERROR (zero).

 

GLFWSS.glfwGetFramebufferSize(window as Ptr, width as Ptr, height as Ptr) as Ptr

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

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

- window = The window whose framebuffer to query.

- width = Where to store the width, in pixels, of the framebuffer, or Nil.

- height = Where to store the height, in pixels, of the framebuffer, or Nil.

 

GLFWSS.glfwGetGamepadName(jid as integer) as Ptr

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 NULL but will not generate an error. Call glfwJoystickPresent to check whether it is present.

- jid = The joystick to query.

- returns the UTF-8 encoded name of the gamepad, or Nil if the joystick is not present, does not have a mapping or an error occurred.

 

GLFWSS.glfwGetGamepadState(jid as integer, state as Ptr) as Integer

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 GLFW_FALSE but will not generate an error. Call glfwJoystickPresent to check whether it is present.

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 GLFW_RELEASE and 0.0 respectively.

- jid = The joystick to query

- state = The gamepad input state of the joystick

- returns GLFW_TRUE if successful, or GLFW_FALSE if no joystick is connected, it has no gamepad mapping or an error occurred.

 

GLFWSS.glfwGetGammaRamp(monitor as Ptr) as Ptr

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

- monitor = The monitor to query

- returns the current gamma ramp, or Nil if an error occurred.

 

GLFWSS.glfwGetInputMode(window as Ptr, mode as integer) as integer

This function returns the value of an input option for the specified window. The mode must be one of GLFW_CURSORGLFW_STICKY_KEYSGLFW_STICKY_MOUSE_BUTTONSGLFW_LOCK_KEY_MODS or GLFW_RAW_MOUSE_MOTION.

- window = The window to query

- mode = One of  GLFW_CURSORGLFW_STICKY_KEYSGLFW_STICKY_MOUSE_BUTTONSGLFW_LOCK_KEY_MODS or GLFW_RAW_MOUSE_MOTION.

 

GLFWSS.glfwGetJoystickAxes(jid as Integer, count as Ptr) as Single

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 Nil but will not generate an error. This can be used instead of first calling glfwJoystickPresent.

- jid = The joystick to query.

- count = Where to store the integer number of axis values in the returned array. This is set to zero if the joystick is not present or an error occurred.

 

GLFWSS.glfwGetJoystickButtons(jid as integer, count as Ptr) as Ptr

This function returns the state of all buttons of the specified joystick. Each element in the array is either GLFW_PRESS or GLFW_RELEASE.

For backward compatibility with earlier versions that did not have glfwGetJoystickHats, the button array also includes all hats, each represented as four buttons. The hats are in the same order as returned by glfwGetJoystickHats and are in the order uprightdown and left. To disable these extra buttons, set the GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization.

If the specified joystick is not present this function will return NULL but will not generate an error. This can be used instead of first calling glfwJoystickPresent.

- jid = The joystick to query.

- count = Where to store the integer 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 Nil if the joystick is not present or an error occurred.

 

GLFWSS.glfwGetJoystickGUID(jid as integer) as Ptr

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 NULL but will not generate an error. This can be used instead of first calling glfwJoystickPresent.

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.

- jid = The joystick to query.

- returns The UTF-8 encoded CString GUID of the joystick, or Nil if the joystick is not present or an error occurred.

 

GLFWSS.glfwGetJoystickHats(jid as integer, count as Ptr) as Ptr
This function returns the state of all hats of the specified joystick. Each element in the array is one of the following values:

Name Value
GLFW_HAT_CENTERED 0
GLFW_HAT_UP 1
GLFW_HAT_RIGHT 2
GLFW_HAT_DOWN 4
GLFW_HAT_LEFT 8
GLFW_HAT_RIGHT_UP GLFW_HAT_RIGHT | GLFW_HAT_UP
GLFW_HAT_RIGHT_DOWN GLFW_HAT_RIGHT | GLFW_HAT_DOWN
GLFW_HAT_LEFT_UP GLFW_HAT_LEFT | GLFW_HAT_UP
GLFW_HAT_LEFT_DOWN GLFW_HAT_LEFT | GLFW_HAT_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.


- jid[in] = The joystick to query.
- count[out] = 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 NULL if the joystick is not present or an error occurred.

 

GLFWSS.glfwGetJoystickName(jid as integer) as Ptr
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 NULL but will not generate an error. This can be used instead of first calling glfwJoystickPresent.


- jid[in] = 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.

GLFWSS.glfwGetJoystickUserPointer(jid as integer) as Ptr
This function returns the current value of the user-defined pointer of the specified joystick. The initial value is NULL.


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


- jid[in] = The joystick to query.

 

GLFWSS.glfwGetKeyName(key as Integer, scancode as Integer) as Ptr

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 GLFW_KEY_UNKNOWN, the scancode is used to identify the key, otherwise the scancode is ignored. If you specify a non-printable key, or GLFW_KEY_UNKNOWN and a scancode that maps to a non-printable key, this function returns NULL 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:
GLFW_KEY_APOSTROPHE
GLFW_KEY_COMMA
GLFW_KEY_MINUS
GLFW_KEY_PERIOD
GLFW_KEY_SLASH
GLFW_KEY_SEMICOLON
GLFW_KEY_EQUAL
GLFW_KEY_LEFT_BRACKET
GLFW_KEY_RIGHT_BRACKET
GLFW_KEY_BACKSLASH
GLFW_KEY_WORLD_1
GLFW_KEY_WORLD_2
GLFW_KEY_0 to GLFW_KEY_9
GLFW_KEY_A to GLFW_KEY_Z
GLFW_KEY_KP_0 to GLFW_KEY_KP_9
GLFW_KEY_KP_DECIMAL
GLFW_KEY_KP_DIVIDE
GLFW_KEY_KP_MULTIPLY
GLFW_KEY_KP_SUBTRACT
GLFW_KEY_KP_ADD
GLFW_KEY_KP_EQUAL


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.


- key[in] = The key to query, or GLFW_KEY_UNKNOWN
- scancode[in] = The scancode of the key to query.
- returns the UTF-8 encoded, layout-specific name of the key, or NULL.

 

GLFWSS.glfwGetKeyScancode(key as Integer) as integer

This function returns the platform-specific scancode of the specified key.
If the key is GLFW_KEY_UNKNOWN or does not exist on the keyboard this method will return -1.


- key[in] = Any named key.
- returns the platform-specific scancode for the key, or -1 if an error occurred.

 

GLFWSS.glfwGetKey(window as Ptr, key as Integer) as integer

This function returns the last state reported for the specified key to the specified window. The returned state is one of GLFW_PRESS or GLFW_RELEASE. The action GLFW_REPEAT is only reported to the key callback.


If the GLFW_STICKY_KEYS input mode is enabled, this function returns GLFW_PRESS the first time you call it for a key that was pressed, even if that key has already been released.


The key functions deal with physical keys, with key tokens named after their use on the standard US keyboard layout. If you want to input text, use the Unicode character callback instead.


The modifier key bit masks are not key tokens and cannot be used with this function. Do not use this function to implement text input.
- window[in] = The desired window.
- key[in] = The desired keyboard key. GLFW_KEY_UNKNOWN is not a valid key for this function.
- returns one of GLFW_PRESS or GLFW_RELEASE.

 

GLFWSS.glfwGetMonitorContentScale(Monitor as Ptr, xscale as Ptr, yscale as Ptr)

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.


- monitor[in] = The monitor to query.
- xscale[out] = Where to store the x-axis content scale, or Nil.
- yscale[out] = Where to store the y-axis content scale, or Nil.

 

GLFWSS.glfwGetMonitorName(Monitor as Ptr) as Ptr
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.


- monitor[in] = The monitor to query.
- returns the UTF-8 encoded name of the monitor, or Nil if an error occurred.

 

GLFWSS.glfwGetMonitorPhysicalSize(Monitor as Ptr, widthMM as Ptr, heightMM as Ptr)
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 NULL. If an error occurs, all non-NULL size arguments will be set to zero.

- monitor[in] = The monitor to query.
- widthMM[out] = Where to store the width, in millimetres, of the monitor's display area, or Nil.
-heightMM[out] = Where to store the height, in millimetres, of the monitor's display area, or Nil.

 

GLFWSS.glfwGetMonitorPos(Monitor as Ptr, xpos as Ptr, ypos as Ptr)
This function returns the position, in screen coordinates, of the upper-left corner of the specified monitor.
Any or all of the position arguments may be NULL. If an error occurs, all non-Nil position arguments will be set to zero.

-monitor[in] = The monitor to query.
- xpos[out] = Where to store the monitor x-coordinate, or Nil.
- ypos[out] = Where to store the monitor y-coordinate, or Nil.

 

GLFWSS.glfwGetMonitors(pCount as Ptr) as Ptr
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 Nil.


- pCount[out] = 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 Nil if no monitors were found or if an error occurred.

 

GLFWSS.glfwGetMonitorUserPointer(Monitor as Ptr)
This function returns the current value of the user-defined pointer of the specified monitor. The initial value is Nil. This function may be called from the monitor callback, even for a monitor that is being disconnected.


- monitor[in] = The monitor whose pointer to return.

 

GLFWSS.glfwGetMonitorWorkarea(Monitor as Ptr, xpos as Ptr, ypos as Ptr, width as Ptr, height as Ptr)
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 NULL. If an error occurs, all non-NULL position and size arguments will be set to zero.

- monitor[in] = The monitor to query.
- xpos[out] = Where to store the monitor x-coordinate, or Nil.
- ypos[out] = Where to store the monitor y-coordinate, or Nil.
- width[out] = Where to store the monitor width, or Nil.
- height[out] = Where to store the monitor height, or Nil.

 

GLFWSS.glfwGetMouseButton(window as Ptr, button as Integer) as Integer
This function returns the last state reported for the specified mouse button to the specified window. The returned state is one of GLFW_PRESS or GLFW_RELEASE.
If the GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function returns GLFW_PRESS the first time you call it for a mouse button that was pressed, even if that mouse button has already been released.


- window[in] = The desired window.
- button[in] = The desired mouse button.
- returns one of GLFW_PRESS or GLFW_RELEASE.

 

GLFWSS.glfwGetPrimaryMonitor() as Ptr
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 pointer, or Nil if no monitors were found or if an error occurred.

 

GLFWSS.glfwGetProcAddress(procname as Ptr) as Ptr
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 GLFW_NO_CURRENT_CONTEXT error.


This function does not apply to Vulkan. If you are rendering with Vulkan, see glfwGetInstanceProcAddress, vkGetInstanceProcAddr and vkGetDeviceProcAddr instead.


- procname[in] = The pointer of the ASCII encoded name of the function.
- returns the address of the function, or Nil if an error occurred.

 

GLFWSS.glfwGetRequiredInstanceExtensions(count as UInt32) as Ptr
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 NULL and generates a GLFW_API_UNAVAILABLE error. Call glfwVulkanSupported 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 NULL. You may still use Vulkan for off-screen rendering and compute work.


- count[out] = Where to store the number of extensions in the returned array. This is set to zero if an error occurred.
- returns a pointer to an array of ASCII encoded extension names, or NULL if an error occurred.

 

GLFWSS.glfwGetTime() as double
This function returns the current GLFW time, in seconds. Unless the time has been set using glfwSetTime it measures time elapsed since GLFW was initialized.

This function and glfwSetTime are helper functions on top of glfwGetTimerFrequency and glfwGetTimerValue. 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.

 

GLFWSS.glfwGetTimerFrequency() as UInt64
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.

 

GLFWSS.glfwGetTimerValue() as UInt64
This function returns the current value of the raw timer, measured in 1 / frequency seconds. To get the frequency, call glfwGetTimerFrequency.


- returns the frequency of the timer, in Hz, or zero if an error occurred.

 

GLFWSS.glfwGetVersion(major as Ptr, minor as Ptr, rev as Ptr)
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 Nil.


- major[out] = Where to store the major version number, or Nil.
- minor[out] = Where to store the minor version number, or Nil.
- rev[out] = Where to store the revision number, or Nil.

 

GLFWSS.glfwGetVersionString() as Ptr
This function returns the compile-time generated version string of the GLFW library binary. It describes the version, platform, compiler and any platform-specific compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried with glGetString.


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


- returns a pointer to an ASCII encoded GLFW version string.

 

GLFWSS.glfwGetVideoMode(Monitor as Ptr) as Ptr
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.

- monitor[in] = The monitor to query.
- returns the pointer to the current mode of the monitor, or Nil if an error occurred.

 

GLFWSS.glfwGetVideoModes(Monitor as Ptr, count as Ptr) as Ptr
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.

- monitor[in] = The monitor to query
- count[out] = Where to store the number of video modes as an integer in the returned array. This is set to zero if an error occured.

 

GLFWSS.glfwGetWin32Adapter(monitor as Ptr) as Ptr
This function returns the UTF-8 encoded adapter device name (for example \\.\DISPLAY1) of the specified monitor, or NULL if an error occurred.

- monitor[in] = The monitor to query

 

GLFWSS.glfwGetWin32Monitor(monitor as Ptr) as Ptr
This function returns the UTF-8 encoded display device name (for example \\.\DISPLAY1\Monitor0) of the specified monitor, or NULL if an error occurred.

- monitor[in] = The monitor to query

 

GLFWSS.glfwGetWin32Window(window as Ptr) as Ptr
This function returns the HWND of the specified window, or NULL if an error occurred.

- window[in] = The window to query

 

GLFW.glfwGetWindowAttrib(window as Ptr, attrib as Integer) as Integer
This function returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context.


- window[in] = The window to query
- attrib[in] = The window attribute whose value to return.

 

GLFW.glfwGetWindowContentScale(window as Ptr, xScale as Ptr, yScale as Ptr)
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.

- window[in] = The window to query
- xScale[out] = Where to store the x-axis single-value content scale, or Nil.
- yScale[out] = Where to store the y-axis single-value content scale, or Nil.

 

GLFW.glfwGetWindowFrameSize(window as Ptr, left as Ptr, top as Ptr, right as Ptr, bottom as Ptr)
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 Nil. If an error occurs, all non-NULL size arguments will be set to zero. 

- window[in] = The window whose frame size to query.
- left[out] = Where to store the size, in integer screen coordinates, of the left edge of the window frame, or Nil.
- top[out] = Where to store the size, in integer screen coordinates, of the top edge of the window frame, or Nil.
- right[out] = Where to store the size, in integer screen coordinates, of the right edge of the window frame, or Nil.
- bottom[out] = Where to store the size, in integer screen coordinates, of the bottom edge of the window frame, or Nil.

 

GLFW.glfwGetWindowMonitor(window as Ptr) as Ptr
This function returns the handle of the monitor that the specified window is in full screen on.


- window[in] = The window to query.
This returns the monitor, or Nil, if the window is in windowed mode, or an error occured.

 

GLFW.glfwGetWindowOpacity(window as Ptr) as Single
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.

- window[in] = The window to query

 

GLFW.glfwGetWindowPos(window as Ptr, ByRef xPos as Integer, ByRef ypos as Integer)
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 Nil. If an error occurs, all non-Nil position arguments will be set to zero. 

- window[in] = The window to query
- xpos[out] = Where to store the integer x-coordinate of the upper-left corner of the content area, or Nil.
- ypos[out] = Where to store the integer y-coordinate of the upper-left corner of the content area, or Nil.

 

GLFW.glfwGetWindowSize(window as Ptr, width as Ptr, height as Ptr)
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 glfwGetFramebufferSize. Any or all of the size arguments may be NULL. If an error occurs, all non-NULL size arguments will be set to zero.

- window[in] = The window whose size is to be retrieved
- width[out] = Where to store the integer width, in screen coordinates, of the content area, or Nil
- height[out] = Where to store the integer height, in screen coordinates, of the content area, or Nil

 

GLFW.glfwGetWindowUserPointer(window as Ptr) as Ptr
This function returns the current value of the user-defined pointer of the specified window. The initial value is Nil.

- window[in] = The window whose pointer to return

 

GLFW.glfwHideWindow(hWindow as Ptr)
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.

- window[in] = The window to hide

 

GLFW.glfwIconifyWindow(window as Ptr)
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.

- window[in] = The window to iconify

 

GLFW.glfwInitHint(hint as integer, hintValue as integer)

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.(hint as integer, hintValue as integer)

- hint[in] = The init hint to set.
- value[in] = The new value of the init hint.

 

GLFW.glfwInit() as integer
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 glfwTerminate before returning. If it succeeds, you should call glfwTerminate before the application exits. Additional calls to this function after successful initialization but before termination will return GLFW_TRUE immediately.

- Returns GLFW_TRUE if successful, or GLFW_FALSE if an error occurred.

 

GLFW.glfwJoystickIsGamepad(jid as Integer) as Integer
This function returns whether the specified joystick is both present and has a gamepad. If the specified joystick is present but does not have a gamepad mapping this function will return GLFW_FALSE but will not gdenerate an error. Call glfwJoystickPresent to check if a joystick is present regardless of whether it has a mapping.

- jid[in] = The joystick to query
-returns GLFW_TRUE if a joystick is both present and has a gamepad mapping, or GLFW_FALSE otherwise

 

GLFW.glfwJoystickPresent(jid as Integer) as Integer
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.

- jid[in] = The joystick to query
- returns GLFW_TRUE if the joystick is present, or GLFW_FALSE otherwise

 

GLFW.glfwMakeContextCurrent(hWindow as Ptr)
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 GLFW_CONTEXT_RELEASE_BEHAVIOR hint. The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a GLFW_NO_WINDOW_CONTEXT error. 

- window[in] = The window whose context to make current, or Nil to detach the current context.

 

GLFW.glfwMaximizeWindow(window as Ptr) as Integer
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.

- window[in] = The window to maximize

 

GLFW.glfwPollEvents()
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.

 

GLFW.glfwPostEmptyEvent()
This function posts an empty event from the current thread to the event queue, causing glfwWaitEvents or glfwWaitEventsTimeout to return. Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.

 

GLFW.glfwRawMouseMotionSupported() as integer
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, GLFW_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 GLFW_TRUE if raw mouse motion is supported on the current machine, or GLFW_FALSE otherwise.

 

GLFW.glfwRequestWindowAttention(window as Ptr)
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. 

- window[in] = The window pointer to request attention to

 

GLFW.glfwRestoreWindow(window as Ptr)
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. 

- window[in] = A pointer to the window to restore.

 

GLFW.glfwSetClipboardString(window as Ptr, AString as Ptr)
This function sets the system clipboard to the specified, UTF-8 encoded string. 

- window[in] = This is deprectated, and any valid window pointer is good, or Nil.
- string[in] = A UTF-8 encoded string pointer

 

GLFW.glfwSetCursorPos(window as Ptr, xpos as double, ypos as double)
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 GLFW_CURSOR_DISABLED cursor mode that hides the cursor, transparently re-centers it and provides unconstrained cursor motion. See glfwSetInputMode for more information. If the cursor mode is GLFW_CURSOR_DISABLED then the cursor position is unconstrained and limited only by the minimum and maximum values of a double. 

- window[in] = The pointer to the desired window
- xpos[in] = The double value of the desired x-axis coordinate, relative to the left edge of the content area.

 

GLFW.glfwSetCursor(window as Ptr, cursor as Ptr)
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 GLFW_CURSOR_NORMAL. On some platforms, the set cursor may not be visible unless the window also has input focus.

- window[in] = The window pointer to set the cursor for
- cursor[in] = The cursor to set by pointer, or Nil to switch back to the default arrow cursor.

 

GLFW.glfwSetGammaRamp(monitor as Ptr, ramp as Ptr)
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 glfwTerminate. 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 GLFW_SRGB_CAPABLE hint. 

- monitor[in] = The monitor whose gamma ramp to set
- ramp[in] = The gamma ramp to use
Note: In Windows, the gamma ramp size must be 256, in Wayland Gamma handling is a privileged protocol, this function will thus never be implemented and emits GLFW_PLATFORM_ERROR.

 

GLFW.glfwSetGamma(monitor as Ptr, gamma as single)
This function generates an appropriately sized gamma ramp from the specified exponent and then calls glfwSetGammaRamp 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 GLFW_SRGB_CAPABLE hint. 

- monitor[in] = The monitor pointer whose gamma ramp to set
- gamma[in] = The desired exponent
Note: Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits GLFW_PLATFORM_ERROR.

 

GLFW.glfwSetInputMode(window as Ptr, inmode as integer, invalue as integer)
This function sets an input mode option for the specified window. The mode must be one of GLFW_CURSOR, GLFW_STICKY_KEYS, GLFW_STICKY_MOUSE_BUTTONS, GLFW_LOCK_KEY_MODS or GLFW_RAW_MOUSE_MOTION. If the mode is GLFW_CURSOR, the value must be one of the following cursor modes:
GLFW_CURSOR_NORMAL makes the cursor visible and behaving normally.
GLFW_CURSOR_HIDDEN makes the cursor invisible when it is over the content area of the window but does not restrict the cursor from leaving.
GLFW_CURSOR_DISABLED hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls.


If the mode is GLFW_STICKY_KEYS, the value must be either GLFW_TRUE to enable sticky keys, or GLFW_FALSE to disable it. If sticky keys are enabled, a key press will ensure that glfwGetKey returns GLFW_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 GLFW_STICKY_MOUSE_BUTTONS, the value must be either GLFW_TRUE to enable sticky mouse buttons, or GLFW_FALSE to disable it. If sticky mouse buttons are enabled, a mouse button press will ensure that glfwGetMouseButton returns GLFW_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 GLFW_LOCK_KEY_MODS, the value must be either GLFW_TRUE to enable lock key modifier bits, or GLFW_FALSE to disable them. If enabled, callbacks that receive modifier bits will also have the GLFW_MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on, and the GLFW_MOD_NUM_LOCK bit when Num Lock was on.

If the mode is GLFW_RAW_MOUSE_MOTION, the value must be either GLFW_TRUE to enable raw (unscaled and unaccelerated) mouse motion when the cursor is disabled, or GLFW_FALSE to disable it. If raw motion is not supported, attempting to set this will emit GLFW_PLATFORM_ERROR. Call glfwRawMouseMotionSupported to check for support.

- window[in] = The window whose input mode to set
- mode[in] = One of GLFW_CURSOR, GLFW_STICKY_KEYS, GLFW_STICKY_MOUSE_BUTTONS, GLFW_LOCK_KEY_MODS or GLFW_RAW_MOUSE_MOTION
- value[in] = The new integerwdd value of the specified input mode.

 

GLFWSS.glfwSetJoystickUserPointer(jid as integer, aPointer as Ptr)
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 Nil.

- jid[in] = The joystick whose pointer to set
- pointer[in] = The new pointer value

 

GLFWSS.glfwSetMonitorUserPointer(Monitor as Ptr, pointer as Ptr)
This function sets the user-defined pointer of the specified monitor. The current value is retained until the monitor is disconnected. The initial value is NULL. This function may be called from the monitor callback, even for a monitor that is being disconnected. 

- monitor[in] = The pointer whose pointer to set
- pointer[in] = The new value

 

GLFWSS.glfwSetTime(rawTime as double)
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 glfwGetTime are helper functions on top of glfwGetTimerFrequency and glfwGetTimerValue. 

- time[in] = The new time value in seconds

 

GLFWSS.glfwSetWindowAspectRatio(window as Ptr, numer as integer, denom as integer)
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 GLFW_DONT_CARE then the aspect ratio limit is disabled. The aspect ratio is applied immediately to a windowed mode window and may cause it to be resized. 

- window[in] = The window to set limits for.
- numer[in] = The numerator of the desired aspect ratio, or GLFW_DONT_CARE.
- denom[in] = The denominator of the desired aspect ratio, or GLFW_DONT_CARE.
Note: 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.

 

GLFWSS.glfwSetWindowAttrib(window as Ptr, attrib as integer, value as integer)
This function sets the value of an attribute of the specified window. The supported attributes are GLFW_DECORATED, GLFW_RESIZABLE, GLFW_FLOATING, GLFW_AUTO_ICONIFY and GLFW_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. 

- window[in] = The window to set the attribute for
- attrib[in] = A supported window attribute

 

GLFWSS.glfwSetWindowIcon(window as Ptr, count as integer, images as Ptr)
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. 

- window[in] = The window whose icon to set.
- count[in] = The number of images in the specified array, or zero to revert to the default window icon.
- images[in] = The images to create the icon from. This is ignored if count is zero.
Notes: 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 GLFW_PLATFORM_ERROR.

 

GLFWSS.glfwSetWindowMonitor(window as Ptr, monitor as Ptr, xpos as integer, ypos as integer, width as integer, height as integer, refreshRate as integer )
This function sets the monitor that the window uses for full screen mode or, if the monitor is NULL, makes it windowed mode. When setting a monitor, this function updates the width, height and refresh rate of the desired video mode and switches to the video mode closest to it. The window position is ignored when setting a monitor. When the monitor is NULL, the position, width and height are used to place the window content area. The refresh rate is ignored when no monitor is specified. If you only wish to update the resolution of a full screen window or the size of a windowed mode window, see glfwSetWindowSize. 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. 

- window[in] = The window whose monitor, size or video mode to set.
- monitor[in] = The desired monitor, or NULL to set windowed mode.
- xpos[in] = The desired x-coordinate of the upper-left corner of the content area.
ypos[in] = The desired y-coordinate of the upper-left corner of the content area.
width[in] = The desired with, in screen coordinates, of the content area or video mode.
height[in] = The desired height, in screen coordinates, of the content area or video mode.
refreshRate[in] = The desired refresh rate, in Hz, of the video mode, or GLFW_DONT_CARE.
Notes: 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.

GLFWSS.glfwSetWindowOpacity(window as Ptr, opacity as integer)
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. 

- window[in] = The window to set the opacity for.
- opacity[in] = The desired opacity of the specified window.

 

GLFWSS.glfwSetWindowPos(window as Ptr, xPos as integer, yPos as integer)
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.

- window[in] = The window to query
- xpos[in] = The x-coordinate of the upper-left corner of the content area.
- ypos[in] =The y-coordinate of the upper-left corner of the content area.

 

GLFWSS.glfwSetWindowShouldClose(window as Ptr, avalue as integer)
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.

- window[in] - The windows whose flag is to change
- value[in] = The new value

 

GLFWSS.glfwSetWindowSizeLimits(window as Ptr, minwidth as integer, minheight as integer, maxwidth as integer, maxheight as integer)
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.

- window[in] = The window to set limits for.
- minwidth[in] = The minimum width, in screen coordinates, of the content area, or GLFW_DONT_CARE.
- minheight[in] = The minimum height, in screen coordinates, of the content area, or GLFW_DONT_CARE.
- maxwidth[in] = The maximum width, in screen coordinates, of the content area, or GLFW_DONT_CARE.
- maxheight[in] =The maximum height, in screen coordinates, of the content area, or GLFW_DONT_CARE.

 

GLFWSS.glfwSetWindowSize(window as Ptr, width as integer, height as integer)
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 glfwSetWindowMonitor. The window manager may put limits on what sizes are allowed. GLFW cannot and should not override these limits.

- window[in] = The window to resize.
- width[in] = The desired width, in screen coordinates, of the window content area.
- height[in] = The desired height, in screen coordinates, of the window content area.

 

GLFWSS.glfwSetWindowTitle(window as Ptr, title as Ptr)
This function sets the window title, encoded as UTF-8, of the specified window.

- window[in] = The window whose title to change.
- title[in] = The UTF-8 encoded window title.

 

GLFWSS.glfwSetWindowUserPointer(window as Ptr, APointer as Ptr)
This function sets the user-defined pointer of the specified window. The current value is retained until the window is destroyed. The initial value is NULL.

- window[in] = The window whose pointer to set.
- pointer[in] = The new value.

 

GLFWSS.glfwShowWindow(hWindow as Ptr)
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 GLFW_FOCUS_ON_SHOW window hint to change this behavior for all newly created windows, or change the behavior for an existing window with glfwSetWindowAttrib.

- window[in] = The window to make visible.

 

GLFWSS.glfwSwapBuffers(window as Ptr)
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 GLFW_NO_WINDOW_CONTEXT error. This function does not apply to Vulkan. If you are rendering with Vulkan, see vkQueuePresentKHR instead. 

- window[in] = The window whose buffers to swap.

 

GLFWSS.glfwSwapInterval(interval as Integer)
This function sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time glfwSwapBuffers was called before swapping the buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization or just vsync.


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 glfwExtensionSupported. A context must be current on the calling thread. Calling this function without a current context will cause a GLFW_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.

- interval[in] = The minimum number of screen updates to wait for until the buffers are swapped by glfwSwapBuffers.

 

GLFWSS.glfwTerminate()
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 glfwInit 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 glfwInit before it returns failure. This function has no effect if GLFW is not initialized.

 

GLFWSS.glfwUpdateGamepadMappings(AString as Ptr) as integer
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.

- string[in] =The string containing the gamepad mappings.
- Returns GLFW_TRUE if successful, or GLFW_FALSE if an error occurred.

 

GLFWSS.glfwVulkanSupported() as integer
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 glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan surface creation are available and glfwGetPhysicalDevicePresentationSupport to check whether a queue family of a physical device supports image presentation. 

- Returns GLFW_TRUE if Vulkan is minimally available, or GLFW_FALSE otherwise.

 

GLFWSS.glfwWaitEvents()
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 glfwPollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.
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.

 

GLFWSS.glfwWaitEventsTimeout(timeout as double)
This function puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If one or more events are available, it behaves exactly like glfwPollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called. The timeout value must be a positive finite number.
Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback 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.

- timeout[in] = The maximum amount of time, in seconds, to wait.

 

GLFWSS.glfwWindowHint(hint as integer, hintValue as integer)
This function sets hints for the next call to glfwCreateWindow. The hints, once set, retain their values until changed by a call to this function or glfwDefaultWindowHints, or until the library is terminated. Only integer value hints can be set with this function. String value hints are set with glfwWindowHintString. 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 glfwCreateWindow. 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.

- hint[in] = The window hint to set.
- value[in] = The new value of the window hint.

 

GLFWSS.glfwWindowHintString(hint as integer, hintValue as Ptr)
This function sets hints for the next call to glfwCreateWindow. The hints, once set, retain their values until changed by a call to this function or glfwDefaultWindowHints, or until the library is terminated. Only string type hints can be set with this function. Integer value hints are set with glfwWindowHint. 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 glfwCreateWindow. 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.

- hint[in] = The window hint to set.
- value[in] = The new value of the window hint.

 

GLFWSS.glfwWindowShouldClose(window as Ptr) as integer
This function returns the value of the close flag of the specified window.

- window[in] = The window to query.

 

GLFWSS.SetParent(hWndChild as Ptr, hWndNewParent as Ptr) as Ptr
This function sets the parent of a child window to a parent window.

 

GLFWSS.Version() as String
This function returns the version of the GLFWSS plugin