DephiGlfwAbout DelphiGlfw Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers License |
Unit Neslib.Glfw3
Description
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
function glfwInit(): Integer; cdecl external GLFW3_LIB name _PU + 'glfwInit'; |
procedure glfwTerminate(); cdecl external GLFW3_LIB name _PU + 'glfwTerminate'; |
procedure glfwGetVersion(major, minor, rev: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetVersion'; |
function glfwGetVersionString(): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetVersionString'; |
function glfwSetErrorCallback(cbfun: TGLFWerrorfun): TGLFWerrorfun; cdecl external GLFW3_LIB name _PU + 'glfwSetErrorCallback'; |
function glfwGetMonitors(out count: Integer): PPGLFWmonitor; cdecl external GLFW3_LIB name _PU + 'glfwGetMonitors'; |
function glfwGetPrimaryMonitor(): PGLFWmonitor; cdecl external GLFW3_LIB name _PU + 'glfwGetPrimaryMonitor'; |
procedure glfwGetMonitorPos(monitor: PGLFWmonitor; xpos, ypos: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetMonitorPos'; |
procedure glfwGetMonitorPhysicalSize(monitor: PGLFWmonitor; widthMM, heightMM: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetMonitorPhysicalSize'; |
function glfwGetMonitorName(monitor: PGLFWmonitor): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetMonitorName'; |
function glfwSetMonitorCallback(cbfun: TGLFWmonitorfun): TGLFWmonitorfun; cdecl external GLFW3_LIB name _PU + 'glfwSetMonitorCallback'; |
function glfwGetVideoModes(monitor: PGLFWmonitor; out count: Integer): PGLFWvidmode; cdecl external GLFW3_LIB name _PU + 'glfwGetVideoModes'; |
function glfwGetVideoMode(monitor: PGLFWmonitor): PGLFWvidmode; cdecl external GLFW3_LIB name _PU + 'glfwGetVideoMode'; |
procedure glfwSetGamma(monitor: PGLFWmonitor; gamma: Single); cdecl external GLFW3_LIB name _PU + 'glfwSetGamma'; |
function glfwGetGammaRamp(monitor: PGLFWmonitor): PGLFWgammaramp; cdecl external GLFW3_LIB name _PU + 'glfwGetGammaRamp'; |
procedure glfwSetGammaRamp(monitor: PGLFWmonitor; const ramp: PGLFWgammaramp); cdecl external GLFW3_LIB name _PU + 'glfwSetGammaRamp'; |
procedure glfwDefaultWindowHints(); cdecl external GLFW3_LIB name _PU + 'glfwDefaultWindowHints'; |
procedure glfwWindowHint(hint: Integer; value: Integer); cdecl external GLFW3_LIB name _PU + 'glfwWindowHint'; |
function glfwCreateWindow(width: Integer; height: Integer; const title: PAnsiChar; monitor: PGLFWmonitor; share: PGLFWwindow): PGLFWwindow; cdecl external GLFW3_LIB name _PU + 'glfwCreateWindow'; |
procedure glfwDestroyWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwDestroyWindow'; |
function glfwWindowShouldClose(window: PGLFWwindow): Integer; cdecl external GLFW3_LIB name _PU + 'glfwWindowShouldClose'; |
procedure glfwSetWindowShouldClose(window: PGLFWwindow; value: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowShouldClose'; |
procedure glfwSetWindowTitle(window: PGLFWwindow; const title: PAnsiChar); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowTitle'; |
procedure glfwSetWindowIcon(window: PGLFWwindow; count: Integer; const images: PGLFWimage); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowIcon'; |
procedure glfwGetWindowPos(window: PGLFWwindow; xpos, ypos: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetWindowPos'; |
procedure glfwSetWindowPos(window: PGLFWwindow; xpos, ypos: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowPos'; |
procedure glfwGetWindowSize(window: PGLFWwindow; width, height: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetWindowSize'; |
procedure glfwSetWindowSizeLimits(window: PGLFWwindow; minwidth, minheight, maxwidth, maxheight: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowSizeLimits'; |
procedure glfwSetWindowAspectRatio(window: PGLFWwindow; numer, denom: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowAspectRatio'; |
procedure glfwSetWindowSize(window: PGLFWwindow; width, height: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowSize'; |
procedure glfwGetFramebufferSize(window: PGLFWwindow; width, height: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetFramebufferSize'; |
procedure glfwGetWindowFrameSize(window: PGLFWwindow; left, top, right, bottom: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetWindowFrameSize'; |
procedure glfwIconifyWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwIconifyWindow'; |
procedure glfwRestoreWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwRestoreWindow'; |
procedure glfwMaximizeWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwMaximizeWindow'; |
procedure glfwShowWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwShowWindow'; |
procedure glfwHideWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwHideWindow'; |
procedure glfwFocusWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwFocusWindow'; |
function glfwGetWindowMonitor(window: PGLFWwindow): PGLFWmonitor; cdecl external GLFW3_LIB name _PU + 'glfwGetWindowMonitor'; |
procedure glfwSetWindowMonitor(window: PGLFWwindow; monitor: PGLFWmonitor; xpos, ypos, width, height, refreshRate: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowMonitor'; |
function glfwGetWindowAttrib(window: PGLFWwindow; attrib: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetWindowAttrib'; |
procedure glfwSetWindowUserPointer(window: PGLFWwindow; pointer: Pointer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowUserPointer'; |
function glfwGetWindowUserPointer(window: PGLFWwindow): Pointer; cdecl external GLFW3_LIB name _PU + 'glfwGetWindowUserPointer'; |
function glfwSetWindowPosCallback(window: PGLFWwindow; cbfun: TGLFWwindowposfun): TGLFWwindowposfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowPosCallback'; |
function glfwSetWindowSizeCallback(window: PGLFWwindow; cbfun: TGLFWwindowsizefun): TGLFWwindowsizefun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowSizeCallback'; |
function glfwSetWindowCloseCallback(window: PGLFWwindow; cbfun: TGLFWwindowclosefun): TGLFWwindowclosefun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowCloseCallback'; |
function glfwSetWindowRefreshCallback(window: PGLFWwindow; cbfun: TGLFWwindowrefreshfun): TGLFWwindowrefreshfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowRefreshCallback'; |
function glfwSetWindowFocusCallback(window: PGLFWwindow; cbfun: TGLFWwindowfocusfun): TGLFWwindowfocusfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowFocusCallback'; |
function glfwSetWindowIconifyCallback(window: PGLFWwindow; cbfun: TGLFWwindowiconifyfun): TGLFWwindowiconifyfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowIconifyCallback'; |
function glfwSetFramebufferSizeCallback(window: PGLFWwindow; cbfun: TGLFWframebuffersizefun): TGLFWframebuffersizefun; cdecl external GLFW3_LIB name _PU + 'glfwSetFramebufferSizeCallback'; |
procedure glfwPollEvents(); cdecl external GLFW3_LIB name _PU + 'glfwPollEvents'; |
procedure glfwWaitEvents(); cdecl external GLFW3_LIB name _PU + 'glfwWaitEvents'; |
procedure glfwWaitEventsTimeout(timeout: Double); cdecl external GLFW3_LIB name _PU + 'glfwWaitEventsTimeout'; |
procedure glfwPostEmptyEvent(); cdecl external GLFW3_LIB name _PU + 'glfwPostEmptyEvent'; |
function glfwGetInputMode(window: PGLFWwindow; mode: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetInputMode'; |
procedure glfwSetInputMode(window: PGLFWwindow; mode, value: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetInputMode'; |
function glfwGetKeyName(key: Integer; scancode: Integer): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetKeyName'; |
function glfwGetKey(window: PGLFWwindow; key: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetKey'; |
function glfwGetMouseButton(window: PGLFWwindow; button: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetMouseButton'; |
procedure glfwGetCursorPos(window: PGLFWwindow; xpos, ypos: PDouble); cdecl external GLFW3_LIB name _PU + 'glfwGetCursorPos'; |
procedure glfwSetCursorPos(window: PGLFWwindow; xpos, ypos: Double); cdecl external GLFW3_LIB name _PU + 'glfwSetCursorPos'; |
function glfwCreateCursor(const image: PGLFWimage; xhot: Integer; yhot: Integer): PGLFWcursor; cdecl external GLFW3_LIB name _PU + 'glfwCreateCursor'; |
function glfwCreateStandardCursor(shape: Integer): PGLFWcursor; cdecl external GLFW3_LIB name _PU + 'glfwCreateStandardCursor'; |
procedure glfwDestroyCursor(cursor: PGLFWcursor); cdecl external GLFW3_LIB name _PU + 'glfwDestroyCursor'; |
procedure glfwSetCursor(window: PGLFWwindow; cursor: PGLFWcursor); cdecl external GLFW3_LIB name _PU + 'glfwSetCursor'; |
function glfwSetKeyCallback(window: PGLFWwindow; cbfun: TGLFWkeyfun): TGLFWkeyfun; cdecl external GLFW3_LIB name _PU + 'glfwSetKeyCallback'; |
function glfwSetCharCallback(window: PGLFWwindow; cbfun: TGLFWcharfun): TGLFWcharfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCharCallback'; |
function glfwSetCharModsCallback(window: PGLFWwindow; cbfun: TGLFWcharmodsfun): TGLFWcharmodsfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCharModsCallback'; |
function glfwSetMouseButtonCallback(window: PGLFWwindow; cbfun: TGLFWmousebuttonfun): TGLFWmousebuttonfun; cdecl external GLFW3_LIB name _PU + 'glfwSetMouseButtonCallback'; |
function glfwSetCursorPosCallback(window: PGLFWwindow; cbfun: TGLFWcursorposfun): TGLFWcursorposfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCursorPosCallback'; |
function glfwSetCursorEnterCallback(window: PGLFWwindow; cbfun: TGLFWcursorenterfun): TGLFWcursorenterfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCursorEnterCallback'; |
function glfwSetScrollCallback(window: PGLFWwindow; cbfun: TGLFWscrollfun): TGLFWscrollfun; cdecl external GLFW3_LIB name _PU + 'glfwSetScrollCallback'; |
function glfwSetDropCallback(window: PGLFWwindow; cbfun: TGLFWdropfun): TGLFWdropfun; cdecl external GLFW3_LIB name _PU + 'glfwSetDropCallback'; |
function glfwJoystickPresent(joy: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwJoystickPresent'; |
function glfwGetJoystickAxes(joy: Integer; out count: Integer): PSingle; cdecl external GLFW3_LIB name _PU + 'glfwGetJoystickAxes'; |
function glfwGetJoystickButtons(joy: Integer; out count: Integer): PByte; cdecl external GLFW3_LIB name _PU + 'glfwGetJoystickButtons'; |
function glfwGetJoystickName(joy: Integer): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetJoystickName'; |
function glfwSetJoystickCallback(cbfun: TGLFWjoystickfun): TGLFWjoystickfun; cdecl external GLFW3_LIB name _PU + 'glfwSetJoystickCallback'; |
procedure glfwSetClipboardString(window: PGLFWwindow; const text: PAnsiChar); cdecl external GLFW3_LIB name _PU + 'glfwSetClipboardString'; |
function glfwGetClipboardString(window: PGLFWwindow): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetClipboardString'; |
function glfwGetTime(): Double; cdecl external GLFW3_LIB name _PU + 'glfwGetTime'; |
procedure glfwSetTime(time: Double); cdecl external GLFW3_LIB name _PU + 'glfwSetTime'; |
function glfwGetTimerValue(): UInt64; cdecl external GLFW3_LIB name _PU + 'glfwGetTimerValue'; |
function glfwGetTimerFrequency(): UInt64; cdecl external GLFW3_LIB name _PU + 'glfwGetTimerFrequency'; |
procedure glfwMakeContextCurrent(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwMakeContextCurrent'; |
function glfwGetCurrentContext(): PGLFWwindow; cdecl external GLFW3_LIB name _PU + 'glfwGetCurrentContext'; |
procedure glfwSwapBuffers(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwSwapBuffers'; |
procedure glfwSwapInterval(interval: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSwapInterval'; |
function glfwExtensionSupported(const extension: PAnsiChar): Integer; cdecl external GLFW3_LIB name _PU + 'glfwExtensionSupported'; |
function glfwGetProcAddress(const procname: PAnsiChar): TGLFWglproc; cdecl external GLFW3_LIB name _PU + 'glfwGetProcAddress'; |
function glfwVulkanSupported(): Integer; cdecl external GLFW3_LIB name _PU + 'glfwVulkanSupported'; |
function glfwGetRequiredInstanceExtensions(out count: UInt32): PPAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetRequiredInstanceExtensions'; |
function glfwGetWin32Adapter(monitor: PGLFWmonitor): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetWin32Adapter'; |
function glfwGetWin32Monitor(monitor: PGLFWmonitor): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetWin32Monitor'; |
function glfwGetWin32Window(window: PGLFWwindow): HWND; cdecl external GLFW3_LIB name _PU + 'glfwGetWin32Window'; |
function glfwGetWGLContext(window: PGLFWwindow): HGLRC; cdecl external GLFW3_LIB name _PU + 'glfwGetWGLContext'; |
function glfwGetCocoaMonitor(monitor: PGLFWmonitor): CGDirectDisplayID; cdecl external GLFW3_LIB name _PU + 'glfwGetCocoaMonitor'; |
function glfwGetCocoaWindow(window: PGLFWwindow): Id; cdecl external GLFW3_LIB name _PU + 'glfwGetCocoaWindow'; |
function glfwGetNSGLContext(window: PGLFWwindow): Id; cdecl external GLFW3_LIB name _PU + 'glfwGetNSGLContext'; |
Types
TGLFWglproc = procedure(); cdecl; |
PGLFWmonitor = Pointer; |
PPGLFWmonitor = ˆPGLFWmonitor; |
PGLFWwindow = Pointer; |
PPGLFWwindow = ˆPGLFWwindow; |
PGLFWcursor = Pointer; |
PPGLFWcursor = ˆPGLFWcursor; |
TGLFWerrorfun = procedure(error: Integer; const description: PAnsiChar); cdecl; |
TGLFWwindowposfun = procedure(window: PGLFWwindow; xpos, ypos: Integer); cdecl; |
TGLFWwindowsizefun = procedure(window: PGLFWwindow; width, height: Integer); cdecl; |
TGLFWwindowclosefun = procedure(window: PGLFWwindow); cdecl; |
TGLFWwindowrefreshfun = procedure(window: PGLFWwindow); cdecl; |
TGLFWwindowfocusfun = procedure(window: PGLFWwindow; focused: Integer); cdecl; |
TGLFWwindowiconifyfun = procedure(window: PGLFWwindow; iconified: Integer); cdecl; |
TGLFWframebuffersizefun = procedure(window: PGLFWwindow; width, height: Integer); cdecl; |
TGLFWmousebuttonfun = procedure(window: PGLFWwindow; button, action, mods: Integer); cdecl; |
TGLFWcursorposfun = procedure(window: PGLFWwindow; xpos, ypos: Double); cdecl; |
TGLFWcursorenterfun = procedure(window: PGLFWwindow; entered: Integer); cdecl; |
TGLFWscrollfun = procedure(window: PGLFWwindow; xoffset, yoffset: Double); cdecl; |
TGLFWkeyfun = procedure(window: PGLFWwindow; key, scancode, action, mods: Integer); cdecl; |
TGLFWcharfun = procedure(window: PGLFWwindow; codepoint: Cardinal); cdecl; |
TGLFWcharmodsfun = procedure(window: PGLFWwindow; codepoint: Cardinal; mods: Integer); cdecl; |
TGLFWdropfun = procedure(window: PGLFWwindow; count: Integer; const paths: PPAnsiChar); cdecl; |
TGLFWmonitorfun = procedure(monitor: PGLFWmonitor; event: Integer); cdecl; |
TGLFWjoystickfun = procedure(joy, event: Integer); cdecl; |
PGLFWvidmode = ˆTGLFWvidmode; |
PPGLFWvidmode = ˆPGLFWvidmode; |
PGLFWgammaramp = ˆTGLFWgammaramp; |
PPGLFWgammaramp = ˆPGLFWgammaramp; |
PGLFWimage = ˆTGLFWimage; |
PPGLFWimage = ˆPGLFWimage; |
Constants
Description
Functions and Procedures
function glfwInit(): Integer; cdecl external GLFW3_LIB name _PU + 'glfwInit'; |
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 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.
Possible errors include GLFW_PLATFORM_ERROR.
On macOS, this function will change the current directory of the application to the Contents/Resources subdirectory of the application's bundle, if present.
This function must only be called from the main thread.
Added in version 1.0.
Returns
GLFW_TRUE if successful, or GLFW_FALSE if an error occurred.
See also
- glfwTerminate
- Terminates the GLFW library.
|
procedure glfwTerminate(); cdecl external GLFW3_LIB name _PU + 'glfwTerminate'; |
Terminates the GLFW library.
This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call 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.
Possible errors include GLFW_PLATFORM_ERROR.
This function may be called before glfwInit.
The contexts of any remaining windows must not be current on any other thread when this function is called.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 1.0.
See also
- glfwInit
- Initializes the GLFW library.
|
procedure glfwGetVersion(major, minor, rev: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetVersion'; |
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 nil .
This function may be called before glfwInit.
This function may be called from any thread.
Added in version 1.0.
Parameters
- major
- Where to store the major version number, or
nil .
- minor
- Where to store the minor version number, or
nil .
- rev
- Where to store the revision number, or
nil .
See also
- glfwGetVersionString
- Returns a string describing the compile-time configuration.
|
function glfwGetVersionString(): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetVersionString'; |
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 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.
This function may be called before glfwInit.
The returned string is static and compile-time generated.
This function may be called from any thread.
Added in version 3.0.
Returns
The ASCII encoded GLFW version string. See also
- glfwGetVersion
- Retrieves the version of the GLFW library.
|
function glfwSetErrorCallback(cbfun: TGLFWerrorfun): TGLFWerrorfun; cdecl external GLFW3_LIB name _PU + 'glfwSetErrorCallback'; |
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 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.
This function may be called before glfwInit.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set. |
function glfwGetMonitors(out count: Integer): PPGLFWmonitor; cdecl external GLFW3_LIB name _PU + 'glfwGetMonitors'; |
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 nil .
Possible errors include GLFW_NOT_INITIALIZED.
The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated.
This function must only be called from the main thread.
Added in version 3.0.
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 nil if no monitors were found or if an error occurred. See also
- glfwGetPrimaryMonitor
- Returns the primary monitor.
|
function glfwGetPrimaryMonitor(): PGLFWmonitor; cdecl external GLFW3_LIB name _PU + 'glfwGetPrimaryMonitor'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
The primary monitor is always first in the array returned by glfwGetMonitors.
Added in version 3.0.
Returns
The primary monitor, or nil if no monitors were found or if an error occurred. See also
- glfwGetMonitors
- Returns the currently connected monitors.
|
procedure glfwGetMonitorPos(monitor: PGLFWmonitor; xpos, ypos: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetMonitorPos'; |
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 nil . If an error occurs, all non-nil position arguments will be set to zero.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- monitor
- The monitor to query.
- xpos
- Where to store the monitor x-coordinate, or
nil .
- ypos
- Where to store the monitor y-coordinate, or
nil .
|
procedure glfwGetMonitorPhysicalSize(monitor: PGLFWmonitor; widthMM, heightMM: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetMonitorPhysicalSize'; |
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 (https://en.wikipedia.org/wiki/Extended_display_identification_data) data is incorrect or because the driver does not report it accurately.
Any or all of the size arguments may be nil . If an error occurs, all non-nil size arguments will be set to zero.
Possible errors include GLFW_NOT_INITIALIZED.
On Windows, calculates the returned physical size from the current resolution and system DPI instead of querying the monitor EDID data.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- monitor
- The monitor to query.
- widthMM
- Where to store the width, in millimetres, of the monitor's display area, or
nil .
- heightMM
- Where to store the height, in millimetres, of the monitor's display area, or
nil .
|
function glfwGetMonitorName(monitor: PGLFWmonitor): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetMonitorName'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- monitor
- The monitor to query.
Returns
The UTF-8 encoded name of the monitor, or nil if an error occurred. |
function glfwSetMonitorCallback(cbfun: TGLFWmonitorfun): TGLFWmonitorfun; cdecl external GLFW3_LIB name _PU + 'glfwSetMonitorCallback'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwGetVideoModes(monitor: PGLFWmonitor; out count: Integer): PGLFWvidmode; cdecl external GLFW3_LIB name _PU + 'glfwGetVideoModes'; |
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) and then by resolution area (the product of width and height).
Possible errors include ref GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 changed to return an array of modes for a specific monitor.
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 nil if an error occurred. See also
- glfwGetVideoMode
- Returns the current mode of the specified monitor.
|
function glfwGetVideoMode(monitor: PGLFWmonitor): PGLFWvidmode; cdecl external GLFW3_LIB name _PU + 'glfwGetVideoMode'; |
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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwGetDesktopMode .
Parameters
- monitor
- The monitor to query.
Returns
The current mode of the monitor, or nil if an error occurred. See also
- glfwGetVideoModes
- Returns the available video modes for the specified monitor.
|
procedure glfwSetGamma(monitor: PGLFWmonitor; gamma: Single); cdecl external GLFW3_LIB name _PU + 'glfwSetGamma'; |
Generates a gamma ramp and sets it for the specified monitor.
This function generates a 256-element gamma ramp from the specified exponent and then calls glfwSetGammaRamp with it. The value must be a finite number greater than zero.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_VALUE and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- monitor
- The monitor whose gamma ramp to set.
- gamma
- The desired exponent.
|
function glfwGetGammaRamp(monitor: PGLFWmonitor): PGLFWgammaramp; cdecl external GLFW3_LIB name _PU + 'glfwGetGammaRamp'; |
Returns the current gamma ramp for the specified monitor.
This function returns the current gamma ramp of the specified monitor.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
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.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- monitor
- The monitor to query.
Returns
The current gamma ramp, or nil if an error occurred. |
procedure glfwSetGammaRamp(monitor: PGLFWmonitor; const ramp: PGLFWgammaramp); cdecl external GLFW3_LIB name _PU + 'glfwSetGammaRamp'; |
Sets the current gamma ramp for the specified monitor.
This function sets the current gamma ramp for the specified monitor. The original gamma ramp for that monitor is saved by GLFW the first time this function is called and is restored by glfwTerminate.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
Gamma ramp sizes other than 256 are not supported by all platforms or graphics hardware.
On Windows, the gamma ramp size must be 256.
The specified gamma ramp is copied before this function returns.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- monitor
- The monitor whose gamma ramp to set.
- ramp
- The gamma ramp to use.
|
procedure glfwDefaultWindowHints(); cdecl external GLFW3_LIB name _PU + 'glfwDefaultWindowHints'; |
Resets all window hints to their default values.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
See also
- glfwWindowHint
- Sets the specified window hint to the desired value.
|
procedure glfwWindowHint(hint: Integer; value: Integer); cdecl external GLFW3_LIB name _PU + 'glfwWindowHint'; |
Sets the specified window hint to the desired value.
This function sets hints for the next call to glfwCreateWindow. The hints, once set, retain their values until changed by a call to glfwWindowHint or glfwDefaultWindowHints, or until the library is terminated.
This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next call to glfwCreateWindow.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_INVALID_ENUM.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwOpenWindowHint .
Parameters
- hint
- The window hint to set.
- value
- The new value of the window hint.
See also
- glfwDefaultWindowHints
- Resets all window hints to their default values.
|
function glfwCreateWindow(width: Integer; height: Integer; const title: PAnsiChar; monitor: PGLFWmonitor; share: PGLFWwindow): PGLFWwindow; cdecl external GLFW3_LIB name _PU + 'glfwCreateWindow'; |
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.
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 glfwGetWindowAttrib, glfwGetWindowSize and glfwGetFramebufferSize.
To create a full screen window, you need to specify the monitor the window will cover. If no monitor is specified, the window will be windowed mode. Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor.
For full screen windows, the specified size becomes the resolution of the window's desired video mode. As long as a full screen window is not iconified, the supported video mode most closely matching the desired video mode is set for the specified monitor.
Once you have created the window, you can switch it between windowed and full screen mode with glfwSetWindowMonitor. If the window has an OpenGL or OpenGL ES context, it will be unaffected.
By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, make it initially invisible using the GLFW_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.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM, GLFW_INVALID_VALUE, GLFW_API_UNAVAILABLE, GLFW_VERSION_UNAVAILABLE, GLFW_FORMAT_UNAVAILABLE and GLFW_PLATFORM_ERROR.
On Windows, window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.
On 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_WINLOGO icon will be used instead. To set a different icon, see glfwSetWindowIcon.
On Windows, the context to share resources with must not be current on any other thread.
On 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 (https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) in the Mac Developer Library.
On macOS, the first time a window is created the menu bar is populated with common commands like Hide, Quit and About. The About entry opens a minimal about dialog with information from the application's bundle.
On OS X 10.10 and later the window frame will not be rendered at full resolution on Retina displays unless the NSHighResolutionCapable key is enabled in the application bundle's Info.plist . For more information, see High Resolution Guidelines for OS X (https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html) in the Mac Developer Library.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwOpenWindow .
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
nil for windowed mode.
- share
- The window whose context to share resources with, or
nil to not share resources.
Returns
The handle of the created window, or nil if an error occurred. See also
- glfwDestroyWindow
- Destroys the specified window and its context.
|
procedure glfwDestroyWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwDestroyWindow'; |
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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The context of the specified window must not be current on any other thread when this function is called.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwCloseWindow .
Parameters
- window
- The window to destroy.
See also
- glfwCreateWindow
- Creates a window and its associated context.
|
function glfwWindowShouldClose(window: PGLFWwindow): Integer; cdecl external GLFW3_LIB name _PU + 'glfwWindowShouldClose'; |
Checks the close flag of the specified window.
This function returns the value of the close flag of the specified window.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
Parameters
- window
- The window to query.
Returns
The value of the close flag. |
procedure glfwSetWindowShouldClose(window: PGLFWwindow; value: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowShouldClose'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
Parameters
- window
- The window whose flag to change.
- value
- The new value.
|
procedure glfwSetWindowTitle(window: PGLFWwindow; const title: PAnsiChar); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowTitle'; |
Sets the title of the specified window.
This function sets the window title, encoded as UTF-8, of the specified window.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
On macOS, the window title will not be updated until the next time you process events.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 Added window handle parameter.
Parameters
- window
- The window whose title to change.
- title
- The UTF-8 encoded window title.
|
procedure glfwSetWindowIcon(window: PGLFWwindow; count: Integer; const images: PGLFWimage); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowIcon'; |
Sets the icon for the specified window.
This function sets the icon of the specified window. If passed an array of candidate images, those of or closest to the sizes desired by the system are selected. If no images are specified, the window reverts to its default icon.
The desired image sizes varies depending on platform and system settings. The selected images will be rescaled as needed. Good sizes include 16x16, 32x32 and 48x48.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The specified image data is copied before this function returns.
On 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 (https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) in the Mac Developer Library.
This function must only be called from the main thread.
Added in version 3.2.
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.
|
procedure glfwGetWindowPos(window: PGLFWwindow; xpos, ypos: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetWindowPos'; |
Retrieves the position of the client area of the specified window.
This function retrieves the position, in screen coordinates, of the upper-left corner of the client area of the specified window.
Any or all of the position arguments may be nil . If an error occurs, all non-nil position arguments will be set to zero.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window to query.
- xpos
- Where to store the x-coordinate of the upper-left corner of the client area, or
nil .
- ypos
- Where to store the y-coordinate of the upper-left corner of the client area, or
nil .
See also
- glfwSetWindowPos
- Sets the position of the client area of the specified window.
|
procedure glfwSetWindowPos(window: PGLFWwindow; xpos, ypos: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowPos'; |
Sets the position of the client area of the specified window.
This function sets the position, in screen coordinates, of the upper-left corner of the client area of the specified windowed mode window. If the window is a full screen window, this function does nothing.
Do not use this function to move an already visible window unless you have very good reasons for doing so, as it will confuse and annoy the user.
The window manager may put limits on what positions are allowed. GLFW cannot and should not override these limits.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The window to query.
- xpos
- The x-coordinate of the upper-left corner of the client area.
- ypos
- The y-coordinate of the upper-left corner of the client area.
See also
- glfwGetWindowPos
- Retrieves the position of the client area of the specified window.
|
procedure glfwGetWindowSize(window: PGLFWwindow; width, height: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetWindowSize'; |
Retrieves the size of the client area of the specified window.
This function retrieves the size, in screen coordinates, of the client area of the specified window. If you wish to retrieve the size of the framebuffer of the window in pixels, see glfwGetFramebufferSize.
Any or all of the size arguments may be nil . If an error occurs, all non-nil size arguments will be set to zero.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The window whose size to retrieve.
- width
- Where to store the width, in screen coordinates, of the client area, or
nil .
- height
- Where to store the height, in screen coordinates, of the client area, or
nil .
See also
- glfwSetWindowSize
- Sets the size of the client area of the specified window.
|
procedure glfwSetWindowSizeLimits(window: PGLFWwindow; minwidth, minheight, maxwidth, maxheight: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowSizeLimits'; |
Sets the size limits of the specified window.
This function sets the size limits of the client area of the specified window. If the window is full screen, the size limits only take effect once it is made windowed. If the window is not resizable, this function does nothing.
The size limits are applied immediately to a windowed mode window and may cause it to be resized.
The maximum dimensions must be greater than or equal to the minimum dimensions and all must be greater than or equal to zero.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_VALUE and GLFW_PLATFORM_ERROR.
If you set size limits and an aspect ratio that conflict, the results are undefined.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- window
- The window to set limits for.
- minwidth
- The minimum width, in screen coordinates, of the client area, or
GLFW_DONT_CARE .
- minheight
- The minimum height, in screen coordinates, of the client area, or
GLFW_DONT_CARE .
- maxwidth
- The maximum width, in screen coordinates, of the client area, or
GLFW_DONT_CARE .
- maxheight
- The maximum height, in screen coordinates, of the client area, or
GLFW_DONT_CARE .
See also
- glfwSetWindowAspectRatio
- Sets the aspect ratio of the specified window.
|
procedure glfwSetWindowAspectRatio(window: PGLFWwindow; numer, denom: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowAspectRatio'; |
Sets the aspect ratio of the specified window.
This function sets the required aspect ratio of the client area of the specified window. If the window is full screen, the aspect ratio only takes effect once it is made windowed. If the window is not resizable, this function does nothing.
The aspect ratio is specified as a numerator and a denominator and both values must be greater than zero. For example, the common 16:9 aspect ratio is specified as 16 and 9, respectively.
If the numerator and denominator is set to GLFW_DONT_CARE then the aspect ratio limit is disabled.
The aspect ratio is applied immediately to a windowed mode window and may cause it to be resized.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_VALUE and GLFW_PLATFORM_ERROR.
If you set size limits and an aspect ratio that conflict, the results are undefined.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- window
- The window to set limits for.
- numer
- The numerator of the desired aspect ratio, or
GLFW_DONT_CARE .
- denom
- The denominator of the desired aspect ratio, or
GLFW_DONT_CARE .
See also
- glfwSetWindowSizeLimits
- Sets the size limits of the specified window.
|
procedure glfwSetWindowSize(window: PGLFWwindow; width, height: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowSize'; |
Sets the size of the client area of the specified window.
This function sets the size, in screen coordinates, of the client area of the specified window.
For full screen windows, this function updates the resolution of its desired video mode and switches to the video mode closest to it, without affecting the window's context. As the context is unaffected, the bit depths of the framebuffer remain unchanged.
If you wish to update the refresh rate of the desired video mode in addition to its resolution, see glfwSetWindowMonitor.
The window manager may put limits on what sizes are allowed. GLFW cannot and should not override these limits.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The window to resize.
- width
- The desired width, in screen coordinates, of the window client area.
- height
- The desired height, in screen coordinates, of the window client area.
See also
- glfwGetWindowSize
- Retrieves the size of the client area of the specified window.
- glfwSetWindowMonitor
- Sets the mode, monitor, video mode and placement of a window.
|
procedure glfwGetFramebufferSize(window: PGLFWwindow; width, height: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetFramebufferSize'; |
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 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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- 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 .
See also
- glfwSetFramebufferSizeCallback
- Sets the framebuffer resize callback for the specified window.
|
procedure glfwGetWindowFrameSize(window: PGLFWwindow; left, top, right, bottom: PInteger); cdecl external GLFW3_LIB name _PU + 'glfwGetWindowFrameSize'; |
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 nil . If an error occurs, all non-nil size arguments will be set to zero.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.1.
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
nil .
- top
- Where to store the size, in screen coordinates, of the top edge of the window frame, or
nil .
- right
- Where to store the size, in screen coordinates, of the right edge of the window frame, or
nil .
- bottom
- Where to store the size, in screen coordinates, of the bottom edge of the window frame, or
nil .
|
procedure glfwIconifyWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwIconifyWindow'; |
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, the original monitor resolution is restored until the window is restored.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 2.1. GLFW3 added window handle parameter.
Parameters
- window
- The window to iconify.
See also
- glfwRestoreWindow
- Restores the specified window.
- glfwMaximizeWindow
- Maximizes the specified window.
|
procedure glfwRestoreWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwRestoreWindow'; |
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 a full screen window, the resolution chosen for the window is restored on the selected monitor.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 2.1. GLFW3 added window handle parameter.
Parameters
- window
- The window to restore.
See also
- glfwIconifyWindow
- Iconifies the specified window.
- glfwMaximizeWindow
- Maximizes the specified window.
|
procedure glfwMaximizeWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwMaximizeWindow'; |
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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function may only be called from the main thread.
Added in GLFW 3.2.
Parameters
- window
- The window to maximize.
See also
- glfwIconifyWindow
- Iconifies the specified window.
- glfwRestoreWindow
- Restores the specified window.
|
procedure glfwShowWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwShowWindow'; |
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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window to make visible.
See also
- glfwHideWindow
- Hides the specified window.
|
procedure glfwHideWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwHideWindow'; |
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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window to hide.
See also
- glfwShowWindow
- Makes the specified window visible.
|
procedure glfwFocusWindow(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwFocusWindow'; |
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 GLFW_FOCUSED 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.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- window
- The window to give input focus.
|
function glfwGetWindowMonitor(window: PGLFWwindow): PGLFWmonitor; cdecl external GLFW3_LIB name _PU + 'glfwGetWindowMonitor'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window to query.
Returns
The monitor, or nil if the window is in windowed mode or an error occurred. See also
- glfwSetWindowMonitor
- Sets the mode, monitor, video mode and placement of a window.
|
procedure glfwSetWindowMonitor(window: PGLFWwindow; monitor: PGLFWmonitor; xpos, ypos, width, height, refreshRate: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowMonitor'; |
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 nil , 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 nil , the position, width and height are used to place the window client area. The refresh rate is ignored when no monitor is specified.
If you only wish to update the resolution of a full screen window or the size of a windowed mode window, see 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..
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- window
- The window whose monitor, size or video mode to set.
- monitor
- The desired monitor, or
nil to set windowed mode.
- xpos
- The desired x-coordinate of the upper-left corner of the client area.
- ypos
- The desired y-coordinate of the upper-left corner of the client area.
- width
- The desired with, in screen coordinates, of the client area or video mode.
- height
- The desired height, in screen coordinates, of the client area or video mode.
- refreshRate
- The desired refresh rate, in Hz, of the video mode, or
GLFW_DONT_CARE .
See also
- glfwGetWindowMonitor
- Returns the monitor that the window uses for full screen mode.
- glfwSetWindowSize
- Sets the size of the client area of the specified window.
|
function glfwGetWindowAttrib(window: PGLFWwindow; attrib: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetWindowAttrib'; |
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.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
Framebuffer related hints are not window attributes.
Zero is a valid value for many window and context related attributes so you cannot use a return value of zero as an indication of errors. However, this function should not fail as long as it is passed valid arguments and the library has been initialized.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwGetWindowParam and glfwGetGLVersion .
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. |
procedure glfwSetWindowUserPointer(window: PGLFWwindow; pointer: Pointer); cdecl external GLFW3_LIB name _PU + 'glfwSetWindowUserPointer'; |
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 nil .
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
Parameters
- window
- The window whose pointer to set.
- pointer
- The new value.
See also
- glfwGetWindowUserPointer
- Returns the user pointer of the specified window.
|
function glfwGetWindowUserPointer(window: PGLFWwindow): Pointer; cdecl external GLFW3_LIB name _PU + 'glfwGetWindowUserPointer'; |
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 nil .
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
Parameters
- window
- The window whose pointer to return.
See also
- glfwSetWindowUserPointer
- Sets the user pointer of the specified window.
|
function glfwSetWindowPosCallback(window: PGLFWwindow; cbfun: TGLFWwindowposfun): TGLFWwindowposfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowPosCallback'; |
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 screen position of the upper-left corner of the client area of the window.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetWindowSizeCallback(window: PGLFWwindow; cbfun: TGLFWwindowsizefun): TGLFWwindowsizefun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowSizeCallback'; |
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 client area of the window.
Returns: The previously set callback, or nil if no callback was set or the library had not been initialized.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter and return value.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
|
function glfwSetWindowCloseCallback(window: PGLFWwindow; cbfun: TGLFWwindowclosefun): TGLFWwindowclosefun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowCloseCallback'; |
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 glfwSetWindowShouldClose.
The close callback is not triggered by glfwDestroyWindow.
Possible errors include GLFW_NOT_INITIALIZED.
On macOS, selecting Quit from the application menu will trigger the close callback for all windows.
This function must only be called from the main thread.
Added in version 2.5. GLFW3 added window handle parameter and return value.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetWindowRefreshCallback(window: PGLFWwindow; cbfun: TGLFWwindowrefreshfun): TGLFWwindowrefreshfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowRefreshCallback'; |
Sets the refresh callback for the specified window.
This function sets the refresh callback of the specified window, which is called when the client area of the window needs to be redrawn, for example if the window has been exposed after having been covered by another window.
On compositing window systems such as Aero, Compiz or Aqua, where the window contents are saved off-screen, this callback may be called only very infrequently or never at all.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 2.5. GLFW3 added window handle parameter and return value.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetWindowFocusCallback(window: PGLFWwindow; cbfun: TGLFWwindowfocusfun): TGLFWwindowfocusfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowFocusCallback'; |
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 glfwSetKeyCallback and glfwSetMouseButtonCallback.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetWindowIconifyCallback(window: PGLFWwindow; cbfun: TGLFWwindowiconifyfun): TGLFWwindowiconifyfun; cdecl external GLFW3_LIB name _PU + 'glfwSetWindowIconifyCallback'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetFramebufferSizeCallback(window: PGLFWwindow; cbfun: TGLFWframebuffersizefun): TGLFWframebuffersizefun; cdecl external GLFW3_LIB name _PU + 'glfwSetFramebufferSizeCallback'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
procedure glfwPollEvents(); cdecl external GLFW3_LIB name _PU + 'glfwPollEvents'; |
Processes all pending events.
This function processes only those events that are already in the event queue and then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.
On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.
On some platforms, certain events are sent directly to the application without going through the event queue, causing callbacks to be called outside of a call to one of the event processing functions.
Event processing is not required for joystick input to work.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 1.0.
See also
- glfwWaitEvents
- Waits until events are queued and processes them.
- glfwWaitEventsTimeout
- Waits with timeout until events are queued and processes them.
|
procedure glfwWaitEvents(); cdecl external GLFW3_LIB name _PU + 'glfwWaitEvents'; |
Waits until events are queued and processes them.
This function puts the calling thread to sleep until at least one event is available in the event queue. Once one or more events are available, it behaves exactly like 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.
On some platforms, certain callbacks may be called outside of a call to one of the event processing functions.
If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use your threading library of choice.
Event processing is not required for joystick input to work.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 2.5.
See also
- glfwPollEvents
- Processes all pending events.
- glfwWaitEventsTimeout
- Waits with timeout until events are queued and processes them.
|
procedure glfwWaitEventsTimeout(timeout: Double); cdecl external GLFW3_LIB name _PU + 'glfwWaitEventsTimeout'; |
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 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.
On some platforms, certain callbacks may be called outside of a call to one of the event processing functions.
If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use your threading library of choice.
Event processing is not required for joystick input to work.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- timeout
- The maximum amount of time, in seconds, to wait.
See also
- glfwPollEvents
- Processes all pending events.
- glfwWaitEvents
- Waits until events are queued and processes them.
|
procedure glfwPostEmptyEvent(); cdecl external GLFW3_LIB name _PU + 'glfwPostEmptyEvent'; |
Posts an empty event to the event queue.
This function posts an empty event from the current thread to the event queue, causing glfwWaitEvents or glfwWaitEventsTimeout to return.
If no windows exist, this function returns immediately. For synchronization of threads in applications that do not create windows, use your threading library of choice.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function may be called from any thread.
Added in version 3.1.
See also
- glfwWaitEvents
- Waits until events are queued and processes them.
- glfwWaitEventsTimeout
- Waits with timeout until events are queued and processes them.
|
procedure glfwSetInputMode(window: PGLFWwindow; mode, value: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSetInputMode'; |
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 GLFW_CURSOR , GLFW_STICKY_KEYS or GLFW_STICKY_MOUSE_BUTTONS .
If the mode is GLFW_CURSOR , the value must be one of the following cursor modes:
GLFW_CURSOR_NORMAL makes the cursor visible and behaving normally.
GLFW_CURSOR_HIDDEN makes the cursor invisible when it is over the client area of the window but does not restrict the cursor from leaving.
GLFW_CURSOR_DISABLED hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera controls.
If the mode is GLFW_STICKY_KEYS , the value must be either GLFW_TRUE to enable sticky keys, or GLFW_FALSE to disable it. If sticky keys are enabled, a key press will ensure that 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.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwEnable and glfwDisable .
Parameters
- window
- The window whose input mode to set.
- mode
- One of
GLFW_CURSOR , GLFW_STICKY_KEYS or GLFW_STICKY_MOUSE_BUTTONS .
- value
- The new value of the specified input mode.
See also
- glfwGetInputMode
- Returns the value of an input option for the specified window.
|
function glfwGetKeyName(key: Integer; scancode: Integer): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetKeyName'; |
Returns the localized name of the specified printable key.
This function returns the localized name of the specified printable key. This is intended for displaying key bindings to the user.
If the key is GLFW_KEY_UNKNOWN , the scancode is used instead, otherwise the scancode is ignored. If a non-printable key or (if the key is GLFW_KEY_UNKNOWN ) a scancode that maps to a non-printable key is specified, this function returns nil .
This behavior allows you to pass in the arguments passed to the key callback without modification.
The printable keys are:
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to glfwGetKeyName , or until the library is terminated.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- key
- The key to query, or
GLFW_KEY_UNKNOWN .
- scancode
- The scancode of the key to query.
Returns
The localized name of the key, or nil . |
function glfwGetKey(window: PGLFWwindow; key: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetKey'; |
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 GLFW_PRESS or GLFW_RELEASE . The higher-level action GLFW_REPEAT is only reported to the key callback.
If the GLFW_STICKY_KEYS input mode is enabled, this function returns GLFW_PRESS the first time you call it for a key that was pressed, even if that key has already been released.
The key functions deal with physical keys, with key tokens named after their use on the standard US keyboard layout. If you want to input text, use the Unicode character callback instead.
The modifier key bit masks are not key tokens and cannot be used with this function.
Do not use this function to implement text input.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_INVALID_ENUM.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The desired window.
- key
- The desired keyboard key.
GLFW_KEY_UNKNOWN is not a valid key for this function.
Returns
One of GLFW_PRESS or GLFW_RELEASE . |
function glfwGetMouseButton(window: PGLFWwindow; button: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwGetMouseButton'; |
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 GLFW_PRESS or GLFW_RELEASE .
If the GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function GLFW_PRESS the first time you call it for a mouse button that was pressed, even if that mouse button has already been released.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_INVALID_ENUM.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The desired window.
- button
- The desired mouse button.
Returns
One of GLFW_PRESS or GLFW_RELEASE . |
procedure glfwGetCursorPos(window: PGLFWwindow; xpos, ypos: PDouble); cdecl external GLFW3_LIB name _PU + 'glfwGetCursorPos'; |
Retrieves the position of the cursor relative to the client area of the window.
This function returns the position of the cursor, in screen coordinates, relative to the upper-left corner of the client area of the specified window.
If the cursor is disabled (with GLFW_CURSOR_DISABLED ) then the cursor position is unbounded and limited only by the minimum and maximum values of a double .
The coordinate can be converted to their integer equivalents with the floor function. Casting directly to an integer type works for positive coordinates, but fails for negative ones.
Any or all of the position arguments may be nil . If an error occurs, all non-nil position arguments will be set to zero.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwGetMousePos .
Parameters
- window
- The desired window.
- xpos
- Where to store the cursor x-coordinate, relative to the left edge of the client area, or
nil .
- ypos
- Where to store the cursor y-coordinate, relative to the to top edge of the client area, or
nil .
See also
- glfwSetCursorPos
- Sets the position of the cursor, relative to the client area of the window.
|
procedure glfwSetCursorPos(window: PGLFWwindow; xpos, ypos: Double); cdecl external GLFW3_LIB name _PU + 'glfwSetCursorPos'; |
Sets the position of the cursor, relative to the client area of the window.
This function sets the position, in screen coordinates, of the cursor relative to the upper-left corner of the client area of the specified window. The window must have input focus. If the window does not have input focus when this function is called, it fails silently.
Do not use this function to implement things like camera controls. GLFW already provides the GLFW_CURSOR_DISABLED cursor mode that hides the cursor, transparently re-centers it and provides unconstrained cursor motion. See 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 .
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwSetMousePos .
Parameters
- window
- The desired window.
- xpos
- The desired x-coordinate, relative to the left edge of the client area.
- ypos
- The desired y-coordinate, relative to the top edge of the client area.
See also
- glfwGetCursorPos
- Retrieves the position of the cursor relative to the client area of the window.
|
function glfwCreateCursor(const image: PGLFWimage; xhot: Integer; yhot: Integer): PGLFWcursor; cdecl external GLFW3_LIB name _PU + 'glfwCreateCursor'; |
Creates a custom cursor.
Creates a new custom cursor image that can be set for a window with glfwSetCursor. The cursor can be destroyed with glfwDestroyCursor. Any remaining cursors are destroyed by glfwTerminate.
The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel. They are arranged canonically as packed sequential rows, starting from the top-left corner.
The cursor hotspot is specified in pixels, relative to the upper-left corner of the cursor image. Like all other coordinate systems in GLFW, the X-axis points to the right and the Y-axis points down.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The specified image data is copied before this function returns.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 3.1.
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 nil if an error occurred. See also
- glfwDestroyCursor
- Destroys a cursor.
- glfwCreateStandardCursor
- Creates a cursor with a standard shape.
|
function glfwCreateStandardCursor(shape: Integer): PGLFWcursor; cdecl external GLFW3_LIB name _PU + 'glfwCreateStandardCursor'; |
Creates a cursor with a standard shape.
Returns a cursor with a standard shape, that can be set for a window with glfwSetCursor.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 3.1.
Parameters
- shape
- One of the standard shapes.
Returns
A new cursor ready to use or nil if an error occurred. See also
- glfwCreateCursor
- Creates a custom cursor.
|
procedure glfwDestroyCursor(cursor: PGLFWcursor); cdecl external GLFW3_LIB name _PU + 'glfwDestroyCursor'; |
Destroys a cursor.
This function destroys a cursor previously created with glfwCreateCursor. Any remaining cursors will be destroyed by glfwTerminate.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must not be called from a callback.
This function must only be called from the main thread.
Added in version 3.1.
Parameters
- cursor
- The cursor object to destroy.
See also
- glfwCreateCursor
- Creates a custom cursor.
|
procedure glfwSetCursor(window: PGLFWwindow; cursor: PGLFWcursor); cdecl external GLFW3_LIB name _PU + 'glfwSetCursor'; |
Sets the cursor for the window.
This function sets the cursor image to be used when the cursor is over the client area of the specified window. The set cursor will only be visible when the cursor mode of the window is GLFW_CURSOR_NORMAL .
On some platforms, the set cursor may not be visible unless the window also has input focus.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.1.
Parameters
- window
- The window to set the cursor for.
- cursor
- The cursor to set, or
nil to switch back to the default arrow cursor.
|
function glfwSetKeyCallback(window: PGLFWwindow; cbfun: TGLFWkeyfun): TGLFWkeyfun; cdecl external GLFW3_LIB name _PU + 'glfwSetKeyCallback'; |
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 callback 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 callback (glfwSetWindowFocusCallback) 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 GLFW_KEY_UNKNOWN , their state is not saved and so it cannot be queried with glfwGetKey.
Sometimes GLFW needs to generate synthetic key events, in which case the scancode may be zero.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter and return value.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new key callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetCharCallback(window: PGLFWwindow; cbfun: TGLFWcharfun): TGLFWcharfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCharCallback'; |
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 callback (glfwSetKeyCallback) is not. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback instead.
The character callback behaves as system text input normally does and will not be called if modifier keys are held down that would prevent normal text input on that platform, for example a Super (Command) key on OS X or Alt key on Windows. There is a character with modifiers callback (glfwSetCharModsCallback) that receives these events.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 2.4. GLFW3 added window handle parameter and return value.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetCharModsCallback(window: PGLFWwindow; cbfun: TGLFWcharmodsfun): TGLFWcharmodsfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCharModsCallback'; |
Sets the Unicode character with modifiers callback.
This function sets the character with modifiers callback of the specified window, which is called when a Unicode character is input regardless of what modifier keys are used.
The character with modifiers callback is intended for implementing custom Unicode character input. For regular Unicode text input, see the character callback (glfwSetCharCallback). Like the character callback, the character with modifiers callback deals with characters and is keyboard layout dependent. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was pressed or released, see the key callback (glfwSetKeyCallback) instead.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.1.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or an error occurred. |
function glfwSetMouseButtonCallback(window: PGLFWwindow; cbfun: TGLFWmousebuttonfun): TGLFWmousebuttonfun; cdecl external GLFW3_LIB name _PU + 'glfwSetMouseButtonCallback'; |
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 callback (glfwSetWindowFocusCallback) has been called.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 1.0. GLFW3 added window handle parameter and return value.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetCursorPosCallback(window: PGLFWwindow; cbfun: TGLFWcursorposfun): TGLFWcursorposfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCursorPosCallback'; |
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 client area of the window.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwSetMousePosCallback .
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetCursorEnterCallback(window: PGLFWwindow; cbfun: TGLFWcursorenterfun): TGLFWcursorenterfun; cdecl external GLFW3_LIB name _PU + 'glfwSetCursorEnterCallback'; |
Sets the cursor enter/exit callback.
This function sets the cursor boundary crossing callback of the specified window, which is called when the cursor enters or leaves the client area of the window.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetScrollCallback(window: PGLFWwindow; cbfun: TGLFWscrollfun): TGLFWscrollfun; cdecl external GLFW3_LIB name _PU + 'glfwSetScrollCallback'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwSetMouseWheelCallback .
Parameters
- window
- The window whose callback to set.
- cbfun
- The new scroll callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwSetDropCallback(window: PGLFWwindow; cbfun: TGLFWdropfun): TGLFWdropfun; cdecl external GLFW3_LIB name _PU + 'glfwSetDropCallback'; |
Sets the file drop callback.
This function sets the file drop callback of the specified window, which is called when one or more dragged files are dropped on the window.
Because the path array and its strings may have been generated specifically for that event, they are not guaranteed to be valid after the callback has returned. If you wish to use them after the callback returns, you need to make a deep copy.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.1.
Parameters
- window
- The window whose callback to set.
- cbfun
- The new file drop callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
function glfwJoystickPresent(joy: Integer): Integer; cdecl external GLFW3_LIB name _PU + 'glfwJoystickPresent'; |
Returns whether the specified joystick is present.
This function returns whether the specified joystick is present.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwGetJoystickParam .
Parameters
- joy
- The joystick to query.
Returns
GLFW_TRUE if the joystick is present, or GLFW_FALSE otherwise.
|
function glfwGetJoystickAxes(joy: Integer; out count: Integer): PSingle; cdecl external GLFW3_LIB name _PU + 'glfwGetJoystickAxes'; |
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.
Querying a joystick slot with no device present is not an error, but will cause this function to return nil . Call glfwJoystickPresent to check device presence.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
This function must only be called from the main thread.
Added in version 3.0. Replaces glfwGetJoystickPos .
Parameters
- joy
- 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 nil if the joystick is not present or an error occurred. |
function glfwGetJoystickButtons(joy: Integer; out count: Integer): PByte; cdecl external GLFW3_LIB name _PU + 'glfwGetJoystickButtons'; |
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 GLFW_PRESS or GLFW_RELEASE .
Querying a joystick slot with no device present is not an error, but will cause this function to return nil . Call glfwJoystickPresent to check device presence.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
This function must only be called from the main thread.
Added in version 2.2. GLFW3 changed to return a dynamic array.
Parameters
- joy
- 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 nil if the joystick is not present or an error occurred. |
function glfwGetJoystickName(joy: Integer): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetJoystickName'; |
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.
Querying a joystick slot with no device present is not an error, but will cause this function to return nil . Call glfwJoystickPresent to check device presence.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_INVALID_ENUM and GLFW_PLATFORM_ERROR.
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- joy
- The joystick to query.
Returns
The UTF-8 encoded name of the joystick, or nil if the joystick is not present or an error occurred. |
function glfwSetJoystickCallback(cbfun: TGLFWjoystickfun): TGLFWjoystickfun; cdecl external GLFW3_LIB name _PU + 'glfwSetJoystickCallback'; |
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.
Possible errors include GLFW_NOT_INITIALIZED.
This function must only be called from the main thread.
Added in version 3.2.
Parameters
- cbfun
- The new callback, or
nil to remove the currently set callback.
Returns
The previously set callback, or nil if no callback was set or the library had not been initialized. |
procedure glfwSetClipboardString(window: PGLFWwindow; const text: PAnsiChar); cdecl external GLFW3_LIB name _PU + 'glfwSetClipboardString'; |
Sets the clipboard to the specified string.
This function sets the system clipboard to the specified, UTF-8 encoded string.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The specified string is copied before this function returns.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window that will own the clipboard contents.
- text
- string A UTF-8 encoded string.
See also
- glfwGetClipboardString
- Returns the contents of the clipboard as a string.
|
function glfwGetClipboardString(window: PGLFWwindow): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetClipboardString'; |
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, nil is returned and a GLFW_FORMAT_UNAVAILABLE error is generated.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_PLATFORM_ERROR.
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to glfwGetClipboardString or glfwSetClipboardString, or until the library is terminated.
This function must only be called from the main thread.
Added in version 3.0.
Parameters
- window
- The window that will request the clipboard contents.
Returns
The contents of the clipboard as a UTF-8 encoded string, or nil if an error occurred. See also
- glfwSetClipboardString
- Sets the clipboard to the specified string.
|
function glfwGetTime(): Double; cdecl external GLFW3_LIB name _PU + 'glfwGetTime'; |
Returns the value of the GLFW timer.
This function returns the value of the GLFW timer. Unless the timer has been set using glfwSetTime, the timer measures time elapsed since GLFW was initialized.
The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic time source on each supported platform.
Returns: The current value, in seconds, or zero if an error occurred.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized with calls to glfwSetTime.
Added in version 1.0.
|
procedure glfwSetTime(time: Double); cdecl external GLFW3_LIB name _PU + 'glfwSetTime'; |
Sets the GLFW timer.
This function sets the value of the GLFW timer. It then continues to count up from that value. The value must be a positive finite number less than or equal to 18446744073.0, which is approximately 584.5 years.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_INVALID_VALUE.
This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized with calls to glfwGetTime.
Added in version 2.2.
Parameters
- time
- The new value, in seconds.
|
function glfwGetTimerValue(): UInt64; cdecl external GLFW3_LIB name _PU + 'glfwGetTimerValue'; |
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 glfwGetTimerFrequency.
Returns: The value of the timer, or zero if an error occurred.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread.
Added in version 3.2.
See also
- glfwGetTimerFrequency
- Returns the frequency, in Hz, of the raw timer.
|
function glfwGetTimerFrequency(): UInt64; cdecl external GLFW3_LIB name _PU + 'glfwGetTimerFrequency'; |
Returns the frequency, in Hz, of the raw timer.
This function returns the frequency, in Hz, of the raw timer.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread.
Added in version 3.2.
Returns
The frequency of the timer, in Hz, or zero if an error occurred. See also
- glfwGetTimerValue
- Returns the current value of the raw timer.
|
procedure glfwMakeContextCurrent(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwMakeContextCurrent'; |
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 can only be made current on a single thread at a time and each thread can have only a single current context at a time.
By default, making a context non-current implicitly forces a pipeline flush. On machines that support GL_KHR_context_flush_control , you can control whether a context performs this flush by setting the GLFW_CONTEXT_RELEASE_BEHAVIOR window 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.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_NO_WINDOW_CONTEXT and GLFW_PLATFORM_ERROR.
This function may be called from any thread.
Added in version 3.0.
Parameters
- window
- The window whose context to make current, or
nil to detach the current context.
See also
- glfwGetCurrentContext
- Returns the window whose context is current on the calling thread.
|
function glfwGetCurrentContext(): PGLFWwindow; cdecl external GLFW3_LIB name _PU + 'glfwGetCurrentContext'; |
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 nil if no window's context is current.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread.
Added in version 3.0.
See also
- glfwMakeContextCurrent
- Makes the context of the specified window current for the calling thread.
|
procedure glfwSwapBuffers(window: PGLFWwindow); cdecl external GLFW3_LIB name _PU + 'glfwSwapBuffers'; |
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 GLFW_NO_WINDOW_CONTEXT error.
This function does not apply to Vulkan. If you are rendering with Vulkan, see vkQueuePresentKHR instead.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_NO_WINDOW_CONTEXT and GLFW_PLATFORM_ERROR.
This function may be called from any thread.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The window whose buffers to swap.
See also
- glfwSwapInterval
- Sets the swap interval for the current context.
|
procedure glfwSwapInterval(interval: Integer); cdecl external GLFW3_LIB name _PU + 'glfwSwapInterval'; |
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 glfwSwapBuffers was called before swapping the buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization or just vsync.
Contexts that support either of the WGL_EXT_swap_control_tear and GLX_EXT_swap_control_tear extensions also accept negative swap intervals, which allow the driver to swap even if a frame arrives a little bit late. You can check for the presence of these extensions using glfwExtensionSupported. For more information about swap tearing, see the extension specifications.
A context must be current on the calling thread. Calling this function without a current context will cause a 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.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_NO_CURRENT_CONTEXT and GLFW_PLATFORM_ERROR.
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.
This function may be called from any thread.
Added in version 1.0.
Parameters
- interval
- The minimum number of screen updates to wait for until the buffers are swapped by glfwSwapBuffers.
See also
- glfwSwapBuffers
- Swaps the front and back buffers of the specified window.
|
function glfwExtensionSupported(const extension: PAnsiChar): Integer; cdecl external GLFW3_LIB name _PU + 'glfwExtensionSupported'; |
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 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 glfwGetRequiredInstanceExtensions, vkEnumerateInstanceExtensionProperties and vkEnumerateDeviceExtensionProperties instead.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_NO_CURRENT_CONTEXT, GLFW_INVALID_VALUE and GLFW_PLATFORM_ERROR.
This function may be called from any thread.
Added in version 1.0.
Parameters
- extension
- The ASCII encoded name of the extension.
Returns
GLFW_TRUE if the extension is available, or GLFW_FALSE otherwise.
See also
- glfwGetProcAddress
- Returns the address of the specified function for the current context.
|
function glfwGetProcAddress(const procname: PAnsiChar): TGLFWglproc; cdecl external GLFW3_LIB name _PU + 'glfwGetProcAddress'; |
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 GLFW_NO_CURRENT_CONTEXT error.
This function does not apply to Vulkan. If you are rendering with Vulkan, see glfwGetInstanceProcAddress, vkGetInstanceProcAddr and vkGetDeviceProcAddr instead.
Possible errors include GLFW_NOT_INITIALIZED, GLFW_NO_CURRENT_CONTEXT and GLFW_PLATFORM_ERROR.
The address of a given function is not guaranteed to be the same between contexts.
This function may return a non-nil address despite the associated version or extension not being available. Always check the context version or extension string first.
The returned function pointer is valid until the context is destroyed or the library is terminated.
This function may be called from any thread.
Added in version 1.0.
Parameters
- procname
- The ASCII encoded name of the function.
Returns
The address of the function, or nil if an error occurred. See also
- glfwExtensionSupported
- Returns whether the specified extension is available.
|
function glfwVulkanSupported(): Integer; cdecl external GLFW3_LIB name _PU + 'glfwVulkanSupported'; |
Returns whether the Vulkan loader has been found.
This function returns whether the Vulkan loader has been found. This check is performed by glfwInit.
The availability of a Vulkan loader does not by itself guarantee that window surface creation or even device creation is possible. Call glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan surface creation are available and glfwGetPhysicalDevicePresentationSupport to check whether a queue family of a physical device supports image presentation.
Possible errors include GLFW_NOT_INITIALIZED.
This function may be called from any thread.
Added in version 3.2.
Returns
GLFW_TRUE if Vulkan is available, or GLFW_FALSE otherwise.
|
function glfwGetRequiredInstanceExtensions(out count: UInt32): PPAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetRequiredInstanceExtensions'; |
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 contains VK_KHR_surface , so if you don't require any additional extensions you can pass this list directly to the VkInstanceCreateInfo struct.
If Vulkan is not available on the machine, this function returns nil and generates a GLFW_API_UNAVAILABLE error. Call glfwVulkanSupported to check whether Vulkan is available.
If Vulkan is available but no set of extensions allowing window surface creation was found, this function returns nil . You may still use Vulkan for off-screen rendering and compute work.
Possible errors include GLFW_NOT_INITIALIZED and GLFW_API_UNAVAILABLE.
Additional extensions may be required by future versions of GLFW. You should check if any extensions you wish to enable are already in the returned array, as it is an error to specify an extension more than once in the VkInstanceCreateInfo struct.
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.
This function may be called from any thread.
Added in version 3.2.
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 nil if an error occurred. |
function glfwGetWin32Adapter(monitor: PGLFWmonitor): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetWin32Adapter'; |
Returns the adapter device name of the specified monitor.
Returns: The UTF-8 encoded adapter device name (for example \\.\DISPLAY1 ) of the specified monitor, or nil if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.1.
|
function glfwGetWin32Monitor(monitor: PGLFWmonitor): PAnsiChar; cdecl external GLFW3_LIB name _PU + 'glfwGetWin32Monitor'; |
Returns the display device name of the specified monitor.
Returns: The UTF-8 encoded display device name (for example \\.\DISPLAY1\Monitor0 ) of the specified monitor, or nil if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.1.
|
function glfwGetWin32Window(window: PGLFWwindow): HWND; cdecl external GLFW3_LIB name _PU + 'glfwGetWin32Window'; |
Returns the HWND of the specified window.
Returns: The HWND of the specified window, or nil if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
|
function glfwGetWGLContext(window: PGLFWwindow): HGLRC; cdecl external GLFW3_LIB name _PU + 'glfwGetWGLContext'; |
Returns the HGLRC of the specified window.
Returns: The HGLRC of the specified window, or nil if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
|
function glfwGetCocoaMonitor(monitor: PGLFWmonitor): CGDirectDisplayID; cdecl external GLFW3_LIB name _PU + 'glfwGetCocoaMonitor'; |
Returns the CGDirectDisplayID of the specified monitor.
Returns: The CGDirectDisplayID of the specified monitor, or kCGNullDirectDisplay if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.1.
|
function glfwGetCocoaWindow(window: PGLFWwindow): Id; cdecl external GLFW3_LIB name _PU + 'glfwGetCocoaWindow'; |
Returns the NSWindow of the specified window.
Returns: The NSWindow of the specified window, or nil if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
|
function glfwGetNSGLContext(window: PGLFWwindow): Id; cdecl external GLFW3_LIB name _PU + 'glfwGetNSGLContext'; |
Returns the NSOpenGLContext of the specified window.
Returns: The NSOpenGLContext of the specified window, or nil if an error occurred.
This function may be called from any thread. Access is not synchronized.
Added in version 3.0.
|
Types
TGLFWglproc = procedure(); cdecl; |
Client API function pointer type.
Generic function pointer used for returning client API function pointers without forcing a cast from a regular pointer.
Added in version 3.0.
See also
- glfwGetProcAddress
- Returns the address of the specified function for the current context.
|
PGLFWmonitor = Pointer; |
Opaque monitor object.
Added in version 3.0.
|
PGLFWwindow = Pointer; |
Opaque window object.
Added in version 3.0.
|
PGLFWcursor = Pointer; |
Opaque cursor object.
Added in version 3.1.
|
TGLFWerrorfun = procedure(error: Integer; const description: PAnsiChar); cdecl; |
The function signature for error callbacks.
Added in version 3.0.
Parameters
- error
- An error code.
- description
- A UTF-8 encoded string describing the error.
See also
- glfwSetErrorCallback
- Sets the error callback.
|
TGLFWwindowposfun = procedure(window: PGLFWwindow; xpos, ypos: Integer); cdecl; |
The function signature for window position callbacks.
Added in version 3.0.
Parameters
- window
- The window that was moved.
- xpos
- The new x-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
- ypos
- The new y-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
See also
- glfwSetWindowPosCallback
- Sets the position callback for the specified window.
|
TGLFWwindowsizefun = procedure(window: PGLFWwindow; width, height: Integer); cdecl; |
The function signature for window resize callbacks.
Added in version 1.0. GLFW3 added window handle parameter.
Parameters
- window
- The window that was resized.
- width
- The new width, in screen coordinates, of the window.
- height
- The new height, in screen coordinates, of the window.
See also
- glfwSetWindowSizeCallback
- Sets the size callback for the specified window.
|
TGLFWwindowclosefun = procedure(window: PGLFWwindow); cdecl; |
The function signature for window close callbacks.
Added in version 2.5. GLFW3 added window handle parameter.
Parameters
- window
- The window that the user attempted to close.
See also
- glfwSetWindowCloseCallback
- Sets the close callback for the specified window.
|
TGLFWwindowrefreshfun = procedure(window: PGLFWwindow); cdecl; |
The function signature for window content refresh callbacks.
Added in version 2.5. GLFW3 added window handle parameter.
Parameters
- window
- The window whose content needs to be refreshed.
See also
- glfwSetWindowRefreshCallback
- Sets the refresh callback for the specified window.
|
TGLFWwindowfocusfun = procedure(window: PGLFWwindow; focused: Integer); cdecl; |
The function signature for window focus/defocus callbacks.
Added in version 3.0.
Parameters
- window
- The window that gained or lost input focus.
- focused
GLFW_TRUE if the window was given input focus, or GLFW_FALSE if it lost it.
See also
- glfwSetWindowFocusCallback
- Sets the focus callback for the specified window.
|
TGLFWwindowiconifyfun = procedure(window: PGLFWwindow; iconified: Integer); cdecl; |
The function signature for window iconify/restore callbacks.
Added in version 3.0.
Parameters
- window
- The window that was iconified or restored.
- iconified
GLFW_TRUE if the window was iconified, or GLFW_FALSE if it was restored.
See also
- glfwSetWindowIconifyCallback
- Sets the iconify callback for the specified window.
|
TGLFWframebuffersizefun = procedure(window: PGLFWwindow; width, height: Integer); cdecl; |
The function signature for framebuffer resize callbacks.
Added in version 3.0.
Parameters
- window
- The window whose framebuffer was resized.
- width
- The new width, in pixels, of the framebuffer.
- height
- The new height, in pixels, of the framebuffer.
See also
- glfwSetFramebufferSizeCallback
- Sets the framebuffer resize callback for the specified window.
|
TGLFWmousebuttonfun = procedure(window: PGLFWwindow; button, action, mods: Integer); cdecl; |
The function signature for mouse button callbacks.
Added in version 1.0. GLFW3 added window handle and modifier mask parameters.
Parameters
- window
- The window that received the event.
- button
- The mouse button that was pressed or released.
- action
- One of
GLFW_PRESS or GLFW_RELEASE .
- mods
- Bit field describing which modifier keys were held down.
See also
- glfwSetMouseButtonCallback
- Sets the mouse button callback.
|
TGLFWcursorposfun = procedure(window: PGLFWwindow; xpos, ypos: Double); cdecl; |
The function signature for cursor position callbacks.
Added in version 3.0. Replaces TGLFWmouseposfun .
Parameters
- window
- The window that received the event.
- xpos
- The new cursor x-coordinate, relative to the left edge of the client area.
- ypos
- The new cursor y-coordinate, relative to the top edge of the client area.
See also
- glfwSetCursorPosCallback
- Sets the cursor position callback.
|
TGLFWcursorenterfun = procedure(window: PGLFWwindow; entered: Integer); cdecl; |
The function signature for cursor enter/leave callbacks.
Added in version 3.0.
Parameters
- window
- The window that received the event.
- entered
GLFW_TRUE if the cursor entered the window's client area, or GLFW_FALSE if it left it.
See also
- glfwSetCursorEnterCallback
- Sets the cursor enter/exit callback.
|
TGLFWscrollfun = procedure(window: PGLFWwindow; xoffset, yoffset: Double); cdecl; |
The function signature for scroll callbacks.
Added in version 3.0. Replaces TGLFWmousewheelfun .
Parameters
- window
- The window that received the event.
- xoffset
- The scroll offset along the x-axis.
- yoffset
- The scroll offset along the y-axis.
See also
- glfwSetScrollCallback
- Sets the scroll callback.
|
TGLFWkeyfun = procedure(window: PGLFWwindow; key, scancode, action, mods: Integer); cdecl; |
The function signature for keyboard key callbacks.
Added in version 1.0. GLFW3 added window handle, scancode and modifier mask parameters.
Parameters
- window
- The window that received the event.
- key
- The keyboard key that was pressed or released.
- scancode
- The system-specific scancode of the key.
- action
GLFW_PRESS , GLFW_RELEASE or GLFW_REPEAT .
- mods
- Bit field describing which modifier keys were held down.
See also
- glfwSetKeyCallback
- Sets the key callback.
|
TGLFWcharfun = procedure(window: PGLFWwindow; codepoint: Cardinal); cdecl; |
The function signature for Unicode character callbacks.
Added in version 2.4. GLFW3 added window handle parameter.
Parameters
- window
- The window that received the event.
- codepoint
- The Unicode code point of the character.
See also
- glfwSetCharCallback
- Sets the Unicode character callback.
|
TGLFWcharmodsfun = procedure(window: PGLFWwindow; codepoint: Cardinal; mods: Integer); cdecl; |
The function signature for Unicode character with modifiers callbacks. It is called for each input character, regardless of what modifier keys are held down.
Added in version 3.1.
Parameters
- window
- The window that received the event.
- codepoint
- The Unicode code point of the character.
- mods
- Bit field describing which modifier keys were held down.
See also
- glfwSetCharModsCallback
- Sets the Unicode character with modifiers callback.
|
TGLFWdropfun = procedure(window: PGLFWwindow; count: Integer; const paths: PPAnsiChar); cdecl; |
The function signature for file drop callbacks.
Added in version 3.1.
Parameters
- window
- The window that received the event.
- count
- The number of dropped files.
- paths
- The UTF-8 encoded file and/or directory path names.
See also
- glfwSetDropCallback
- Sets the file drop callback.
|
TGLFWmonitorfun = procedure(monitor: PGLFWmonitor; event: Integer); cdecl; |
The function signature for monitor configuration callbacks.
Added in version 3.0.
Parameters
- monitor
- The monitor that was connected or disconnected.
- event
- One of
GLFW_CONNECTED or GLFW_DISCONNECTED .
See also
- glfwSetMonitorCallback
- Sets the monitor configuration callback.
|
TGLFWjoystickfun = procedure(joy, event: Integer); cdecl; |
The function signature for joystick configuration callbacks.
Added in version 3.2.
Parameters
- joy
- The joystick that was connected or disconnected.
- event
- One of
GLFW_CONNECTED or GLFW_DISCONNECTED .
See also
- glfwSetJoystickCallback
- Sets the joystick configuration callback.
|
Constants
GLFW_VERSION_MAJOR = 3; |
The major version number of the GLFW library. This is incremented when the API is changed in non-compatible ways.
|
GLFW_VERSION_MINOR = 2; |
The minor version number of the GLFW library.
This is incremented when features are added to the API but it remains backward-compatible.
|
GLFW_VERSION_REVISION = 1; |
The revision number of the GLFW library.
This is incremented when a bug fix release is made that does not contain any API changes.
|
GLFW_TRUE = 1; |
One.
One. Seriously. You don't need to use this symbol in your code. It's just semantic sugar for the number 1. You can use 1 or GL_TRUE or whatever you want.
|
GLFW_FALSE = 0; |
Zero.
Zero. Seriously. You don't need to use this symbol in your code. It's just just semantic sugar for the number 0. You can use 0 or GL_FALSE or whatever you want.
|
GLFW_RELEASE = 0; |
The key or mouse button was released.
|
GLFW_PRESS = 1; |
The key or mouse button was pressed.
|
GLFW_REPEAT = 2; |
The key was held down until it repeated.
|
GLFW_KEY_UNKNOWN = -1; |
The unknown key
|
GLFW_KEY_SPACE = 32; |
Printable keys
|
GLFW_KEY_APOSTROPHE = 39; |
|
GLFW_KEY_LEFT_BRACKET = 91; |
|
GLFW_KEY_RIGHT_BRACKET = 93; |
|
GLFW_KEY_GRAVE_ACCENT = 96; |
|
GLFW_KEY_ESCAPE = 256; |
Function keys
|
GLFW_KEY_BACKSPACE = 259; |
|
GLFW_KEY_PAGE_DOWN = 267; |
|
GLFW_KEY_CAPS_LOCK = 280; |
|
GLFW_KEY_SCROLL_LOCK = 281; |
|
GLFW_KEY_PRINT_SCREEN = 283; |
|
GLFW_KEY_KP_DECIMAL = 330; |
|
GLFW_KEY_KP_DIVIDE = 331; |
|
GLFW_KEY_KP_MULTIPLY = 332; |
|
GLFW_KEY_KP_SUBTRACT = 333; |
|
GLFW_KEY_LEFT_SHIFT = 340; |
|
GLFW_KEY_LEFT_CONTROL = 341; |
|
GLFW_KEY_LEFT_SUPER = 343; |
|
GLFW_KEY_RIGHT_SHIFT = 344; |
|
GLFW_KEY_RIGHT_CONTROL = 345; |
|
GLFW_KEY_RIGHT_ALT = 346; |
|
GLFW_KEY_RIGHT_SUPER = 347; |
|
GLFW_MOD_SHIFT = $0001; |
If this bit is set one or more Shift keys were held down.
|
GLFW_MOD_CONTROL = $0002; |
If this bit is set one or more Control keys were held down.
|
GLFW_MOD_ALT = $0004; |
If this bit is set one or more Alt keys were held down.
|
GLFW_MOD_SUPER = $0008; |
If this bit is set one or more Super keys were held down.
|
GLFW_MOUSE_BUTTON_1 = 0; |
Mouse buttons
|
GLFW_JOYSTICK_1 = 0; |
Joysticks
|
GLFW_NOT_INITIALIZED = $00010001; |
GLFW has not been initialized.
This occurs if a GLFW function was called that must not be called unless the library is initialized.
Application programmer error. Initialize GLFW before calling any function that requires initialization.
|
GLFW_NO_CURRENT_CONTEXT = $00010002; |
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 glfwSwapInterval.
Application programmer error. Ensure a context is current before calling functions that require a current context.
|
GLFW_INVALID_ENUM = $00010003; |
One of the arguments to the function was an invalid enum value.
One of the arguments to the function was an invalid enum value, for example requesting GLFW_RED_BITS with glfwGetWindowAttrib.
Application programmer error. Fix the offending call.
|
GLFW_INVALID_VALUE = $00010004; |
One of the arguments to the function was an invalid value.
One of the arguments to the function was an invalid value, for example requesting a non-existent OpenGL or OpenGL ES version like 2.7.
Requesting a valid but unavailable OpenGL or OpenGL ES version will instead result in a GLFW_VERSION_UNAVAILABLE error.
Application programmer error. Fix the offending call.
|
GLFW_OUT_OF_MEMORY = $00010005; |
A memory allocation failed.
A bug in GLFW or the underlying operating system. Report the bug to our issue tracker (https://github.com/glfw/glfw/issues).
|
GLFW_API_UNAVAILABLE = $00010006; |
GLFW could not find support for the requested API on the system.
The installed graphics driver does not support the requested API, or does not support it via the chosen context creation 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. OS X 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.
|
GLFW_VERSION_UNAVAILABLE = $00010007; |
The requested OpenGL or OpenGL ES version is not available.
The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.
The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.
Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not GLFW_INVALID_VALUE, because GLFW cannot know what future versions will exist.
|
GLFW_PLATFORM_ERROR = $00010008; |
A platform-specific error occurred that does not match any of the more specific categories.
A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our issue tracker (https://github.com/glfw/glfw/issues).
|
GLFW_FORMAT_UNAVAILABLE = $00010009; |
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.
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.
|
GLFW_NO_WINDOW_CONTEXT = $0001000A; |
The specified window does not have an OpenGL or OpenGL ES context.
A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.
Application programmer error. Fix the offending call.
|
GLFW_FOCUSED = $00020001; |
|
GLFW_ICONIFIED = $00020002; |
|
GLFW_RESIZABLE = $00020003; |
|
GLFW_VISIBLE = $00020004; |
|
GLFW_DECORATED = $00020005; |
|
GLFW_AUTO_ICONIFY = $00020006; |
|
GLFW_FLOATING = $00020007; |
|
GLFW_MAXIMIZED = $00020008; |
|
GLFW_RED_BITS = $00021001; |
|
GLFW_GREEN_BITS = $00021002; |
|
GLFW_BLUE_BITS = $00021003; |
|
GLFW_ALPHA_BITS = $00021004; |
|
GLFW_DEPTH_BITS = $00021005; |
|
GLFW_STENCIL_BITS = $00021006; |
|
GLFW_ACCUM_RED_BITS = $00021007; |
|
GLFW_ACCUM_GREEN_BITS = $00021008; |
|
GLFW_ACCUM_BLUE_BITS = $00021009; |
|
GLFW_ACCUM_ALPHA_BITS = $0002100A; |
|
GLFW_AUX_BUFFERS = $0002100B; |
|
GLFW_SAMPLES = $0002100D; |
|
GLFW_SRGB_CAPABLE = $0002100E; |
|
GLFW_REFRESH_RATE = $0002100F; |
|
GLFW_DOUBLEBUFFER = $00021010; |
|
GLFW_CLIENT_API = $00022001; |
|
GLFW_CONTEXT_VERSION_MAJOR = $00022002; |
|
GLFW_CONTEXT_VERSION_MINOR = $00022003; |
|
GLFW_CONTEXT_REVISION = $00022004; |
|
GLFW_CONTEXT_ROBUSTNESS = $00022005; |
|
GLFW_OPENGL_FORWARD_COMPAT = $00022006; |
|
GLFW_OPENGL_DEBUG_CONTEXT = $00022007; |
|
GLFW_OPENGL_PROFILE = $00022008; |
|
GLFW_CONTEXT_RELEASE_BEHAVIOR = $00022009; |
|
GLFW_CONTEXT_NO_ERROR = $0002200A; |
|
GLFW_CONTEXT_CREATION_API = $0002200B; |
|
GLFW_OPENGL_API = $00030001; |
|
GLFW_OPENGL_ES_API = $00030002; |
|
GLFW_NO_RESET_NOTIFICATION = $00031001; |
|
GLFW_LOSE_CONTEXT_ON_RESET = $00031002; |
|
GLFW_OPENGL_ANY_PROFILE = 0; |
|
GLFW_OPENGL_CORE_PROFILE = $00032001; |
|
GLFW_OPENGL_COMPAT_PROFILE = $00032002; |
|
GLFW_STICKY_KEYS = $00033002; |
|
GLFW_STICKY_MOUSE_BUTTONS = $00033003; |
|
GLFW_CURSOR_NORMAL = $00034001; |
|
GLFW_CURSOR_HIDDEN = $00034002; |
|
GLFW_CURSOR_DISABLED = $00034003; |
|
GLFW_ANY_RELEASE_BEHAVIOR = 0; |
|
GLFW_RELEASE_BEHAVIOR_FLUSH = $00035001; |
|
GLFW_RELEASE_BEHAVIOR_NONE = $00035002; |
|
GLFW_NATIVE_CONTEXT_API = $00036001; |
|
GLFW_EGL_CONTEXT_API = $00036002; |
|
GLFW_ARROW_CURSOR = $00036001; |
The regular arrow cursor shape.
|
GLFW_IBEAM_CURSOR = $00036002; |
The text input I-beam cursor shape.
|
GLFW_CROSSHAIR_CURSOR = $00036003; |
The crosshair shape.
|
GLFW_HAND_CURSOR = $00036004; |
The hand shape.
|
GLFW_HRESIZE_CURSOR = $00036005; |
The horizontal resize arrow shape.
|
GLFW_VRESIZE_CURSOR = $00036006; |
The vertical resize arrow shape.
|
GLFW_CONNECTED = $00040001; |
|
GLFW_DISCONNECTED = $00040002; |
|
Generated by PasDocEx, based on PasDoc 0.14.0.
|