Typedefs | Functions
Window handling

Typedefs

typedef void(* GLFWframebuffersizefun )(GLFWwindow *, int, int)
 The function signature for framebuffer resize callbacks.
typedef struct GLFWwindow GLFWwindow
typedef void(* GLFWwindowclosefun )(GLFWwindow *)
 The function signature for window close callbacks.
typedef void(* GLFWwindowfocusfun )(GLFWwindow *, int)
 The function signature for window focus/defocus callbacks.
typedef void(* GLFWwindowiconifyfun )(GLFWwindow *, int)
 The function signature for window iconify/restore callbacks.
typedef void(* GLFWwindowposfun )(GLFWwindow *, int, int)
 The function signature for window position callbacks.
typedef void(* GLFWwindowrefreshfun )(GLFWwindow *)
 The function signature for window content refresh callbacks.
typedef void(* GLFWwindowsizefun )(GLFWwindow *, int, int)
 The function signature for window resize callbacks.

Functions

GLFWAPI GLFWwindowglfwCreateWindow (int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
 Creates a window and its associated context.
GLFWAPI void glfwDefaultWindowHints (void)
 Resets all window hints to their default values.
GLFWAPI void glfwDestroyWindow (GLFWwindow *window)
 Destroys the specified window and its context.
GLFWAPI void glfwGetFramebufferSize (GLFWwindow *window, int *width, int *height)
 Retrieves the size of the framebuffer of the specified window.
GLFWAPI int glfwGetWindowAttrib (GLFWwindow *window, int attrib)
 Returns an attribute of the specified window.
GLFWAPI void glfwGetWindowFrameSize (GLFWwindow *window, int *left, int *top, int *right, int *bottom)
 Retrieves the size of the frame of the window.
GLFWAPI GLFWmonitorglfwGetWindowMonitor (GLFWwindow *window)
 Returns the monitor that the window uses for full screen mode.
GLFWAPI void glfwGetWindowPos (GLFWwindow *window, int *xpos, int *ypos)
 Retrieves the position of the client area of the specified window.
GLFWAPI void glfwGetWindowSize (GLFWwindow *window, int *width, int *height)
 Retrieves the size of the client area of the specified window.
GLFWAPI voidglfwGetWindowUserPointer (GLFWwindow *window)
 Returns the user pointer of the specified window.
GLFWAPI void glfwHideWindow (GLFWwindow *window)
 Hides the specified window.
GLFWAPI void glfwIconifyWindow (GLFWwindow *window)
 Iconifies the specified window.
GLFWAPI void glfwPollEvents (void)
 Processes all pending events.
GLFWAPI void glfwPostEmptyEvent (void)
 Posts an empty event to the event queue.
GLFWAPI void glfwRestoreWindow (GLFWwindow *window)
 Restores the specified window.
GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback (GLFWwindow *window, GLFWframebuffersizefun cbfun)
 Sets the framebuffer resize callback for the specified window.
GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback (GLFWwindow *window, GLFWwindowclosefun cbfun)
 Sets the close callback for the specified window.
GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback (GLFWwindow *window, GLFWwindowfocusfun cbfun)
 Sets the focus callback for the specified window.
GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback (GLFWwindow *window, GLFWwindowiconifyfun cbfun)
 Sets the iconify callback for the specified window.
GLFWAPI void glfwSetWindowPos (GLFWwindow *window, int xpos, int ypos)
 Sets the position of the client area of the specified window.
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback (GLFWwindow *window, GLFWwindowposfun cbfun)
 Sets the position callback for the specified window.
GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback (GLFWwindow *window, GLFWwindowrefreshfun cbfun)
 Sets the refresh callback for the specified window.
GLFWAPI void glfwSetWindowShouldClose (GLFWwindow *window, int value)
 Sets the close flag of the specified window.
GLFWAPI void glfwSetWindowSize (GLFWwindow *window, int width, int height)
 Sets the size of the client area of the specified window.
GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback (GLFWwindow *window, GLFWwindowsizefun cbfun)
 Sets the size callback for the specified window.
GLFWAPI void glfwSetWindowTitle (GLFWwindow *window, const char *title)
 Sets the title of the specified window.
GLFWAPI void glfwSetWindowUserPointer (GLFWwindow *window, void *pointer)
 Sets the user pointer of the specified window.
GLFWAPI void glfwShowWindow (GLFWwindow *window)
 Makes the specified window visible.
GLFWAPI void glfwSwapBuffers (GLFWwindow *window)
 Swaps the front and back buffers of the specified window.
GLFWAPI void glfwWaitEvents (void)
 Waits until events are queued and processes them.
GLFWAPI void glfwWindowHint (int target, int hint)
 Sets the specified window hint to the desired value.
GLFWAPI int glfwWindowShouldClose (GLFWwindow *window)
 Checks the close flag of the specified window.

Detailed Description

This is the reference documentation for window related functions and types, including creation, deletion and event polling. For more information, see the Window handling.


Typedef Documentation

The function signature for framebuffer resize callbacks.

This is the function signature for framebuffer resize callback functions.

Parameters:
[in]windowThe window whose framebuffer was resized.
[in]widthThe new width, in pixels, of the framebuffer.
[in]heightThe new height, in pixels, of the framebuffer.
See also:
glfwSetFramebufferSizeCallback

Definition at line 841 of file glfw3.h.

typedef struct GLFWwindow GLFWwindow

Opaque window object.

Definition at line 722 of file glfw3.h.

The function signature for window close callbacks.

This is the function signature for window close callback functions.

Parameters:
[in]windowThe window that the user attempted to close.
See also:
glfwSetWindowCloseCallback

Definition at line 785 of file glfw3.h.

The function signature for window focus/defocus callbacks.

This is the function signature for window focus callback functions.

Parameters:
[in]windowThe window that gained or lost input focus.
[in]focused`GL_TRUE` if the window was given input focus, or `GL_FALSE` if it lost it.
See also:
glfwSetWindowFocusCallback

Definition at line 811 of file glfw3.h.

The function signature for window iconify/restore callbacks.

This is the function signature for window iconify/restore callback functions.

Parameters:
[in]windowThe window that was iconified or restored.
[in]iconified`GL_TRUE` if the window was iconified, or `GL_FALSE` if it was restored.
See also:
glfwSetWindowIconifyCallback

Definition at line 826 of file glfw3.h.

The function signature for window position callbacks.

This is the function signature for window position callback functions.

Parameters:
[in]windowThe window that was moved.
[in]xposThe new x-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
[in]yposThe new y-coordinate, in screen coordinates, of the upper-left corner of the client area of the window.
See also:
glfwSetWindowPosCallback

Definition at line 759 of file glfw3.h.

The function signature for window content refresh callbacks.

This is the function signature for window refresh callback functions.

Parameters:
[in]windowThe window whose content needs to be refreshed.
See also:
glfwSetWindowRefreshCallback

Definition at line 797 of file glfw3.h.

The function signature for window resize callbacks.

This is the function signature for window size callback functions.

Parameters:
[in]windowThe window that was resized.
[in]widthThe new width, in screen coordinates, of the window.
[in]heightThe new height, in screen coordinates, of the window.
See also:
glfwSetWindowSizeCallback

Definition at line 773 of file glfw3.h.


Function Documentation

GLFWAPI GLFWwindow* glfwCreateWindow ( int  width,
int  height,
const char *  title,
GLFWmonitor monitor,
GLFWwindow share 
)

Creates a window and its associated context.

This function creates a window and its associated OpenGL or OpenGL ES context. Most of the options controlling how the window and its context should be created are specified with [window hints](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](context_current). For information about the `share` parameter, see context_sharing.

The created window, framebuffer and context may differ from what you requested, as not all parameters and hints are [hard constraints](window_hints_hard). 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, windowed mode will be used. Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor. For more information on how to query connected monitors, see monitor_monitors.

For full screen windows, the specified size becomes the resolution of the window's _desired video mode_. As long as a full screen window has input focus, the supported video mode most closely matching the desired video mode is set for the specified monitor. For more information about full screen windows, including the creation of so called _windowed full screen_ or _borderless full screen_ windows, see window_windowed_full_screen.

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_hints_wnd) window hint, set its [position](window_pos) and then [show](window_hide) it.

