Functions
Platform interface

The interface implemented by the platform-specific code. More...

Functions

void _glfwPlatformApplyCursorMode (_GLFWwindow *window)
 Applies the cursor mode of the specified window to the system. More...
 
int _glfwPlatformCreateCursor (_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
 Creates a custom cursor. More...
 
int _glfwPlatformCreateStandardCursor (_GLFWcursor *cursor, int shape)
 Creates a cursor with a standard shape. More...
 
int _glfwPlatformCreateWindow (_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
 
void _glfwPlatformDestroyCursor (_GLFWcursor *cursor)
 Destroys a cursor. More...
 
void _glfwPlatformDestroyWindow (_GLFWwindow *window)
 
int _glfwPlatformExtensionSupported (const char *extension)
 Returns whether the specified extension is available. More...
 
const char * _glfwPlatformGetClipboardString (_GLFWwindow *window)
 Returns the contents of the clipboard as a string. More...
 
_GLFWwindow_glfwPlatformGetCurrentContext (void)
 Returns the window whose context is current on the calling thread. More...
 
void _glfwPlatformGetCursorPos (_GLFWwindow *window, double *xpos, double *ypos)
 Retrieves the position of the cursor relative to the client area of the window. More...
 
void _glfwPlatformGetFramebufferSize (_GLFWwindow *window, int *width, int *height)
 Retrieves the size of the framebuffer of the specified window. More...
 
void _glfwPlatformGetGammaRamp (_GLFWmonitor *monitor, GLFWgammaramp *ramp)
 Returns the current gamma ramp for the specified monitor. More...
 
const float * _glfwPlatformGetJoystickAxes (int joy, int *count)
 Returns the values of all axes of the specified joystick. More...
 
const unsigned char * _glfwPlatformGetJoystickButtons (int joy, int *count)
 Returns the state of all buttons of the specified joystick. More...
 
const char * _glfwPlatformGetJoystickName (int joy)
 Returns the name of the specified joystick. More...
 
void _glfwPlatformGetMonitorPos (_GLFWmonitor *monitor, int *xpos, int *ypos)
 Returns the position of the monitor's viewport on the virtual screen. More...
 
_GLFWmonitor ** _glfwPlatformGetMonitors (int *count)
 Returns the currently connected monitors. More...
 
GLFWglproc _glfwPlatformGetProcAddress (const char *procname)
 Returns the address of the specified function for the current context. More...
 
double _glfwPlatformGetTime (void)
 Returns the value of the GLFW timer. More...
 
const char * _glfwPlatformGetVersionString (void)
 Returns a string describing the compile-time configuration. More...
 
void _glfwPlatformGetVideoMode (_GLFWmonitor *monitor, GLFWvidmode *mode)
 
GLFWvidmode_glfwPlatformGetVideoModes (_GLFWmonitor *monitor, int *count)
 Returns the available video modes for the specified monitor. More...
 
void _glfwPlatformGetWindowFrameSize (_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
 Retrieves the size of the frame of the window. More...
 
void _glfwPlatformGetWindowPos (_GLFWwindow *window, int *xpos, int *ypos)
 Retrieves the position of the client area of the specified window. More...
 
void _glfwPlatformGetWindowSize (_GLFWwindow *window, int *width, int *height)
 Retrieves the size of the client area of the specified window. More...
 
void _glfwPlatformHideWindow (_GLFWwindow *window)
 Hides the specified window. More...
 
void _glfwPlatformIconifyWindow (_GLFWwindow *window)
 Iconifies the specified window. More...
 
int _glfwPlatformInit (void)
 Initializes the platform-specific part of the library. More...
 
GLboolean _glfwPlatformIsSameMonitor (_GLFWmonitor *first, _GLFWmonitor *second)
 Checks whether two monitor objects represent the same monitor. More...
 
int _glfwPlatformJoystickPresent (int joy)
 Returns whether the specified joystick is present. More...
 
void _glfwPlatformMakeContextCurrent (_GLFWwindow *window)
 Makes the context of the specified window current for the calling thread. More...
 
void _glfwPlatformPollEvents (void)
 Processes all pending events. More...
 
void _glfwPlatformPostEmptyEvent (void)
 Posts an empty event to the event queue. More...
 
void _glfwPlatformRestoreWindow (_GLFWwindow *window)
 Restores the specified window. More...
 
void _glfwPlatformSetClipboardString (_GLFWwindow *window, const char *string)
 Sets the clipboard to the specified string. More...
 
void _glfwPlatformSetCursor (_GLFWwindow *window, _GLFWcursor *cursor)
 Sets the cursor for the window. More...
 
void _glfwPlatformSetCursorPos (_GLFWwindow *window, double xpos, double ypos)
 Sets the position of the cursor, relative to the client area of the window. More...
 
void _glfwPlatformSetGammaRamp (_GLFWmonitor *monitor, const GLFWgammaramp *ramp)
 Sets the current gamma ramp for the specified monitor. More...
 
void _glfwPlatformSetTime (double time)
 Sets the GLFW timer. More...
 
void _glfwPlatformSetWindowPos (_GLFWwindow *window, int xpos, int ypos)
 Sets the position of the client area of the specified window. More...
 
void _glfwPlatformSetWindowSize (_GLFWwindow *window, int width, int height)
 Sets the size of the client area of the specified window. More...
 
void _glfwPlatformSetWindowTitle (_GLFWwindow *window, const char *title)
 Sets the title of the specified window. More...
 
void _glfwPlatformShowWindow (_GLFWwindow *window)
 Makes the specified window visible. More...
 
void _glfwPlatformSwapBuffers (_GLFWwindow *window)
 Swaps the front and back buffers of the specified window. More...
 
void _glfwPlatformSwapInterval (int interval)
 Sets the swap interval for the current context. More...
 
void _glfwPlatformTerminate (void)
 Terminates the platform-specific part of the library. More...
 
void _glfwPlatformUnhideWindow (_GLFWwindow *window)
 
void _glfwPlatformWaitEvents (void)
 Waits until events are queued and processes them. More...
 
int _glfwPlatformWindowFocused (_GLFWwindow *window)
 Returns whether the window is focused. More...
 
int _glfwPlatformWindowIconified (_GLFWwindow *window)
 Returns whether the window is iconified. More...
 
int _glfwPlatformWindowVisible (_GLFWwindow *window)
 Returns whether the window is visible. More...
 

Detailed Description

The interface implemented by the platform-specific code.

The platform API is the interface exposed by the platform-specific code for each platform and is called by the shared code of the public API It mirrors the public API except it uses objects instead of handles.

Function Documentation

void _glfwPlatformApplyCursorMode ( _GLFWwindow window)

Applies the cursor mode of the specified window to the system.

Parameters
[in]windowThe window whose cursor mode to apply.

Definition at line 1096 of file win32_window.c.

int _glfwPlatformCreateCursor ( _GLFWcursor cursor,
const GLFWimage image,
int  xhot,
int  yhot 
)

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.

Parameters
[in]imageThe desired cursor image.
[in]xhotThe desired x-coordinate, in pixels, of the cursor hotspot.
[in]yhotThe desired y-coordinate, in pixels, of the cursor hotspot.
Returns
The handle of the created cursor, or NULL if an error occurred.
Pointer Lifetime
The specified image data is copied before this function returns.
Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also
cursor_object
glfwDestroyCursor
glfwCreateStandardCursor
Since
Added in GLFW 3.1.

Definition at line 1112 of file win32_window.c.

int _glfwPlatformCreateStandardCursor ( _GLFWcursor cursor,
int  shape 
)

Creates a cursor with a standard shape.

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

Parameters
[in]shapeOne of the standard shapes.
Returns
A new cursor ready to use or NULL if an error occurred.
Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also
cursor_object
glfwCreateCursor
Since
Added in GLFW 3.1.

Definition at line 1177 of file win32_window.c.

int _glfwPlatformCreateWindow ( _GLFWwindow window,
const _GLFWwndconfig wndconfig,
const _GLFWctxconfig ctxconfig,
const _GLFWfbconfig fbconfig 
)

Definition at line 797 of file win32_window.c.

void _glfwPlatformDestroyCursor ( _GLFWcursor cursor)

Destroys a cursor.

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

Parameters
[in]cursorThe cursor object to destroy.
Reentrancy
This function may not be called from a callback.
Thread Safety
This function may only be called from the main thread.
See also
cursor_object
glfwCreateCursor
Since
Added in GLFW 3.1.

Definition at line 1191 of file win32_window.c.

void _glfwPlatformDestroyWindow ( _GLFWwindow window)

Definition at line 853 of file win32_window.c.

int _glfwPlatformExtensionSupported ( const char *  extension)

Returns whether the specified extension is available.

This function returns whether the specified client API extension is supported by the current OpenGL or OpenGL ES context. It searches both for OpenGL and OpenGL ES extension and platform-specific 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.

Parameters
[in]extensionThe ASCII encoded name of the extension.
Returns
GL_TRUE if the extension is available, or GL_FALSE otherwise.
Thread Safety
This function may be called from any thread.
See also
context_glext
glfwGetProcAddress
Since
Added in GLFW 1.0.

Definition at line 628 of file wgl_context.c.

const char* _glfwPlatformGetClipboardString ( _GLFWwindow window)

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

Parameters
[in]windowThe window that will request the clipboard contents.
Returns
The contents of the clipboard as a UTF-8 encoded string, or NULL if an error occurred.
Pointer Lifetime
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to glfwGetClipboardString or glfwSetClipboardString, or until the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
clipboard
glfwSetClipboardString
Since
Added in GLFW 3.0.
Note
The returned string must be valid until the next call to _glfwPlatformGetClipboardString or _glfwPlatformSetClipboardString.

Definition at line 1264 of file win32_window.c.

_GLFWwindow* _glfwPlatformGetCurrentContext ( void  )

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 NULL if no window's context is current.
Thread Safety
This function may be called from any thread.
See also
context_current
glfwMakeContextCurrent
Since
Added in GLFW 3.0.

Definition at line 65 of file win32_tls.c.

void _glfwPlatformGetCursorPos ( _GLFWwindow window,
double *  xpos,
double *  ypos 
)

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

Parameters
[in]windowThe desired window.
[out]xposWhere to store the cursor x-coordinate, relative to the left edge of the client area, or NULL.
[out]yposWhere to store the cursor y-coordinate, relative to the to top edge of the client area, or NULL.
Thread Safety
This function may only be called from the main thread.
See also
cursor_pos
glfwSetCursorPos
Since
Added in GLFW 3.0. Replaces glfwGetMousePos.

Definition at line 1069 of file win32_window.c.

void _glfwPlatformGetFramebufferSize ( _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 921 of file win32_window.c.

void _glfwPlatformGetGammaRamp ( _GLFWmonitor monitor,
GLFWgammaramp ramp 
)

Returns the current gamma ramp for the specified monitor.

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

Parameters
[in]monitorThe monitor to query.
Returns
The current gamma ramp, or NULL if an error occurred.
Pointer Lifetime
The returned structure and its arrays are allocated and freed by GLFW. You should not free them yourself. They are valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
monitor_gamma
Since
Added in GLFW 3.0.

Definition at line 302 of file win32_monitor.c.

const float* _glfwPlatformGetJoystickAxes ( int  joy,
int count 
)

Returns the values of all axes of the specified joystick.

This function returns the values of all axes of the specified joystick. Each element in the array is a value between -1.0 and 1.0.

Parameters
[in]joyThe joystick to query.
[out]countWhere to store the number of axis values in the returned array. This is set to zero if an error occurred.
Returns
An array of axis values, or NULL if the joystick is not present.
Pointer Lifetime
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
joystick_axis
Since
Added in GLFW 3.0. Replaces glfwGetJoystickPos.

Definition at line 84 of file winmm_joystick.c.

const unsigned char* _glfwPlatformGetJoystickButtons ( int  joy,
int count 
)

Returns the state of all buttons of the specified joystick.

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

Parameters
[in]joyThe joystick to query.
[out]countWhere to store the number of button states in the returned array. This is set to zero if an error occurred.
Returns
An array of button states, or NULL if the joystick is not present.
Pointer Lifetime
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
joystick_button
Since
Added in GLFW 2.2.
GLFW 3: Changed to return a dynamic array.

Definition at line 117 of file winmm_joystick.c.

const char* _glfwPlatformGetJoystickName ( int  joy)

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.

Parameters
[in]joyThe joystick to query.
Returns
The UTF-8 encoded name of the joystick, or NULL if the joystick is not present.
Pointer Lifetime
The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this function is called again for that joystick or the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
joystick_name
Since
Added in GLFW 3.0.

Definition at line 165 of file winmm_joystick.c.

void _glfwPlatformGetMonitorPos ( _GLFWmonitor monitor,
int xpos,
int ypos 
)

Returns the position of the monitor's viewport on the virtual screen.

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

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

Parameters
[in]monitorThe monitor to query.
[out]xposWhere to store the monitor x-coordinate, or NULL.
[out]yposWhere to store the monitor y-coordinate, or NULL.
Thread Safety
This function may only be called from the main thread.
See also
monitor_properties
Since
Added in GLFW 3.0.

Definition at line 194 of file win32_monitor.c.

_GLFWmonitor** _glfwPlatformGetMonitors ( int count)

Returns the currently connected monitors.

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

Parameters
[out]countWhere 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 NULL if no monitors were found or if an error occurred.
Pointer Lifetime
The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
monitor_monitors
monitor_event
glfwGetPrimaryMonitor
Since
Added in GLFW 3.0.

Definition at line 104 of file win32_monitor.c.

GLFWglproc _glfwPlatformGetProcAddress ( const char *  procname)

Returns the address of the specified function for the current context.

This function returns the address of the specified 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.

Parameters
[in]procnameThe ASCII encoded name of the function.
Returns
The address of the function, or NULL if an [error](error_handling) occurred.
Remarks
The address of a given function is not guaranteed to be the same between contexts.
This function may return a non-NULL address despite the associated version or extension not being available. Always check the context version or extension string first.
Pointer Lifetime
The returned function pointer is valid until the context is destroyed or the library is terminated.
Thread Safety
This function may be called from any thread.
See also
context_glext
glfwExtensionSupported
Since
Added in GLFW 1.0.

Definition at line 657 of file wgl_context.c.

double _glfwPlatformGetTime ( void  )

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.
Thread Safety
This function may be called from any thread. Access is not synchronized.
See also
time
Since
Added in GLFW 1.0.

Definition at line 75 of file win32_time.c.

const char* _glfwPlatformGetVersionString ( void  )

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.

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

This function always succeeds.

Returns
The GLFW version string.
Remarks
This function may be called before glfwInit.
Pointer Lifetime
The returned string is static and compile-time generated.
Thread Safety
This function may be called from any thread.
See also
intro_version
glfwGetVersion
Since
Added in GLFW 3.0.
Note
The returned string must be available for the duration of the program.
The returned string must not change for the duration of the program.

Definition at line 370 of file win32_init.c.

void _glfwPlatformGetVideoMode ( _GLFWmonitor monitor,
GLFWvidmode mode 
)

Definition at line 284 of file win32_monitor.c.

GLFWvidmode* _glfwPlatformGetVideoModes ( _GLFWmonitor monitor,
int count 
)

Returns the available video modes for the specified monitor.

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

Parameters
[in]monitorThe monitor to query.
[out]countWhere 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 NULL if an error occurred.
Pointer Lifetime
The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.
Thread Safety
This function may only be called from the main thread.
See also
monitor_modes
glfwGetVideoMode
Since
Added in GLFW 1.0.
GLFW 3: Changed to return an array of modes for a specific monitor.

Definition at line 211 of file win32_monitor.c.

void _glfwPlatformGetWindowFrameSize ( _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 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 926 of file win32_window.c.

void _glfwPlatformGetWindowPos ( _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 875 of file win32_window.c.

void _glfwPlatformGetWindowSize ( _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 895 of file win32_window.c.

void _glfwPlatformHideWindow ( _GLFWwindow window)

Hides the specified window.

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

Parameters
[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 971 of file win32_window.c.

void _glfwPlatformIconifyWindow ( _GLFWwindow window)

Iconifies the specified window.

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

If the specified window is a full screen window, 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 948 of file win32_window.c.

int _glfwPlatformInit ( void  )

Initializes the platform-specific part of the library.

Returns
GL_TRUE if successful, or GL_FALSE if an error occurred.

Definition at line 324 of file win32_init.c.

GLboolean _glfwPlatformIsSameMonitor ( _GLFWmonitor first,
_GLFWmonitor second 
)

Checks whether two monitor objects represent the same monitor.

Parameters
[in]firstThe first monitor.
[in]secondThe second monitor.
Returns
GL_TRUE if the monitor objects represent the same monitor, or GL_FALSE otherwise.

Definition at line 189 of file win32_monitor.c.

int _glfwPlatformJoystickPresent ( int  joy)

Returns whether the specified joystick is present.

This function returns whether the specified joystick is present.

Parameters
[in]joyThe joystick to query.
Returns
GL_TRUE if the joystick is present, or GL_FALSE otherwise.
Thread Safety
This function may only be called from the main thread.
See also
joystick
Since
Added in GLFW 3.0. Replaces glfwGetJoystickParam.

Definition at line 74 of file winmm_joystick.c.

void _glfwPlatformMakeContextCurrent ( _GLFWwindow window)

Makes the context of the specified window current for the calling thread.

This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. A context 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.

Parameters
[in]windowThe window whose context to make current, or NULL to detach the current context.
Thread Safety
This function may be called from any thread.
See also
context_current
glfwGetCurrentContext
Since
Added in GLFW 3.0.

Definition at line 590 of file wgl_context.c.

void _glfwPlatformPollEvents ( void  )

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.

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 991 of file win32_window.c.

void _glfwPlatformPostEmptyEvent ( void  )

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 1063 of file win32_window.c.

void _glfwPlatformRestoreWindow ( _GLFWwindow window)

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 953 of file win32_window.c.

void _glfwPlatformSetClipboardString ( _GLFWwindow window,
const char *  string 
)

Sets the clipboard to the specified string.

This function sets the system clipboard to the specified, UTF-8 encoded string.

Parameters
[in]windowThe window that will own the clipboard contents.
[in]stringA UTF-8 encoded string.
Pointer Lifetime
The specified string is copied before this function returns.
Thread Safety
This function may only be called from the main thread.
See also
clipboard
glfwGetClipboardString
Since
Added in GLFW 3.0.

Definition at line 1219 of file win32_window.c.

void _glfwPlatformSetCursor ( _GLFWwindow window,
_GLFWcursor cursor 
)

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.

Parameters
[in]windowThe window to set the cursor for.
[in]cursorThe cursor to set, or NULL to switch back to the default arrow cursor.
Thread Safety
This function may only be called from the main thread.
See also
cursor_object
Since
Added in GLFW 3.1.

Definition at line 1197 of file win32_window.c.

void _glfwPlatformSetCursorPos ( _GLFWwindow window,
double  xpos,
double  ypos 
)

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.

Parameters
[in]windowThe desired window.
[in]xposThe desired x-coordinate, relative to the left edge of the client area.
[in]yposThe desired y-coordinate, relative to the top edge of the client area.
Remarks
X11: Due to the asynchronous nature of X11, it may take a moment for the window focus event to arrive. This means you may not be able to set the cursor position directly after window creation.
Thread Safety
This function may only be called from the main thread.
See also
cursor_pos
glfwGetCursorPos
Since
Added in GLFW 3.0. Replaces glfwSetMousePos.

Definition at line 1084 of file win32_window.c.

void _glfwPlatformSetGammaRamp ( _GLFWmonitor monitor,
const GLFWgammaramp ramp 
)

Sets the current gamma ramp for the specified monitor.

This function sets the current gamma ramp for the specified monitor. The original gamma ramp for that monitor is saved by GLFW the first time this function is called and is restored by glfwTerminate.

Parameters
[in]monitorThe monitor whose gamma ramp to set.
[in]rampThe gamma ramp to use.
Remarks
Gamma ramp sizes other than 256 are not supported by all platforms or graphics hardware.
Windows: The gamma ramp size must be 256.
Pointer Lifetime
The specified gamma ramp is copied before this function returns.
Thread Safety
This function may only be called from the main thread.
See also
monitor_gamma
Since
Added in GLFW 3.0.

Definition at line 318 of file win32_monitor.c.

void _glfwPlatformSetTime ( double  time)

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.

Parameters
[in]timeThe new value, in seconds.
Remarks
The upper limit of the timer is calculated as floor((264 - 1) / 109) and is due to implementations storing nanoseconds in 64 bits. The limit may be increased in the future.
Thread Safety
This function may only be called from the main thread.
See also
time
Since
Added in GLFW 2.2.

Definition at line 81 of file win32_time.c.

void _glfwPlatformSetWindowPos ( _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 886 of file win32_window.c.

void _glfwPlatformSetWindowSize ( _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 906 of file win32_window.c.

void _glfwPlatformSetWindowTitle ( _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 861 of file win32_window.c.

void _glfwPlatformShowWindow ( _GLFWwindow window)

Makes the specified window visible.

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

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 958 of file win32_window.c.

void _glfwPlatformSwapBuffers ( _GLFWwindow window)

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 600 of file wgl_context.c.

void _glfwPlatformSwapInterval ( int  interval)

Sets the swap interval for the current context.

This function sets the swap interval for the current 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.

Parameters
[in]intervalThe minimum number of screen updates to wait for until the buffers are swapped by glfwSwapBuffers.
Remarks
This function is not called during context creation, leaving the swap interval set to whatever is the default on that platform. This is done because some swap interval extensions used by GLFW do not allow the swap interval to be reset to zero once it has been set to a non-zero value.
Some GPU drivers do not honor the requested swap interval, either because of a user setting that overrides the application's request or due to bugs in the driver.
Thread Safety
This function may be called from any thread.
See also
buffer_swap
glfwSwapBuffers
Since
Added in GLFW 1.0.

Definition at line 613 of file wgl_context.c.

void _glfwPlatformTerminate ( void  )

Terminates the platform-specific part of the library.

Definition at line 354 of file win32_init.c.

void _glfwPlatformUnhideWindow ( _GLFWwindow window)

Definition at line 966 of file win32_window.c.

void _glfwPlatformWaitEvents ( void  )

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.

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 1056 of file win32_window.c.

int _glfwPlatformWindowFocused ( _GLFWwindow window)

Returns whether the window is focused.

Definition at line 976 of file win32_window.c.

int _glfwPlatformWindowIconified ( _GLFWwindow window)

Returns whether the window is iconified.

Definition at line 981 of file win32_window.c.

int _glfwPlatformWindowVisible ( _GLFWwindow window)

Returns whether the window is visible.

Definition at line 986 of file win32_window.c.



librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Fri Mar 13 2020 03:16:19