diff options
author | Dmitri Shuralyov <shurcooL@gmail.com> | 2015-01-18 13:25:56 -0800 |
---|---|---|
committer | Dmitri Shuralyov <shurcooL@gmail.com> | 2015-02-21 18:51:42 -0800 |
commit | 9faad1febdcc20ff53e4821e759ceea3abeacd94 (patch) | |
tree | 61eccc628f22f931d79815d187c722f46190c009 | |
parent | c7ee9b057895fe44bf232e4177d46de36a9c22bd (diff) | |
download | glfw-9faad1febdcc20ff53e4821e759ceea3abeacd94.tar.gz |
Update to official GLFW 3.1 release.
See glfw/glfw@4188c263e31ec3d5da99a77d939ab56bc199fda6.
-rw-r--r-- | GLFW_C_REVISION.txt | 2 | ||||
-rw-r--r-- | glfw/include/GLFW/glfw3.h | 652 | ||||
-rw-r--r-- | glfw/include/GLFW/glfw3native.h | 10 | ||||
-rw-r--r-- | glfw/src/CMakeLists.txt | 17 | ||||
-rw-r--r-- | glfw/src/cocoa_monitor.m | 2 | ||||
-rw-r--r-- | glfw/src/cocoa_window.m | 7 | ||||
-rw-r--r-- | glfw/src/context.c | 35 | ||||
-rw-r--r-- | glfw/src/glfw3Config.cmake.in | 15 | ||||
-rw-r--r-- | glfw/src/glfwConfig.cmake.in | 10 | ||||
-rw-r--r-- | glfw/src/glfwConfigVersion.cmake.in | 12 | ||||
-rw-r--r-- | glfw/src/internal.h | 4 | ||||
-rw-r--r-- | glfw/src/linux_joystick.c | 135 | ||||
-rw-r--r-- | glfw/src/linux_joystick.h | 31 | ||||
-rw-r--r-- | glfw/src/mir_init.c | 11 | ||||
-rw-r--r-- | glfw/src/mir_monitor.c | 4 | ||||
-rw-r--r-- | glfw/src/mir_platform.h | 2 | ||||
-rw-r--r-- | glfw/src/mir_window.c | 60 | ||||
-rw-r--r-- | glfw/src/monitor.c | 18 | ||||
-rw-r--r-- | glfw/src/nsgl_context.m | 4 | ||||
-rw-r--r-- | glfw/src/win32_init.c | 2 | ||||
-rw-r--r-- | glfw/src/win32_platform.h | 1 | ||||
-rw-r--r-- | glfw/src/win32_window.c | 26 | ||||
-rw-r--r-- | glfw/src/window.c | 2 | ||||
-rw-r--r-- | glfw/src/wl_window.c | 8 | ||||
-rw-r--r-- | glfw/src/x11_init.c | 4 | ||||
-rw-r--r-- | glfw/src/x11_monitor.c | 15 | ||||
-rw-r--r-- | glfw/src/x11_platform.h | 9 | ||||
-rw-r--r-- | glfw/src/x11_window.c | 14 |
28 files changed, 534 insertions, 578 deletions
diff --git a/GLFW_C_REVISION.txt b/GLFW_C_REVISION.txt index 86de99c..448f613 100644 --- a/GLFW_C_REVISION.txt +++ b/GLFW_C_REVISION.txt @@ -1 +1 @@ -59afffb3733f3f6f439c61be552ec1b3852692c4 +4188c263e31ec3d5da99a77d939ab56bc199fda6 diff --git a/glfw/include/GLFW/glfw3.h b/glfw/include/GLFW/glfw3.h index ef0280f..8941449 100644 --- a/glfw/include/GLFW/glfw3.h +++ b/glfw/include/GLFW/glfw3.h @@ -144,52 +144,52 @@ extern "C" { /* Include the chosen client API headers. */ #if defined(__APPLE_CC__) - #if defined(GLFW_INCLUDE_GLCOREARB) - #include <OpenGL/gl3.h> - #if defined(GLFW_INCLUDE_GLEXT) - #include <OpenGL/gl3ext.h> - #endif - #elif !defined(GLFW_INCLUDE_NONE) - #if !defined(GLFW_INCLUDE_GLEXT) - #define GL_GLEXT_LEGACY - #endif - #include <OpenGL/gl.h> + #if defined(GLFW_INCLUDE_GLCOREARB) + #include <OpenGL/gl3.h> + #if defined(GLFW_INCLUDE_GLEXT) + #include <OpenGL/gl3ext.h> #endif - #if defined(GLFW_INCLUDE_GLU) - #include <OpenGL/glu.h> + #elif !defined(GLFW_INCLUDE_NONE) + #if !defined(GLFW_INCLUDE_GLEXT) + #define GL_GLEXT_LEGACY #endif + #include <OpenGL/gl.h> + #endif + #if defined(GLFW_INCLUDE_GLU) + #include <OpenGL/glu.h> + #endif #else - #if defined(GLFW_INCLUDE_GLCOREARB) - #include <GL/glcorearb.h> - #elif defined(GLFW_INCLUDE_ES1) - #include <GLES/gl.h> - #if defined(GLFW_INCLUDE_GLEXT) - #include <GLES/glext.h> - #endif - #elif defined(GLFW_INCLUDE_ES2) - #include <GLES2/gl2.h> - #if defined(GLFW_INCLUDE_GLEXT) - #include <GLES2/gl2ext.h> - #endif - #elif defined(GLFW_INCLUDE_ES3) - #include <GLES3/gl3.h> - #if defined(GLFW_INCLUDE_GLEXT) - #include <GLES3/gl2ext.h> - #endif - #elif defined(GLFW_INCLUDE_ES31) - #include <GLES3/gl31.h> - #if defined(GLFW_INCLUDE_GLEXT) - #include <GLES3/gl2ext.h> - #endif - #elif !defined(GLFW_INCLUDE_NONE) - #include <GL/gl.h> - #if defined(GLFW_INCLUDE_GLEXT) - #include <GL/glext.h> - #endif + #if defined(GLFW_INCLUDE_GLCOREARB) + #include <GL/glcorearb.h> + #elif defined(GLFW_INCLUDE_ES1) + #include <GLES/gl.h> + #if defined(GLFW_INCLUDE_GLEXT) + #include <GLES/glext.h> + #endif + #elif defined(GLFW_INCLUDE_ES2) + #include <GLES2/gl2.h> + #if defined(GLFW_INCLUDE_GLEXT) + #include <GLES2/gl2ext.h> + #endif + #elif defined(GLFW_INCLUDE_ES3) + #include <GLES3/gl3.h> + #if defined(GLFW_INCLUDE_GLEXT) + #include <GLES3/gl2ext.h> + #endif + #elif defined(GLFW_INCLUDE_ES31) + #include <GLES3/gl31.h> + #if defined(GLFW_INCLUDE_GLEXT) + #include <GLES3/gl2ext.h> #endif - #if defined(GLFW_INCLUDE_GLU) - #include <GL/glu.h> + #elif !defined(GLFW_INCLUDE_NONE) + #include <GL/gl.h> + #if defined(GLFW_INCLUDE_GLEXT) + #include <GL/glext.h> #endif + #endif + #if defined(GLFW_INCLUDE_GLU) + #include <GL/glu.h> + #endif #endif #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) @@ -200,30 +200,25 @@ extern "C" { #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined" #endif +/* GLFWAPI is used to declare public API functions for export + * from the DLL / shared library / dynamic library. + */ #if defined(_WIN32) && defined(_GLFW_BUILD_DLL) - /* We are building GLFW as a Win32 DLL */ #define GLFWAPI __declspec(dllexport) - #elif defined(_WIN32) && defined(GLFW_DLL) - /* We are calling GLFW as a Win32 DLL */ #if defined(__LCC__) #define GLFWAPI extern #else #define GLFWAPI __declspec(dllimport) #endif - #elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) - /* We are building GLFW as a shared / dynamic library */ #define GLFWAPI __attribute__((visibility("default"))) - #else - /* We are building or calling GLFW as a static library */ #define GLFWAPI - #endif /* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ @@ -284,20 +279,22 @@ extern "C" { /*! @defgroup keys Keyboard keys * - * These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60), - * but re-arranged to map to 7-bit ASCII for printable keys (function keys are - * put in the 256+ range). - * - * The naming of the key codes follow these rules: - * - The US keyboard layout is used - * - Names of printable alpha-numeric characters are used (e.g. "A", "R", - * "3", etc.) - * - For non-alphanumeric characters, Unicode:ish names are used (e.g. - * "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not - * correspond to the Unicode standard (usually for brevity) - * - Keys that lack a clear US mapping are named "WORLD_x" - * - For non-printable keys, custom names are used (e.g. "F4", - * "BACKSPACE", etc.) + * See [key input](@ref input_key) for how these are used. + * + * These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60), + * but re-arranged to map to 7-bit ASCII for printable keys (function keys are + * put in the 256+ range). + * + * The naming of the key codes follow these rules: + * - The US keyboard layout is used + * - Names of printable alpha-numeric characters are used (e.g. "A", "R", + * "3", etc.) + * - For non-alphanumeric characters, Unicode:ish names are used (e.g. + * "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not + * correspond to the Unicode standard (usually for brevity) + * - Keys that lack a clear US mapping are named "WORLD_x" + * - For non-printable keys, custom names are used (e.g. "F4", + * "BACKSPACE", etc.) * * @ingroup input * @{ @@ -434,6 +431,9 @@ extern "C" { /*! @} */ /*! @defgroup mods Modifier key flags + * + * See [key input](@ref input_key) for how these are used. + * * @ingroup input * @{ */ @@ -453,6 +453,9 @@ extern "C" { /*! @} */ /*! @defgroup buttons Mouse buttons + * + * See [mouse button input](@ref input_mouse_button) for how these are used. + * * @ingroup input * @{ */ #define GLFW_MOUSE_BUTTON_1 0 @@ -470,6 +473,9 @@ extern "C" { /*! @} */ /*! @defgroup joysticks Joysticks + * + * See [joystick input](@ref joystick) for how these are used. + * * @ingroup input * @{ */ #define GLFW_JOYSTICK_1 0 @@ -492,6 +498,9 @@ extern "C" { /*! @} */ /*! @defgroup errors Error codes + * + * See [error handling](@ref error_handling) for how these are used. + * * @ingroup init * @{ */ /*! @brief GLFW has not been initialized. @@ -518,7 +527,8 @@ extern "C" { /*! @brief 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 @ref glfwGetWindowAttrib. + * requesting [GLFW_RED_BITS](@ref window_hints_fb) with @ref + * glfwGetWindowAttrib. * * @par Analysis * Application programmer error. Fix the offending call. @@ -557,9 +567,9 @@ extern "C" { * * @par * Some pre-installed Windows graphics drivers do not support OpenGL. AMD only - * supports OpenGL ES via EGL, while nVidia and Intel only supports it via + * supports OpenGL ES via EGL, while Nvidia and Intel only supports 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 + * EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary * driver. */ #define GLFW_API_UNAVAILABLE 0x00010006 @@ -673,6 +683,9 @@ extern "C" { #define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 /*! @defgroup shapes Standard cursor shapes + * + * See [standard cursor creation](@ref cursor_standard) for how these are used. + * * @ingroup input * @{ */ @@ -822,9 +835,9 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); * * This is the function signature for window focus callback functions. * - * @param[in] window The window that was focused or defocused. - * @param[in] focused `GL_TRUE` if the window was focused, or `GL_FALSE` if - * it was defocused. + * @param[in] window The window that gained or lost input focus. + * @param[in] focused `GL_TRUE` if the window was given input focus, or + * `GL_FALSE` if it lost it. * * @sa glfwSetWindowFocusCallback * @@ -1101,11 +1114,7 @@ typedef struct GLFWimage * @sa @ref intro_init * @sa glfwTerminate * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ This function no longer registers @ref glfwTerminate with `atexit`. + * @since Added in GLFW 1.0. * * @ingroup init */ @@ -1128,14 +1137,16 @@ GLFWAPI int glfwInit(void); * @warning No window's context may be current on another thread when this * function is called. * + * @par Reentrancy + * This function may not be called from a callback. + * * @par Thread Safety * This function may only be called from the main thread. * * @sa @ref intro_init * @sa glfwInit * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @ingroup init */ @@ -1162,8 +1173,7 @@ GLFWAPI void glfwTerminate(void); * @sa @ref intro_version * @sa glfwGetVersionString * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @ingroup init */ @@ -1176,6 +1186,10 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); * 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 + * @ref glfwGetVersion function already provides the version of the running + * library binary. + * * This function always succeeds. * * @return The GLFW version string. @@ -1191,8 +1205,7 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); * @sa @ref intro_version * @sa glfwGetVersion * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup init */ @@ -1211,6 +1224,9 @@ GLFWAPI const char* glfwGetVersionString(void); * 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. + * * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set. @@ -1222,8 +1238,7 @@ GLFWAPI const char* glfwGetVersionString(void); * * @sa @ref error_handling * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup init */ @@ -1251,8 +1266,7 @@ GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); * @sa @ref monitor_event * @sa glfwGetPrimaryMonitor * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1272,8 +1286,7 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); * @sa @ref monitor_monitors * @sa glfwGetMonitors * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1296,8 +1309,7 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); * * @sa @ref monitor_properties * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1308,30 +1320,33 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); * 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 `NULL`. If an error occurs, all * non-`NULL` size arguments will be set to zero. * * @param[in] monitor The monitor to query. - * @param[out] width Where to store the width, in mm, of the monitor's display - * area, or `NULL`. - * @param[out] height Where to store the height, in mm, of the monitor's - * display area, or `NULL`. + * @param[out] widthMM Where to store the width, in millimetres, of the + * monitor's display area, or `NULL`. + * @param[out] heightMM Where to store the height, in millimetres, of the + * monitor's display area, or `NULL`. * - * @note Some systems do not provide accurate monitor size information, either - * because the EDID data is incorrect, or because the driver does not report it - * accurately. + * @remarks __Windows:__ The OS calculates the returned physical size from the + * current resolution and system DPI instead of querying the monitor EDID data. * * @par Thread Safety * This function may only be called from the main thread. * * @sa @ref monitor_properties * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ -GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* height); +GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM); /*! @brief Returns the name of the specified monitor. * @@ -1353,8 +1368,7 @@ GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* h * * @sa @ref monitor_properties * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1379,8 +1393,7 @@ GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor); * * @sa @ref monitor_event * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1410,12 +1423,10 @@ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); * @sa @ref monitor_modes * @sa glfwGetVideoMode * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par - * __GLFW 3:__ Changed to return a dynamic array of video modes for a specific - * monitor. + * __GLFW 3:__ Changed to return an array of modes for a specific monitor. * * @ingroup monitor */ @@ -1442,8 +1453,7 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); * @sa @ref monitor_modes * @sa glfwGetVideoModes * - * @par History - * Added in GLFW 3.0. Replaced `glfwGetDesktopMode`. + * @since Added in GLFW 3.0. Replaces `glfwGetDesktopMode`. * * @ingroup monitor */ @@ -1462,8 +1472,7 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); * * @sa @ref monitor_gamma * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1488,8 +1497,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); * * @sa @ref monitor_gamma * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1514,8 +1522,7 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); * * @sa @ref monitor_gamma * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup monitor */ @@ -1532,8 +1539,7 @@ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); * @sa @ref window_hints * @sa glfwWindowHint * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -1555,12 +1561,7 @@ GLFWAPI void glfwDefaultWindowHints(void); * @sa @ref window_hints * @sa glfwDefaultWindowHints * - * @par History - * Added in GLFW 2.2. - * - * @par - * __GLFW 3:__ Renamed from `glfwOpenWindowHint`. Hints are no longer reset to - * default values on window creation. + * @since Added in GLFW 3.0. Replaces `glfwOpenWindowHint`. * * @ingroup window */ @@ -1595,21 +1596,22 @@ GLFWAPI void glfwWindowHint(int target, int hint); * 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 @ref window_full_screen. + * _borderless full screen_ windows, see @ref 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 hint, set its - * [position](@ref window_pos) and then [show](@ref window_hide) it. + * initially invisible using the [GLFW_VISIBLE](@ref window_hints_wnd) window + * hint, set its [position](@ref window_pos) and then [show](@ref window_hide) + * it. * - * If a full screen window is focused, the screensaver is prohibited from + * 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](@ref window_size) after creation. * - * The [swap interval](@ref window_swap) is not set during window creation and + * The [swap interval](@ref buffer_swap) is not set during window creation and * the initial value may vary depending on driver settings and defaults. * * @param[in] width The desired width, in screen coordinates, of the window. @@ -1660,11 +1662,7 @@ GLFWAPI void glfwWindowHint(int target, int hint); * @sa @ref window_creation * @sa glfwDestroyWindow * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwOpenWindow`. Complete signature overhaul. + * @since Added in GLFW 3.0. Replaces `glfwOpenWindow`. * * @ingroup window */ @@ -1692,11 +1690,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, G * @sa @ref window_creation * @sa glfwCreateWindow * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwCloseWindow`. Added window handle parameter. + * @since Added in GLFW 3.0. Replaces `glfwCloseWindow`. * * @ingroup window */ @@ -1714,8 +1708,7 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow* window); * * @sa @ref window_close * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -1735,8 +1728,7 @@ GLFWAPI int glfwWindowShouldClose(GLFWwindow* window); * * @sa @ref window_close * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -1755,8 +1747,7 @@ GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value); * * @sa @ref window_title * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. @@ -1785,8 +1776,7 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); * @sa @ref window_pos * @sa glfwSetWindowPos * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -1798,23 +1788,23 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); * 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. + * * @param[in] window The window to query. * @param[in] xpos The x-coordinate of the upper-left corner of the client area. * @param[in] ypos The y-coordinate of the upper-left corner of the client area. * - * @note It is very rarely a good idea to move an already visible window, as it - * will confuse and annoy the user. - * - * @note The window manager may put limits on what positions are allowed. - * * @par Thread Safety * This function may only be called from the main thread. * * @sa @ref window_pos * @sa glfwGetWindowPos * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. @@ -1827,7 +1817,7 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); * * 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 in pixels, see @ref glfwGetFramebufferSize. + * framebuffer of the window in pixels, see @ref 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. @@ -1844,8 +1834,7 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); * @sa @ref window_size * @sa glfwSetWindowSize * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. @@ -1864,20 +1853,20 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); * 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. + * * @param[in] window The window to resize. * @param[in] width The desired width of the specified window. * @param[in] height The desired height of the specified window. * - * @note The window manager may put limits on what window sizes are allowed. - * * @par Thread Safety * This function may only be called from the main thread. * * @sa @ref window_size * @sa glfwGetWindowSize * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. @@ -1907,8 +1896,7 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); * @sa @ref window_fbsize * @sa glfwSetFramebufferSizeCallback * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -1943,8 +1931,7 @@ GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height) * * @sa @ref window_size * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup window */ @@ -1967,8 +1954,7 @@ GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int * @sa @ref window_iconify * @sa glfwRestoreWindow * - * @par History - * Added in GLFW 2.1. + * @since Added in GLFW 2.1. * * @par * __GLFW 3:__ Added window handle parameter. @@ -1993,8 +1979,7 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow* window); * @sa @ref window_iconify * @sa glfwIconifyWindow * - * @par History - * Added in GLFW 2.1. + * @since Added in GLFW 2.1. * * @par * __GLFW 3:__ Added window handle parameter. @@ -2017,8 +2002,7 @@ GLFWAPI void glfwRestoreWindow(GLFWwindow* window); * @sa @ref window_hide * @sa glfwHideWindow * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2038,8 +2022,7 @@ GLFWAPI void glfwShowWindow(GLFWwindow* window); * @sa @ref window_hide * @sa glfwShowWindow * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2059,8 +2042,7 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window); * * @sa @ref window_monitor * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2082,12 +2064,8 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); * * @sa @ref window_attribs * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwGetWindowParam`. Added window handle - * parameter. + * @since Added in GLFW 3.0. Replaces `glfwGetWindowParam` and + * `glfwGetGLVersion`. * * @ingroup window */ @@ -2108,8 +2086,7 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); * @sa @ref window_userptr * @sa glfwGetWindowUserPointer * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2128,8 +2105,7 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); * @sa @ref window_userptr * @sa glfwSetWindowUserPointer * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2152,11 +2128,7 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * * @sa @ref window_pos * - * @par History - * Added in GLFW 3.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2179,8 +2151,7 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * * @sa @ref window_size * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. Updated callback signature. @@ -2214,8 +2185,7 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * * @sa @ref window_close * - * @par History - * Added in GLFW 2.5. + * @since Added in GLFW 2.5. * * @par * __GLFW 3:__ Added window handle parameter. Updated callback signature. @@ -2245,8 +2215,7 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * * @sa @ref window_refresh * - * @par History - * Added in GLFW 2.5. + * @since Added in GLFW 2.5. * * @par * __GLFW 3:__ Added window handle parameter. Updated callback signature. @@ -2258,12 +2227,12 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL /*! @brief 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 focus. + * called when the window gains or loses input focus. * - * After the focus callback is called for a window that lost focus, synthetic - * key and mouse button release events will be generated for all such that had - * been pressed. For more information, see @ref glfwSetKeyCallback and @ref - * glfwSetMouseButtonCallback. + * 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 @ref glfwSetKeyCallback + * and @ref glfwSetMouseButtonCallback. * * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set @@ -2276,8 +2245,7 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * * @sa @ref window_focus * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2299,8 +2267,7 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * * @sa @ref window_iconify * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2322,8 +2289,7 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * * @sa @ref window_fbsize * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup window */ @@ -2353,14 +2319,10 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_event + * @sa @ref events * @sa glfwWaitEvents * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ This function is no longer called by @ref glfwSwapBuffers. + * @since Added in GLFW 1.0. * * @ingroup window */ @@ -2385,26 +2347,25 @@ GLFWAPI void glfwPollEvents(void); * [window refresh callback](@ref 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. * - * @note On some platforms, certain callbacks may be called outside of a call - * to one of the event processing functions. - * * @par Reentrancy * This function may not be called from a callback. * * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_event + * @sa @ref events * @sa glfwPollEvents * - * @par History - * Added in GLFW 2.5. + * @since Added in GLFW 2.5. * * @ingroup window */ @@ -2422,11 +2383,10 @@ GLFWAPI void glfwWaitEvents(void); * @par Thread Safety * This function may be called from any thread. * - * @sa @ref input_event + * @sa @ref events * @sa glfwWaitEvents * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup window */ @@ -2447,8 +2407,7 @@ GLFWAPI void glfwPostEmptyEvent(void); * * @sa glfwSetInputMode * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup input */ @@ -2464,9 +2423,7 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); * 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. This is - * useful if you wish to render your own cursor or have no visible cursor at - * all. + * 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. @@ -2496,8 +2453,7 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); * * @sa glfwGetInputMode * - * @par History - * Added in GLFW 3.0. Replaced `glfwEnable` and `glfwDisable`. + * @since Added in GLFW 3.0. Replaces `glfwEnable` and `glfwDisable`. * * @ingroup input */ @@ -2532,8 +2488,7 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); * * @sa @ref input_key * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. @@ -2547,8 +2502,7 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key); * * 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`. The higher-level action `GLFW_REPEAT` is only reported to - * the mouse button callback. + * `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, @@ -2563,8 +2517,7 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key); * * @sa @ref input_mouse_button * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. @@ -2600,15 +2553,10 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor_pos + * @sa @ref cursor_pos * @sa glfwSetCursorPos * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwGetMousePos`. Added window handle parameter. - * Moved to floating-point coordinates. + * @since Added in GLFW 3.0. Replaces `glfwGetMousePos`. * * @ingroup input */ @@ -2619,11 +2567,16 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); * * 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 be focused. If the window does not have focus when - * this function is called, it fails silently. + * window. The window must have input focus. If the window does not have + * input focus when this function is called, it fails silently. * - * 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 + * __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 @ref 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`. * * @param[in] window The desired window. @@ -2639,15 +2592,10 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor_pos + * @sa @ref cursor_pos * @sa glfwGetCursorPos * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwSetMousePos`. Added window handle parameter. - * Moved to floating-point coordinates. + * @since Added in GLFW 3.0. Replaces `glfwSetMousePos`. * * @ingroup input */ @@ -2655,19 +2603,23 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); /*! @brief Creates a custom cursor. * - * Creates a new cursor that can be made the system cursor for a window with - * @ref glfwSetCursor. The cursor can be destroyed with @ref - * glfwDestroyCursor. Any remaining cursors are destroyed by @ref - * glfwTerminate. + * Creates a new custom cursor image that can be set for a window with @ref + * glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor. + * Any remaining cursors are destroyed by @ref glfwTerminate. + * + * The pixels are 32-bit little-endian RGBA, i.e. eight bits per channel. They + * are arranged canonically as packed sequential rows, starting from the + * top-left corner. * - * The image data is 32-bit RGBA, i.e. eight bits per channel. The pixels are - * arranged canonically as sequental 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. * * @param[in] image The desired cursor image. - * @param[in] xhot The desired x-coordinate of the cursor hotspot. - * @param[in] yhot The desired y-coordinate of the cursor hotspot. + * @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot. + * @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot. * - * @return A new cursor ready to use or `NULL` if an + * @return The handle of the created cursor, or `NULL` if an * [error](@ref error_handling) occurred. * * @par Pointer Lifetime @@ -2679,12 +2631,11 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor + * @sa @ref cursor_object * @sa glfwDestroyCursor * @sa glfwCreateStandardCursor * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup input */ @@ -2692,8 +2643,8 @@ GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) /*! @brief Creates a cursor with a standard shape. * - * Returns a cursor with a [standard shape](@ref shapes), which can be made the - * system cursor for a window with @ref glfwSetCursor. + * Returns a cursor with a [standard shape](@ref shapes), that can be set for + * a window with @ref glfwSetCursor. * * @param[in] shape One of the [standard shapes](@ref shapes). * @@ -2706,11 +2657,10 @@ GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor + * @sa @ref cursor_object * @sa glfwCreateCursor * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup input */ @@ -2730,31 +2680,35 @@ GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor + * @sa @ref cursor_object * @sa glfwCreateCursor * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup input */ GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor); -/*! @brief Sets the system cursor for a given window. +/*! @brief 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](@ref cursor_mode) of the window is + * `GLFW_CURSOR_NORMAL`. * - * This function sets the system cursor for the specified window. + * On some platforms, the set cursor may not be visible unless the window also + * has input focus. * - * @param[in] window The window to set the system cursor for. - * @param[in] cursor The cursor to change to, or `NULL` to switch back - * to the default system cursor. + * @param[in] window The window to set the cursor for. + * @param[in] cursor The cursor to set, or `NULL` to switch back to the default + * arrow cursor. * * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor + * @sa @ref cursor_object * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup input */ @@ -2770,11 +2724,11 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * layout. If you want to input text, use the * [character callback](@ref glfwSetCharCallback) instead. * - * When a window loses 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 window has lost - * focus, i.e. `GLFW_FOCUSED` will be false and the focus callback will have - * already been called. + * 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](@ref 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 @@ -2795,8 +2749,7 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * * @sa @ref input_key * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. Updated callback signature. @@ -2835,8 +2788,7 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * * @sa @ref input_char * - * @par History - * Added in GLFW 2.4. + * @since Added in GLFW 2.4. * * @par * __GLFW 3:__ Added window handle parameter. Updated callback signature. @@ -2871,8 +2823,7 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * * @sa @ref input_char * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup input */ @@ -2883,11 +2834,11 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * 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 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 window has lost focus, i.e. `GLFW_FOCUSED` will be false and the - * focus callback will have already been called. + * 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](@ref glfwSetWindowFocusCallback) has been called. * * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set @@ -2900,8 +2851,7 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * * @sa @ref input_mouse_button * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par * __GLFW 3:__ Added window handle parameter. Updated callback signature. @@ -2926,14 +2876,9 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor_pos + * @sa @ref cursor_pos * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwSetMousePosCallback`. Added window handle - * parameter. Updated callback signature. + * @since Added in GLFW 3.0. Replaces `glfwSetMousePosCallback`. * * @ingroup input */ @@ -2954,10 +2899,9 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_cursor_enter + * @sa @ref cursor_enter * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup input */ @@ -2981,14 +2925,9 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_scroll + * @sa @ref scrolling * - * @par History - * Added in GLFW 2.1. - * - * @par - * __GLFW 3:__ Renamed from `glfwSetMouseWheelCallback`. Added window handle. - * Updated callback signature. + * @since Added in GLFW 3.0. Replaces `glfwSetMouseWheelCallback`. * * @ingroup input */ @@ -3013,10 +2952,9 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_drop + * @sa @ref path_drop * - * @par History - * Added in GLFW 3.1. + * @since Added in GLFW 3.1. * * @ingroup input */ @@ -3032,10 +2970,9 @@ GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_joy + * @sa @ref joystick * - * @par History - * Added in GLFW 3.0. Replaced `glfwGetJoystickParam`. + * @since Added in GLFW 3.0. Replaces `glfwGetJoystickParam`. * * @ingroup input */ @@ -3059,14 +2996,9 @@ GLFWAPI int glfwJoystickPresent(int joy); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_joy_axis - * - * @par History - * Added in GLFW 2.2. + * @sa @ref joystick_axis * - * @par - * __GLFW 3:__ Renamed from `glfwGetJoystickPos`. Changed to return a dynamic - * array. + * @since Added in GLFW 3.0. Replaces `glfwGetJoystickPos`. * * @ingroup input */ @@ -3090,10 +3022,9 @@ GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_joy_button + * @sa @ref joystick_button * - * @par History - * Added in GLFW 2.2. + * @since Added in GLFW 2.2. * * @par * __GLFW 3:__ Changed to return a dynamic array. @@ -3120,10 +3051,9 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_joy_name + * @sa @ref joystick_name * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup input */ @@ -3143,11 +3073,10 @@ GLFWAPI const char* glfwGetJoystickName(int joy); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_clipboard + * @sa @ref clipboard * @sa glfwGetClipboardString * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup input */ @@ -3171,11 +3100,10 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_clipboard + * @sa @ref clipboard * @sa glfwSetClipboardString * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup input */ @@ -3197,10 +3125,9 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); * @par Thread Safety * This function may be called from any thread. Access is not synchronized. * - * @sa @ref input_time + * @sa @ref time * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @ingroup input */ @@ -3216,10 +3143,9 @@ GLFWAPI double glfwGetTime(void); * @par Thread Safety * This function may only be called from the main thread. * - * @sa @ref input_time + * @sa @ref time * - * @par History - * Added in GLFW 2.2. + * @since Added in GLFW 2.2. * * @ingroup input */ @@ -3236,7 +3162,7 @@ GLFWAPI void glfwSetTime(double 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](@ref window_hints_ctx). + * [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint. * * @param[in] window The window whose context to make current, or `NULL` to * detach the current context. @@ -3247,8 +3173,7 @@ GLFWAPI void glfwSetTime(double time); * @sa @ref context_current * @sa glfwGetCurrentContext * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup context */ @@ -3268,8 +3193,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window); * @sa @ref context_current * @sa glfwMakeContextCurrent * - * @par History - * Added in GLFW 3.0. + * @since Added in GLFW 3.0. * * @ingroup context */ @@ -3286,15 +3210,13 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void); * @par Thread Safety * This function may be called from any thread. * - * @sa @ref window_swap + * @sa @ref buffer_swap * @sa glfwSwapInterval * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @par - * __GLFW 3:__ Added window handle parameter. Removed call to @ref - * glfwPollEvents. + * __GLFW 3:__ Added window handle parameter. * * @ingroup window */ @@ -3305,7 +3227,8 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); * This function sets the swap interval for the current context, i.e. the * number of screen updates to wait from the time @ref glfwSwapBuffers was * called before swapping the buffers and returning. This is sometimes called - * 'vertical synchronization', 'vertical retrace synchronization' or 'vsync'. + * _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, @@ -3315,7 +3238,7 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); * 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. + * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. * * @param[in] interval The minimum number of screen updates to wait for * until the buffers are swapped by @ref glfwSwapBuffers. @@ -3332,11 +3255,10 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); * @par Thread Safety * This function may be called from any thread. * - * @sa @ref window_swap + * @sa @ref buffer_swap * @sa glfwSwapBuffers * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @ingroup context */ @@ -3350,7 +3272,7 @@ GLFWAPI void glfwSwapInterval(int interval); * 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. + * without a current context will cause a @ref 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 @@ -3366,8 +3288,7 @@ GLFWAPI void glfwSwapInterval(int interval); * @sa @ref context_glext * @sa glfwGetProcAddress * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @ingroup context */ @@ -3381,7 +3302,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension); * 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. + * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error. * * @param[in] procname The ASCII encoded name of the function. * @return The address of the function, or `NULL` if the function is @@ -3400,8 +3321,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension); * @sa @ref context_glext * @sa glfwExtensionSupported * - * @par History - * Added in GLFW 1.0. + * @since Added in GLFW 1.0. * * @ingroup context */ diff --git a/glfw/include/GLFW/glfw3native.h b/glfw/include/GLFW/glfw3native.h index 881f504..b3ce748 100644 --- a/glfw/include/GLFW/glfw3native.h +++ b/glfw/include/GLFW/glfw3native.h @@ -40,9 +40,9 @@ extern "C" { /*! @defgroup native Native access * - * **By using the native API, you assert that you know what you're doing and - * how to fix problems caused by using it. If you don't, you shouldn't be - * using it.** + * **By using the native access functions you assert that you know what you're + * doing and how to fix problems caused by using them. If you don't, you + * shouldn't be using them.** * * Before the inclusion of @ref glfw3native.h, you must define exactly one * window system API macro and exactly one context creation API macro. Failure @@ -87,7 +87,7 @@ extern "C" { #include <X11/Xlib.h> #include <X11/extensions/Xrandr.h> #else - #error "No window API specified" + #error "No window API selected" #endif #if defined(GLFW_EXPOSE_NATIVE_WGL) @@ -99,7 +99,7 @@ extern "C" { #elif defined(GLFW_EXPOSE_NATIVE_EGL) #include <EGL/egl.h> #else - #error "No context API specified" + #error "No context API selected" #endif diff --git a/glfw/src/CMakeLists.txt b/glfw/src/CMakeLists.txt index 9ba9fc5..77a8501 100644 --- a/glfw/src/CMakeLists.txt +++ b/glfw/src/CMakeLists.txt @@ -5,7 +5,8 @@ include_directories("${GLFW_SOURCE_DIR}/src" add_definitions(-D_GLFW_USE_CONFIG_H) -set(common_HEADERS "${GLFW_BINARY_DIR}/src/glfw_config.h" internal.h +set(common_HEADERS internal.h + "${GLFW_BINARY_DIR}/src/glfw_config.h" "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h") set(common_SOURCES context.c init.c input.c monitor.c window.c) @@ -57,16 +58,14 @@ if (APPLE) endif() add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) -set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}" - POSITION_INDEPENDENT_CODE ON) +set_target_properties(glfw PROPERTIES + OUTPUT_NAME "${GLFW_LIB_NAME}" + VERSION ${GLFW_VERSION} + SOVERSION ${GLFW_VERSION_MAJOR} + POSITION_INDEPENDENT_CODE ON + FOLDER "GLFW3") if (BUILD_SHARED_LIBS) - # Include version information in the output - set_target_properties(glfw PROPERTIES VERSION ${GLFW_VERSION}) - if (UNIX) - set_target_properties(glfw PROPERTIES SOVERSION ${GLFW_VERSION_MAJOR}) - endif() - if (WIN32) # The GLFW DLL needs a special compile-time macro and import library name set_target_properties(glfw PROPERTIES PREFIX "" IMPORT_PREFIX "") diff --git a/glfw/src/cocoa_monitor.m b/glfw/src/cocoa_monitor.m index db3cf71..d518973 100644 --- a/glfw/src/cocoa_monitor.m +++ b/glfw/src/cocoa_monitor.m @@ -48,7 +48,7 @@ static char* getDisplayName(CGDirectDisplayID displayID) CFIndex size; // NOTE: This uses a deprecated function because Apple has - // (as of September 2014) not provided any alternative + // (as of January 2015) not provided any alternative info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName); names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName)); diff --git a/glfw/src/cocoa_window.m b/glfw/src/cocoa_window.m index 30adf75..9d182f4 100644 --- a/glfw/src/cocoa_window.m +++ b/glfw/src/cocoa_window.m @@ -79,7 +79,7 @@ static void updateModeCursor(_GLFWwindow* window) [(NSCursor*) _glfw.ns.cursor set]; } -// Enter fullscreen mode +// Enter full screen mode // static GLboolean enterFullscreenMode(_GLFWwindow* window) { @@ -95,7 +95,7 @@ static GLboolean enterFullscreenMode(_GLFWwindow* window) return status; } -// Leave fullscreen mode +// Leave full screen mode // static void leaveFullscreenMode(_GLFWwindow* window) { @@ -453,6 +453,7 @@ static int translateKey(unsigned int key) const NSRect fbRect = convertRectToBacking(window, contentRect); _glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height); + _glfwInputWindowDamage(window); } - (void)updateTrackingAreas @@ -695,7 +696,7 @@ static NSString* findAppName(void) // This is nasty, nasty stuff -- calls to undocumented semi-private APIs that // could go away at any moment, lots of stuff that really should be // localize(d|able), etc. Loading a nib would save us this horror, but that -// doesn't seem like a good thing to require of GLFW's clients. +// doesn't seem like a good thing to require of GLFW users. // static void createMenuBar(void) { diff --git a/glfw/src/context.c b/glfw/src/context.c index 8f01846..f8b8008 100644 --- a/glfw/src/context.c +++ b/glfw/src/context.c @@ -588,7 +588,6 @@ GLFWAPI void glfwSwapInterval(int interval) GLFWAPI int glfwExtensionSupported(const char* extension) { - const GLubyte* extensions; _GLFWwindow* window; _GLFW_REQUIRE_INIT_OR_RETURN(GL_FALSE); @@ -600,29 +599,14 @@ GLFWAPI int glfwExtensionSupported(const char* extension) return GL_FALSE; } - if (!extension || *extension == '\0') + if (*extension == '\0') { _glfwInputError(GLFW_INVALID_VALUE, NULL); return GL_FALSE; } - if (window->context.major < 3) - { - // Check if extension is in the old style OpenGL extensions string - - extensions = glGetString(GL_EXTENSIONS); - if (!extensions) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Failed to retrieve extension string"); - return GL_FALSE; - } - - if (_glfwStringInExtensionString(extension, extensions)) - return GL_TRUE; - } #if defined(_GLFW_USE_OPENGL) - else + if (window->context.major >= 3) { int i; GLint count; @@ -645,7 +629,22 @@ GLFWAPI int glfwExtensionSupported(const char* extension) return GL_TRUE; } } + else #endif // _GLFW_USE_OPENGL + { + // Check if extension is in the old style OpenGL extensions string + + const GLubyte* extensions = glGetString(GL_EXTENSIONS); + if (!extensions) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Failed to retrieve extension string"); + return GL_FALSE; + } + + if (_glfwStringInExtensionString(extension, extensions)) + return GL_TRUE; + } // Check if extension is in the platform-specific string return _glfwPlatformExtensionSupported(extension); diff --git a/glfw/src/glfw3Config.cmake.in b/glfw/src/glfw3Config.cmake.in new file mode 100644 index 0000000..d34df06 --- /dev/null +++ b/glfw/src/glfw3Config.cmake.in @@ -0,0 +1,15 @@ +# - Config file for the glfw3 package +# It defines the following variables +# GLFW3_INCLUDE_DIR, the path where GLFW headers are located +# GLFW3_LIBRARY_DIR, folder in which the GLFW library is located +# GLFW3_LIBRARY, library to link against to use GLFW + +set(GLFW3_VERSION "@GLFW_VERSION_FULL@") + +@PACKAGE_INIT@ + +set_and_check(GLFW3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/include") +set_and_check(GLFW3_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@") + +find_library(GLFW3_LIBRARY "@GLFW_LIB_NAME@" HINTS ${GLFW3_LIBRARY_DIR}) + diff --git a/glfw/src/glfwConfig.cmake.in b/glfw/src/glfwConfig.cmake.in deleted file mode 100644 index 796ad2c..0000000 --- a/glfw/src/glfwConfig.cmake.in +++ /dev/null @@ -1,10 +0,0 @@ -# - Config file for the glfw package -# It defines the following variables -# GLFW_INCLUDE_DIR, the path where GLFW headers are located -# GLFW_LIBRARY_DIR, folder in which the GLFW library is located -# GLFW_LIBRARY, library to link against to use GLFW - -set(GLFW_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include") -set(GLFW_LIBRARY_DIR "@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@") - -find_library(GLFW_LIBRARY "@GLFW_LIB_NAME@" HINTS ${GLFW_LIBRARY_DIR}) diff --git a/glfw/src/glfwConfigVersion.cmake.in b/glfw/src/glfwConfigVersion.cmake.in deleted file mode 100644 index da8eaf6..0000000 --- a/glfw/src/glfwConfigVersion.cmake.in +++ /dev/null @@ -1,12 +0,0 @@ - -set(PACKAGE_VERSION "@GLFW_VERSION_FULL@") - -if ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "@GLFW_VERSION_MAJOR@") - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @GLFW_VERSION_MINOR@) - set(PACKAGE_VERSION_EXACT TRUE) - endif() -else() - set(PACKAGE_VERSION_COMPATIBLE FALSE) -endif() - diff --git a/glfw/src/internal.h b/glfw/src/internal.h index c473355..1e6977f 100644 --- a/glfw/src/internal.h +++ b/glfw/src/internal.h @@ -112,7 +112,7 @@ typedef struct _GLFWcursor _GLFWcursor; // Helper macros //======================================================================== -// Checks for whether the library has been intitalized +// Checks for whether the library has been initialized #define _GLFW_REQUIRE_INIT() \ if (!_glfwInitialized) \ { \ @@ -184,7 +184,7 @@ struct _GLFWctxconfig /*! @brief Framebuffer configuration. * * This describes buffers and their sizes. It also contains - * a platform-specific ID used to map back to the backend API's object. + * a platform-specific ID used to map back to the backend API object. * * It is used to pass framebuffer parameters from shared code to the platform * API and also to enumerate and select available framebuffer configs. diff --git a/glfw/src/linux_joystick.c b/glfw/src/linux_joystick.c index c93184e..5f46519 100644 --- a/glfw/src/linux_joystick.c +++ b/glfw/src/linux_joystick.c @@ -54,16 +54,16 @@ static void openJoystickDevice(const char* path) for (joy = GLFW_JOYSTICK_1; joy <= GLFW_JOYSTICK_LAST; joy++) { - if (!_glfw.linux_js[joy].present) + if (!_glfw.linux_js.js[joy].present) continue; - if (strcmp(_glfw.linux_js[joy].path, path) == 0) + if (strcmp(_glfw.linux_js.js[joy].path, path) == 0) return; } for (joy = GLFW_JOYSTICK_1; joy <= GLFW_JOYSTICK_LAST; joy++) { - if (!_glfw.linux_js[joy].present) + if (!_glfw.linux_js.js[joy].present) break; } @@ -74,7 +74,7 @@ static void openJoystickDevice(const char* path) if (fd == -1) return; - _glfw.linux_js[joy].fd = fd; + _glfw.linux_js.js[joy].fd = fd; // Verify that the joystick driver version is at least 1.0 ioctl(fd, JSIOCGVERSION, &version); @@ -88,19 +88,19 @@ static void openJoystickDevice(const char* path) if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0) strncpy(name, "Unknown", sizeof(name)); - _glfw.linux_js[joy].name = strdup(name); - _glfw.linux_js[joy].path = strdup(path); + _glfw.linux_js.js[joy].name = strdup(name); + _glfw.linux_js.js[joy].path = strdup(path); ioctl(fd, JSIOCGAXES, &axisCount); - _glfw.linux_js[joy].axisCount = (int) axisCount; + _glfw.linux_js.js[joy].axisCount = (int) axisCount; ioctl(fd, JSIOCGBUTTONS, &buttonCount); - _glfw.linux_js[joy].buttonCount = (int) buttonCount; + _glfw.linux_js.js[joy].buttonCount = (int) buttonCount; - _glfw.linux_js[joy].axes = calloc(axisCount, sizeof(float)); - _glfw.linux_js[joy].buttons = calloc(buttonCount, 1); + _glfw.linux_js.js[joy].axes = calloc(axisCount, sizeof(float)); + _glfw.linux_js.js[joy].buttons = calloc(buttonCount, 1); - _glfw.linux_js[joy].present = GL_TRUE; + _glfw.linux_js.js[joy].present = GL_TRUE; #endif // __linux__ } @@ -114,14 +114,14 @@ static void pollJoystickEvents(void) ssize_t offset = 0; char buffer[16384]; - const ssize_t size = read(_glfw.x11.inotify.fd, buffer, sizeof(buffer)); + const ssize_t size = read(_glfw.linux_js.inotify, buffer, sizeof(buffer)); while (size > offset) { regmatch_t match; const struct inotify_event* e = (struct inotify_event*) (buffer + offset); - if (regexec(&_glfw.x11.inotify.regex, e->name, 1, &match, 0) == 0) + if (regexec(&_glfw.linux_js.regex, e->name, 1, &match, 0) == 0) { char path[20]; snprintf(path, sizeof(path), "/dev/input/%s", e->name); @@ -133,25 +133,25 @@ static void pollJoystickEvents(void) for (i = 0; i <= GLFW_JOYSTICK_LAST; i++) { - if (!_glfw.linux_js[i].present) + if (!_glfw.linux_js.js[i].present) continue; // Read all queued events (non-blocking) for (;;) { errno = 0; - if (read(_glfw.linux_js[i].fd, &e, sizeof(e)) < 0) + if (read(_glfw.linux_js.js[i].fd, &e, sizeof(e)) < 0) { if (errno == ENODEV) { // The joystick was disconnected - free(_glfw.linux_js[i].axes); - free(_glfw.linux_js[i].buttons); - free(_glfw.linux_js[i].name); - free(_glfw.linux_js[i].path); + free(_glfw.linux_js.js[i].axes); + free(_glfw.linux_js.js[i].buttons); + free(_glfw.linux_js.js[i].name); + free(_glfw.linux_js.js[i].path); - memset(&_glfw.linux_js[i], 0, sizeof(_glfw.linux_js[i])); + memset(&_glfw.linux_js.js[i], 0, sizeof(_glfw.linux_js.js[i])); } break; @@ -163,12 +163,12 @@ static void pollJoystickEvents(void) switch (e.type) { case JS_EVENT_AXIS: - _glfw.linux_js[i].axes[e.number] = + _glfw.linux_js.js[i].axes[e.number] = (float) e.value / 32767.0f; break; case JS_EVENT_BUTTON: - _glfw.linux_js[i].buttons[e.number] = + _glfw.linux_js.js[i].buttons[e.number] = e.value ? GLFW_PRESS : GLFW_RELEASE; break; @@ -192,54 +192,65 @@ int _glfwInitJoysticks(void) #if defined(__linux__) const char* dirname = "/dev/input"; DIR* dir; - struct dirent* entry; - _glfw.x11.inotify.fd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); - if (_glfw.x11.inotify.fd == -1) + _glfw.linux_js.inotify = inotify_init1(IN_NONBLOCK | IN_CLOEXEC); + if (_glfw.linux_js.inotify == -1) { - _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to initialize inotify"); + _glfwInputError(GLFW_PLATFORM_ERROR, + "Linux: Failed to initialize inotify: %s", + strerror(errno)); return GL_FALSE; } // HACK: Register for IN_ATTRIB as well to get notified when udev is done // This works well in practice but the true way is libudev - _glfw.x11.inotify.wd = inotify_add_watch(_glfw.x11.inotify.fd, + _glfw.linux_js.watch = inotify_add_watch(_glfw.linux_js.inotify, dirname, IN_CREATE | IN_ATTRIB); - if (_glfw.x11.inotify.wd == -1) + if (_glfw.linux_js.watch == -1) { _glfwInputError(GLFW_PLATFORM_ERROR, - "X11: Failed to add watch to %s", dirname); - return GL_FALSE; + "Linux: Failed to watch for joystick connections in %s: %s", + dirname, + strerror(errno)); + // Continue without device connection notifications } - if (regcomp(&_glfw.x11.inotify.regex, "^js[0-9]\\+$", 0) != 0) + if (regcomp(&_glfw.linux_js.regex, "^js[0-9]\\+$", 0) != 0) { - _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to compile regex"); + _glfwInputError(GLFW_PLATFORM_ERROR, "Linux: Failed to compile regex"); return GL_FALSE; } dir = opendir(dirname); - if (!dir) + if (dir) { - _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to open %s", dirname); - return GL_FALSE; - } + struct dirent* entry; - while ((entry = readdir(dir))) - { - char path[20]; - regmatch_t match; + while ((entry = readdir(dir))) + { + char path[20]; + regmatch_t match; - if (regexec(&_glfw.x11.inotify.regex, entry->d_name, 1, &match, 0) != 0) - continue; + if (regexec(&_glfw.linux_js.regex, entry->d_name, 1, &match, 0) != 0) + continue; + + snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name); + openJoystickDevice(path); + } - snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name); - openJoystickDevice(path); + closedir(dir); + } + else + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Linux: Failed to open joystick device directory %s: %s", + dirname, + strerror(errno)); + // Continue with no joysticks detected } - closedir(dir); #endif // __linux__ return GL_TRUE; @@ -254,23 +265,23 @@ void _glfwTerminateJoysticks(void) for (i = 0; i <= GLFW_JOYSTICK_LAST; i++) { - if (_glfw.linux_js[i].present) + if (_glfw.linux_js.js[i].present) { - close(_glfw.linux_js[i].fd); - free(_glfw.linux_js[i].axes); - free(_glfw.linux_js[i].buttons); - free(_glfw.linux_js[i].name); - free(_glfw.linux_js[i].path); + close(_glfw.linux_js.js[i].fd); + free(_glfw.linux_js.js[i].axes); + free(_glfw.linux_js.js[i].buttons); + free(_glfw.linux_js.js[i].name); + free(_glfw.linux_js.js[i].path); } } - regfree(&_glfw.x11.inotify.regex); + regfree(&_glfw.linux_js.regex); - if (_glfw.x11.inotify.wd > 0) - close(_glfw.x11.inotify.wd); + if (_glfw.linux_js.watch > 0) + close(_glfw.linux_js.watch); - if (_glfw.x11.inotify.fd > 0) - close(_glfw.x11.inotify.fd); + if (_glfw.linux_js.inotify > 0) + close(_glfw.linux_js.inotify); #endif // __linux__ } @@ -283,29 +294,29 @@ int _glfwPlatformJoystickPresent(int joy) { pollJoystickEvents(); - return _glfw.linux_js[joy].present; + return _glfw.linux_js.js[joy].present; } const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { pollJoystickEvents(); - *count = _glfw.linux_js[joy].axisCount; - return _glfw.linux_js[joy].axes; + *count = _glfw.linux_js.js[joy].axisCount; + return _glfw.linux_js.js[joy].axes; } const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { pollJoystickEvents(); - *count = _glfw.linux_js[joy].buttonCount; - return _glfw.linux_js[joy].buttons; + *count = _glfw.linux_js.js[joy].buttonCount; + return _glfw.linux_js.js[joy].buttons; } const char* _glfwPlatformGetJoystickName(int joy) { pollJoystickEvents(); - return _glfw.linux_js[joy].name; + return _glfw.linux_js.js[joy].name; } diff --git a/glfw/src/linux_joystick.h b/glfw/src/linux_joystick.h index b74a67e..163b07c 100644 --- a/glfw/src/linux_joystick.h +++ b/glfw/src/linux_joystick.h @@ -27,22 +27,33 @@ #ifndef _linux_joystick_h_ #define _linux_joystick_h_ +#include <regex.h> + #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ - _GLFWjoystickLinux linux_js[GLFW_JOYSTICK_LAST + 1] + _GLFWjoystickLinux linux_js -// Linux-specific per-joystick data +// Linux-specific joystick API data // typedef struct _GLFWjoystickLinux { - int present; - int fd; - float* axes; - int axisCount; - unsigned char* buttons; - int buttonCount; - char* name; - char* path; + struct + { + int present; + int fd; + float* axes; + int axisCount; + unsigned char* buttons; + int buttonCount; + char* name; + char* path; + } js[GLFW_JOYSTICK_LAST + 1]; + +#if defined(__linux__) + int inotify; + int watch; + regex_t regex; +#endif /*__linux__*/ } _GLFWjoystickLinux; diff --git a/glfw/src/mir_init.c b/glfw/src/mir_init.c index fe02e62..a3c8de9 100644 --- a/glfw/src/mir_init.c +++ b/glfw/src/mir_init.c @@ -27,6 +27,8 @@ #include "internal.h" #include <stdlib.h> +#include <string.h> + ////////////////////////////////////////////////////////////////////////// ////// GLFW internal API ////// @@ -41,7 +43,9 @@ int _glfwPlatformInit(void) if (!mir_connection_is_valid(_glfw.mir.connection)) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unable to connect to Server"); + "Mir: Unable to connect to server: %s", + mir_connection_get_error_message(_glfw.mir.connection)); + return GL_FALSE; } @@ -61,7 +65,8 @@ int _glfwPlatformInit(void) if (error) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Failed to create Event Mutex Error: %i\n", error); + "Mir: Failed to create event mutex: %s\n", + strerror(error)); return GL_FALSE; } @@ -82,7 +87,7 @@ void _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { - const char* version = _GLFW_VERSION_NUMBER " Mir EGL " + const char* version = _GLFW_VERSION_NUMBER " Mir EGL" #if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) " clock_gettime" #endif diff --git a/glfw/src/mir_monitor.c b/glfw/src/mir_monitor.c index bdf47bd..9776b10 100644 --- a/glfw/src/mir_monitor.c +++ b/glfw/src/mir_monitor.c @@ -127,12 +127,12 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } diff --git a/glfw/src/mir_platform.h b/glfw/src/mir_platform.h index 7d477e9..76399c2 100644 --- a/glfw/src/mir_platform.h +++ b/glfw/src/mir_platform.h @@ -97,7 +97,7 @@ typedef struct _GLFWlibraryMir // Mir-specific per-cursor data -// TODO: Only system cursors are implemented in mir atm. Need to wait for support. +// TODO: Only system cursors are implemented in Mir atm. Need to wait for support. // typedef struct _GLFWcursorMir { diff --git a/glfw/src/mir_window.c b/glfw/src/mir_window.c index e972662..f2890cb 100644 --- a/glfw/src/mir_window.c +++ b/glfw/src/mir_window.c @@ -90,11 +90,11 @@ static EventNode* dequeueEvent(EventQueue* queue) static MirPixelFormat findValidPixelFormat(void) { - unsigned int i, validFormats, size = 32; - MirPixelFormat formats[size]; + unsigned int i, validFormats, mirPixelFormats = 32; + MirPixelFormat formats[mir_pixel_formats]; mir_connection_get_available_surface_formats(_glfw.mir.connection, formats, - size, &validFormats); + mirPixelFormats, &validFormats); for (i = 0; i < validFormats; i++) { @@ -407,7 +407,9 @@ static int createSurface(_GLFWwindow* window) if (!mir_surface_is_valid(window->mir.surface)) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unable to create surface"); + "Mir: Unable to create surface: %s", + mir_surface_get_error_message(window->mir.surface)); + return GL_FALSE; } @@ -463,7 +465,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, GLFWvidmode mode; _glfwPlatformGetVideoMode(wndconfig->monitor, &mode); - mir_surface_set_type(window->mir.surface, mir_surface_state_fullscreen); + mir_surface_set_state(window->mir.surface, mir_surface_state_fullscreen); if (wndconfig->width > mode.width || wndconfig->height > mode.height) { @@ -500,13 +502,13 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, @@ -514,19 +516,19 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* right, int* bottom) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) @@ -539,50 +541,50 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) void _glfwPlatformIconifyWindow(_GLFWwindow* window) { - mir_surface_set_type(window->mir.surface, mir_surface_state_minimized); + mir_surface_set_state(window->mir.surface, mir_surface_state_minimized); } void _glfwPlatformRestoreWindow(_GLFWwindow* window) { - mir_surface_set_type(window->mir.surface, mir_surface_state_restored); + mir_surface_set_state(window->mir.surface, mir_surface_state_restored); } void _glfwPlatformHideWindow(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformShowWindow(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformUnhideWindow(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } int _glfwPlatformWindowFocused(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); return GL_FALSE; } int _glfwPlatformWindowIconified(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); return GL_FALSE; } int _glfwPlatformWindowVisible(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); return GL_FALSE; } @@ -626,7 +628,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor, int xhot, int yhot) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); return GL_FALSE; } @@ -634,7 +636,7 @@ int _glfwPlatformCreateCursor(_GLFWcursor* cursor, int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); return GL_FALSE; } @@ -642,37 +644,43 @@ int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); +} + +void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos) +{ + _glfwInputError(GLFW_PLATFORM_ERROR, + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformApplyCursorMode(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); } const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); + "Mir: Unsupported function %s!", __PRETTY_FUNCTION__); return NULL; } diff --git a/glfw/src/monitor.c b/glfw/src/monitor.c index ad35353..1ab5748 100644 --- a/glfw/src/monitor.c +++ b/glfw/src/monitor.c @@ -321,21 +321,21 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos) _glfwPlatformGetMonitorPos(monitor, xpos, ypos); } -GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* width, int* height) +GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* widthMM, int* heightMM) { _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - if (width) - *width = 0; - if (height) - *height = 0; + if (widthMM) + *widthMM = 0; + if (heightMM) + *heightMM = 0; _GLFW_REQUIRE_INIT(); - if (width) - *width = monitor->widthMM; - if (height) - *height = monitor->heightMM; + if (widthMM) + *widthMM = monitor->widthMM; + if (heightMM) + *heightMM = monitor->heightMM; } GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle) diff --git a/glfw/src/nsgl_context.m b/glfw/src/nsgl_context.m index 9800977..0f0fb86 100644 --- a/glfw/src/nsgl_context.m +++ b/glfw/src/nsgl_context.m @@ -168,7 +168,7 @@ int _glfwCreateContext(_GLFWwindow* window, fbconfig->greenBits + fbconfig->blueBits; - // OS X needs non-zero color size, so set resonable values + // OS X needs non-zero color size, so set reasonable values if (colorBits == 0) colorBits = 24; else if (colorBits < 15) @@ -206,7 +206,7 @@ int _glfwCreateContext(_GLFWwindow* window, } // NOTE: All NSOpenGLPixelFormats on the relevant cards support sRGB - // frambuffer, so there's no need (and no way) to request it + // framebuffer, so there's no need (and no way) to request it ADD_ATTR(0); diff --git a/glfw/src/win32_init.c b/glfw/src/win32_init.c index a963689..964b23a 100644 --- a/glfw/src/win32_init.c +++ b/glfw/src/win32_init.c @@ -39,7 +39,7 @@ #if defined(_GLFW_USE_OPTIMUS_HPG) // Applications exporting this symbol with this value will be automatically -// directed to the high-performance GPU on nVidia Optimus systems +// directed to the high-performance GPU on Nvidia Optimus systems // __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; diff --git a/glfw/src/win32_platform.h b/glfw/src/win32_platform.h index 1270350..861d2bc 100644 --- a/glfw/src/win32_platform.h +++ b/glfw/src/win32_platform.h @@ -159,6 +159,7 @@ typedef struct _GLFWwindowWin32 DWORD dwExStyle; GLboolean cursorInside; + GLboolean iconified; // The last received cursor position, regardless of source int cursorPosX, cursorPosY; diff --git a/glfw/src/win32_window.c b/glfw/src/win32_window.c index c068fb3..176ed59 100644 --- a/glfw/src/win32_window.c +++ b/glfw/src/win32_window.c @@ -202,7 +202,7 @@ static int translateKey(WPARAM wParam, LPARAM lParam) return _glfw.win32.publicKeys[HIWORD(lParam) & 0x1FF]; } -// Enter fullscreen mode +// Enter full screen mode // static GLboolean enterFullscreenMode(_GLFWwindow* window) { @@ -221,7 +221,7 @@ static GLboolean enterFullscreenMode(_GLFWwindow* window) return status; } -// Leave fullscreen mode +// Leave full screen mode // static void leaveFullscreenMode(_GLFWwindow* window) { @@ -280,7 +280,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, { if (window->monitor) { - // We are running in fullscreen mode, so disallow + // We are running in full screen mode, so disallow // screen saver and screen blanking return 0; } @@ -483,21 +483,23 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_SIZE: { - if (wParam == SIZE_MINIMIZED) - _glfwInputWindowIconify(window, GL_TRUE); - else if (wParam == SIZE_RESTORED) - _glfwInputWindowIconify(window, GL_FALSE); - if (_glfw.focusedWindow == window) { if (window->cursorMode == GLFW_CURSOR_DISABLED) updateClipRect(window); } - if (wParam == SIZE_MINIMIZED) + if (!window->win32.iconified && wParam == SIZE_MINIMIZED) + { + window->win32.iconified = GL_TRUE; _glfwInputWindowIconify(window, GL_TRUE); - else if (wParam == SIZE_RESTORED) + } + else if (window->win32.iconified && + (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED)) + { + window->win32.iconified = GL_FALSE; _glfwInputWindowIconify(window, GL_FALSE); + } _glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam)); _glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam)); @@ -669,8 +671,8 @@ static int createWindow(_GLFWwindow* window, ypos = CW_USEDEFAULT; getFullWindowSize(window, - wndconfig->width, wndconfig->height, - &fullWidth, &fullHeight); + wndconfig->width, wndconfig->height, + &fullWidth, &fullHeight); } wideTitle = _glfwCreateWideStringFromUTF8(wndconfig->title); diff --git a/glfw/src/window.c b/glfw/src/window.c index a7ca2c8..4a46a6e 100644 --- a/glfw/src/window.c +++ b/glfw/src/window.c @@ -479,7 +479,7 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* handle, int xpos, int ypos) if (window->monitor) { _glfwInputError(GLFW_INVALID_VALUE, - "Fullscreen windows cannot be positioned"); + "Full screen windows cannot be positioned"); return; } diff --git a/glfw/src/wl_window.c b/glfw/src/wl_window.c index 916ba68..bb2da47 100644 --- a/glfw/src/wl_window.c +++ b/glfw/src/wl_window.c @@ -239,7 +239,7 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) // as (0, 0) _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Window position retreival not supported"); + "Wayland: Window position retrieval not supported"); } void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) @@ -372,6 +372,12 @@ void _glfwPlatformPostEmptyEvent(void) wl_display_sync(_glfw.wl.display); } +void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos) +{ + // TODO + fprintf(stderr, "_glfwPlatformGetCursorPos not implemented yet\n"); +} + void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) { // A Wayland client can not set the cursor position diff --git a/glfw/src/x11_init.c b/glfw/src/x11_init.c index e2063a1..388105e 100644 --- a/glfw/src/x11_init.c +++ b/glfw/src/x11_init.c @@ -42,7 +42,7 @@ static int translateKey(int scancode) { int keySym; - // Valid key code range is [8,255], according to the XLib manual + // Valid key code range is [8,255], according to the Xlib manual if (scancode < 8 || scancode > 255) return GLFW_KEY_UNKNOWN; @@ -72,7 +72,7 @@ static int translateKey(int scancode) default: break; } - // Now try pimary keysym for function keys (non-printable keys). These + // Now try primary keysym for function keys (non-printable keys). These // should not be layout dependent (i.e. US layout and international // layouts should give the same result). keySym = XkbKeycodeToKeysym(_glfw.x11.display, scancode, 0, 0); diff --git a/glfw/src/x11_monitor.c b/glfw/src/x11_monitor.c index fb6b0ef..6265070 100644 --- a/glfw/src/x11_monitor.c +++ b/glfw/src/x11_monitor.c @@ -224,6 +224,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) for (j = 0; j < ci->noutput; j++) { + int widthMM, heightMM; XRROutputInfo* oi = XRRGetOutputInfo(_glfw.x11.display, sr, ci->outputs[j]); if (oi->connection != RR_Connected) @@ -238,10 +239,18 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) monitors = realloc(monitors, sizeof(_GLFWmonitor*) * size); } - monitors[found] = _glfwAllocMonitor(oi->name, - oi->mm_width, - oi->mm_height); + if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270) + { + widthMM = oi->mm_height; + heightMM = oi->mm_width; + } + else + { + widthMM = oi->mm_width; + heightMM = oi->mm_height; + } + monitors[found] = _glfwAllocMonitor(oi->name, widthMM, heightMM); monitors[found]->x11.output = ci->outputs[j]; monitors[found]->x11.crtc = oi->crtc; diff --git a/glfw/src/x11_platform.h b/glfw/src/x11_platform.h index 17503b7..81d1bef 100644 --- a/glfw/src/x11_platform.h +++ b/glfw/src/x11_platform.h @@ -31,7 +31,6 @@ #include <unistd.h> #include <signal.h> #include <stdint.h> -#include <regex.h> #include <X11/Xlib.h> #include <X11/keysym.h> @@ -216,14 +215,6 @@ typedef struct _GLFWlibraryX11 int versionMinor; } xinerama; -#if defined(__linux__) - struct { - int fd; - int wd; - regex_t regex; - } inotify; -#endif - } _GLFWlibraryX11; diff --git a/glfw/src/x11_window.c b/glfw/src/x11_window.c index 5b75b8a..0380b58 100644 --- a/glfw/src/x11_window.c +++ b/glfw/src/x11_window.c @@ -303,7 +303,7 @@ static GLboolean createWindow(_GLFWwindow* window, // This is the butcher's way of removing window decorations // Setting the override-redirect attribute on a window makes the window // manager ignore the window completely (ICCCM, section 4) - // The good thing is that this makes undecorated fullscreen windows + // The good thing is that this makes undecorated full screen windows // easy to do; the bad thing is that we have to do everything manually // and some things (like iconify/restore) won't work at all, as those // are tasks usually performed by the window manager @@ -543,7 +543,7 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request) if (request->property == None) { - // The requestor is a legacy client (ICCCM section 2.2) + // The requester is a legacy client (ICCCM section 2.2) // We don't support legacy clients, so fail here return None; } @@ -731,7 +731,7 @@ static void pushSelectionToManager(_GLFWwindow* window) } } -// Enter fullscreen mode +// Enter full screen mode // static void enterFullscreenMode(_GLFWwindow* window) { @@ -812,8 +812,8 @@ static void enterFullscreenMode(_GLFWwindow* window) &event); } - // Ask the window manager to make the GLFW window a fullscreen window - // Fullscreen windows are undecorated and, when focused, are kept + // Ask the window manager to make the GLFW window a full screen window + // Full screen windows are undecorated and, when focused, are kept // on top of all other windows changeWindowState(window, @@ -839,7 +839,7 @@ static void enterFullscreenMode(_GLFWwindow* window) } } -// Leave fullscreen mode +// Leave full screen mode // static void leaveFullscreenMode(_GLFWwindow* window) { @@ -950,7 +950,7 @@ static void processEvent(XEvent *event) { // HACK: Key repeat events will arrive as KeyRelease/KeyPress // pairs with similar or identical time stamps - // The key repeat logic in _glfwInputKey expectes only key + // The key repeat logic in _glfwInputKey expects only key // presses to repeat, so detect and discard release events if (XEventsQueued(_glfw.x11.display, QueuedAfterReading)) { |