If a full screen window has input focus, 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](window_size) after creation.

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

Parameters:
[in]widthThe desired width, in screen coordinates, of the window. This must be greater than zero.
[in]heightThe desired height, in screen coordinates, of the window. This must be greater than zero.
[in]titleThe initial, UTF-8 encoded window title.
[in]monitorThe monitor to use for full screen mode, or `NULL` to use windowed mode.
[in]shareThe window whose context to share resources with, or `NULL` to not share resources.
Returns:
The handle of the created window, or `NULL` if an [error](error_handling) occurred.
Remarks:
__Windows:__ Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.
__Windows:__ If the executable has an icon resource named `GLFW_ICON,` it will be set as the icon for the window. If no such icon is present, the `IDI_WINLOGO` icon will be used instead.
__Windows:__ The context to share resources with may not be current on any other thread.
__OS X:__ 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.
__OS X:__ 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. The menu bar can be disabled with a [compile-time option](compile_options_osx).
__OS X:__ 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. The GLFW test and example programs use a custom `Info.plist` template for this, which can be found as `CMake/MacOSXBundleInfo.plist.in` in the source tree.
__X11:__ There is no mechanism for setting the window icon yet.
__X11:__ Some window managers will not respect the placement of initially hidden windows.
__X11:__ Due to the asynchronous nature of X11, it may take a moment for a window to reach its requested state. This means you may not be able to query the final size, position or other attributes directly after window creation.
Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also:
window_creation
glfwDestroyWindow
Since:
Added in GLFW 3.0. Replaces `glfwOpenWindow`.

Definition at line 116 of file window.c.

Resets all window hints to their default values.

This function resets all window hints to their [default values](window_hints_values).

Thread Safety
This function may only be called from the main thread.
See also:
window_hints
glfwWindowHint
Since:
Added in GLFW 3.0.

Definition at line 235 of file window.c.

Destroys the specified window and its context.

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

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

Parameters:
[in]windowThe window to destroy.
Note:
The context of the specified window must not be current on any other thread when this function is called.
Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also:
window_creation
glfwCreateWindow
Since:
Added in GLFW 3.0. Replaces `glfwCloseWindow`.

Definition at line 369 of file window.c.

GLFWAPI void glfwGetFramebufferSize ( GLFWwindow window,
int width,
int height 
)

Retrieves the size of the framebuffer of the specified window.

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

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

Parameters:
[in]windowThe window whose framebuffer to query.
[out]widthWhere to store the width, in pixels, of the framebuffer, or `NULL`.
[out]heightWhere to store the height, in pixels, of the framebuffer, or `NULL`.
Thread Safety
This function may only be called from the main thread.
See also:
window_fbsize
glfwSetFramebufferSizeCallback
Since:
Added in GLFW 3.0.

Definition at line 484 of file window.c.

GLFWAPI int glfwGetWindowAttrib ( GLFWwindow window,
int  attrib 
)

Returns an attribute of the specified window.

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

Parameters:
[in]windowThe window to query.
[in]attribThe [window attribute](window_attribs) whose value to return.
Returns:
The value of the attribute, or zero if an [error](error_handling) occurred.
Remarks:
Framebuffer related hints are not window attributes. See window_attribs_fb for more information.
Zero is a valid value for many window and context related attributes so you cannot use a return value of zero as an indication of errors. However, this function should not fail as long as it is passed valid arguments and the library has been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_attribs
Since:
Added in GLFW 3.0. Replaces `glfwGetWindowParam` and `glfwGetGLVersion`.

Definition at line 554 of file window.c.

GLFWAPI void glfwGetWindowFrameSize ( GLFWwindow window,
int left,
int top,
int right,
int bottom 
)

Retrieves the size of the frame of the window.

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

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

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

Parameters:
[in]windowThe window whose frame size to query.
[out]leftWhere to store the size, in screen coordinates, of the left edge of the window frame, or `NULL`.
[out]topWhere to store the size, in screen coordinates, of the top edge of the window frame, or `NULL`.
[out]rightWhere to store the size, in screen coordinates, of the right edge of the window frame, or `NULL`.
[out]bottomWhere to store the size, in screen coordinates, of the bottom edge of the window frame, or `NULL`.
Thread Safety
This function may only be called from the main thread.
See also:
window_size
Since:
Added in GLFW 3.1.

Definition at line 497 of file window.c.

Returns the monitor that the window uses for full screen mode.

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

Parameters:
[in]windowThe window to query.
Returns:
The monitor, or `NULL` if the window is in windowed mode or an error occurred.
Thread Safety
This function may only be called from the main thread.
See also:
window_monitor
Since:
Added in GLFW 3.0.

Definition at line 598 of file window.c.

GLFWAPI void glfwGetWindowPos ( GLFWwindow window,
int xpos,
int ypos 
)

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

Parameters:
[in]windowThe window to query.
[out]xposWhere to store the x-coordinate of the upper-left corner of the client area, or `NULL`.
[out]yposWhere to store the y-coordinate of the upper-left corner of the client area, or `NULL`.
Thread Safety
This function may only be called from the main thread.
See also:
window_pos
glfwSetWindowPos
Since:
Added in GLFW 3.0.

Definition at line 427 of file window.c.

GLFWAPI void glfwGetWindowSize ( GLFWwindow window,
int width,
int height 
)

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 `NULL`. If an error occurs, all non-`NULL` size arguments will be set to zero.

Parameters:
[in]windowThe window whose size to retrieve.
[out]widthWhere to store the width, in screen coordinates, of the client area, or `NULL`.
[out]heightWhere to store the height, in screen coordinates, of the client area, or `NULL`.
Thread Safety
This function may only be called from the main thread.
See also:
window_size
glfwSetWindowSize
Since:
Added in GLFW 1.0.
__GLFW 3:__ Added window handle parameter.

Definition at line 456 of file window.c.

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

Parameters:
[in]windowThe window whose pointer to return.
Thread Safety
This function may be called from any thread. Access is not synchronized.
See also:
window_userptr
glfwSetWindowUserPointer
Since:
Added in GLFW 3.0.

Definition at line 612 of file window.c.

Hides the specified window.

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

Parameters:
[in]windowThe window to hide.
Thread Safety
This function may only be called from the main thread.
See also:
window_hide
glfwShowWindow
Since:
Added in GLFW 3.0.

Definition at line 542 of file window.c.

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.

Parameters:
[in]windowThe window to iconify.
Thread Safety
This function may only be called from the main thread.
See also:
window_iconify
glfwRestoreWindow
Since:
Added in GLFW 2.1.
__GLFW 3:__ Added window handle parameter.

Definition at line 516 of file window.c.

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](window_refresh) 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.

Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also:
events
glfwWaitEvents
Since:
Added in GLFW 1.0.

Definition at line 682 of file window.c.

Posts an empty event to the event queue.

This function posts an empty event from the current thread to the event queue, causing glfwWaitEvents 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.

Thread Safety
This function may be called from any thread.
See also:
events
glfwWaitEvents
Since:
Added in GLFW 3.1.

Definition at line 698 of file window.c.

Restores the specified window.

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

If the specified window is a full screen window, the resolution chosen for the window is restored on the selected monitor.

Parameters:
[in]windowThe window to restore.
Thread Safety
This function may only be called from the main thread.
See also:
window_iconify
glfwIconifyWindow
Since:
Added in GLFW 2.1.
__GLFW 3:__ Added window handle parameter.

Definition at line 523 of file window.c.

Sets the framebuffer resize callback for the specified window.

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

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_fbsize
Since:
Added in GLFW 3.0.

Definition at line 673 of file window.c.

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.

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Remarks:
__OS X:__ Selecting Quit from the application menu will trigger the close callback for all windows.
Thread Safety
This function may only be called from the main thread.
See also:
window_close
Since:
Added in GLFW 2.5.
__GLFW 3:__ Added window handle parameter. Updated callback signature.

Definition at line 637 of file window.c.

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.

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_focus
Since:
Added in GLFW 3.0.

Definition at line 655 of file window.c.

Sets the iconify callback for the specified window.

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

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_iconify
Since:
Added in GLFW 3.0.

Definition at line 664 of file window.c.

GLFWAPI void glfwSetWindowPos ( GLFWwindow window,
int  xpos,
int  ypos 
)

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.

Parameters:
[in]windowThe window to query.
[in]xposThe x-coordinate of the upper-left corner of the client area.
[in]yposThe y-coordinate of the upper-left corner of the client area.
Thread Safety
This function may only be called from the main thread.
See also:
window_pos
glfwGetWindowPos
Since:
Added in GLFW 1.0.
__GLFW 3:__ Added window handle parameter.

Definition at line 440 of file window.c.

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.

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_pos
Since:
Added in GLFW 3.0.

Definition at line 619 of file window.c.

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.

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_refresh
Since:
Added in GLFW 2.5.
__GLFW 3:__ Added window handle parameter. Updated callback signature.

Definition at line 646 of file window.c.

GLFWAPI void glfwSetWindowShouldClose ( GLFWwindow window,
int  value 
)

Sets the close flag of the specified window.

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

Parameters:
[in]windowThe window whose flag to change.
[in]valueThe new value.
Thread Safety
This function may be called from any thread. Access is not synchronized.
See also:
window_close
Since:
Added in GLFW 3.0.

Definition at line 413 of file window.c.

GLFWAPI void glfwSetWindowSize ( GLFWwindow window,
int  width,
int  height 
)

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 selects and switches to the resolution closest to the specified size, without affecting the window's context. As the context is unaffected, the bit depths of the framebuffer remain unchanged.

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

Parameters:
[in]windowThe window to resize.
[in]widthThe desired width of the specified window.
[in]heightThe desired height of the specified window.
Thread Safety
This function may only be called from the main thread.
See also:
window_size
glfwGetWindowSize
Since:
Added in GLFW 1.0.
__GLFW 3:__ Added window handle parameter.

Definition at line 469 of file window.c.

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.

Parameters:
[in]windowThe window whose callback to set.
[in]cbfunThe new callback, or `NULL` to remove the currently set callback.
Returns:
The previously set callback, or `NULL` if no callback was set or the library had not been [initialized](intro_init).
Thread Safety
This function may only be called from the main thread.
See also:
window_size
Since:
Added in GLFW 1.0.
__GLFW 3:__ Added window handle parameter. Updated callback signature.

Definition at line 628 of file window.c.

GLFWAPI void glfwSetWindowTitle ( GLFWwindow window,
const char *  title 
)

Sets the title of the specified window.

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

Parameters:
[in]windowThe window whose title to change.
[in]titleThe UTF-8 encoded window title.
Remarks:
__OS X:__ The window title will not be updated until the next time you process events.
Thread Safety
This function may only be called from the main thread.
See also:
window_title
Since:
Added in GLFW 1.0.
__GLFW 3:__ Added window handle parameter.

Definition at line 420 of file window.c.

GLFWAPI void glfwSetWindowUserPointer ( GLFWwindow window,
void pointer 
)

Sets the user pointer of the specified window.

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

Parameters:
[in]windowThe window whose pointer to set.
[in]pointerThe new value.
Thread Safety
This function may be called from any thread. Access is not synchronized.
See also:
window_userptr
glfwGetWindowUserPointer
Since:
Added in GLFW 3.0.

Definition at line 605 of file window.c.

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.

Parameters:
[in]windowThe window to make visible.
Thread Safety
This function may only be called from the main thread.
See also:
window_hide
glfwHideWindow
Since:
Added in GLFW 3.0.

Definition at line 530 of file window.c.

Swaps the front and back buffers of the specified window.

This function swaps the front and back buffers of the specified window. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.

Parameters:
[in]windowThe window whose buffers to swap.
Thread Safety
This function may be called from any thread.
See also:
buffer_swap
glfwSwapInterval
Since:
Added in GLFW 1.0.
__GLFW 3:__ Added window handle parameter.

Definition at line 544 of file context.c.

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](window_refresh) 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.

Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also:
events
glfwPollEvents
Since:
Added in GLFW 2.5.

Definition at line 688 of file window.c.

GLFWAPI void glfwWindowHint ( int  target,
int  hint 
)

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.

Parameters:
[in]targetThe [window hint](window_hints) to set.
[in]hintThe new value of the window hint.
Thread Safety
This function may only be called from the main thread.
See also:
window_hints
glfwDefaultWindowHints
Since:
Added in GLFW 3.0. Replaces `glfwOpenWindowHint`.

Definition at line 267 of file window.c.

Checks the close flag of the specified window.

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

Parameters:
[in]windowThe window to query.
Returns:
The value of the close flag.
Thread Safety
This function may be called from any thread. Access is not synchronized.
See also:
window_close
Since:
Added in GLFW 3.0.

Definition at line 406 of file window.c.



librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Tue Jun 25 2019 19:54:40