Confined remaining functions to main thread.

This commit is contained in:
Camilla Berglund 2014-03-24 11:58:35 +01:00
parent a9c7377e0a
commit 0e20577af4

View File

@ -1001,6 +1001,8 @@ GLFWAPI const char* glfwGetVersionString(void);
* *
* @remarks This function may be called before @ref glfwInit. * @remarks This function may be called before @ref glfwInit.
* *
* @note This function may only be called from the main thread.
*
* @note The error callback is called by the thread where the error was * @note The error callback is called by the thread where the error was
* generated. If you are using GLFW from multiple threads, your error callback * generated. If you are using GLFW from multiple threads, your error callback
* needs to be written accordingly. * needs to be written accordingly.
@ -1023,6 +1025,8 @@ GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);
* set to zero if an error occurred. * set to zero if an error occurred.
* @return An array of monitor handles, or `NULL` if an error occurred. * @return An array of monitor handles, or `NULL` if an error occurred.
* *
* @note This function may only be called from the main thread.
*
* @note The returned array is allocated and freed by GLFW. You should not * @note The returned array is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -1043,6 +1047,8 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count);
* *
* @return The primary monitor, or `NULL` if an error occurred. * @return The primary monitor, or `NULL` if an error occurred.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwGetMonitors * @sa glfwGetMonitors
* *
* @ingroup monitor * @ingroup monitor
@ -1058,6 +1064,8 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
* @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
* @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
* *
* @note This function may only be called from the main thread.
*
* @ingroup monitor * @ingroup monitor
*/ */
GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
@ -1073,6 +1081,8 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
* @param[out] height Where to store the height, in mm, of the monitor's * @param[out] height Where to store the height, in mm, of the monitor's
* display area, or `NULL`. * display area, or `NULL`.
* *
* @note This function may only be called from the main thread.
*
* @note Some operating systems do not provide accurate information, either * @note Some operating systems do not provide accurate information, either
* because the monitor's EDID data is incorrect, or because the driver does not * because the monitor's EDID data is incorrect, or because the driver does not
* report it accurately. * report it accurately.
@ -1090,6 +1100,8 @@ GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* h
* @return The UTF-8 encoded name of the monitor, or `NULL` if an error * @return The UTF-8 encoded name of the monitor, or `NULL` if an error
* occurred. * occurred.
* *
* @note This function may only be called from the main thread.
*
* @note The returned string is allocated and freed by GLFW. You should not * @note The returned string is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -1108,6 +1120,8 @@ GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @bug **X11:** This callback is not yet called on monitor configuration * @bug **X11:** This callback is not yet called on monitor configuration
* changes. * changes.
* *
@ -1127,6 +1141,8 @@ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
* array. This is set to zero if an error occurred. * array. This is set to zero if an error occurred.
* @return An array of video modes, or `NULL` if an error occurred. * @return An array of video modes, or `NULL` if an error occurred.
* *
* @note This function may only be called from the main thread.
*
* @note The returned array is allocated and freed by GLFW. You should not * @note The returned array is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -1148,6 +1164,8 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);
* @param[in] monitor The monitor to query. * @param[in] monitor The monitor to query.
* @return The current mode of the monitor, or `NULL` if an error occurred. * @return The current mode of the monitor, or `NULL` if an error occurred.
* *
* @note This function may only be called from the main thread.
*
* @note The returned struct is allocated and freed by GLFW. You should not * @note The returned struct is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -1165,6 +1183,8 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
* @param[in] monitor The monitor whose gamma ramp to set. * @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] gamma The desired exponent. * @param[in] gamma The desired exponent.
* *
* @note This function may only be called from the main thread.
*
* @ingroup monitor * @ingroup monitor
*/ */
GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
@ -1176,6 +1196,8 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
* @param[in] monitor The monitor to query. * @param[in] monitor The monitor to query.
* @return The current gamma ramp, or `NULL` if an error occurred. * @return The current gamma ramp, or `NULL` if an error occurred.
* *
* @note This function may only be called from the main thread.
*
* @note The value arrays of the returned ramp are allocated and freed by GLFW. * @note The value arrays of the returned ramp are allocated and freed by GLFW.
* You should not free them yourself. * You should not free them yourself.
* *
@ -1190,6 +1212,8 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
* @param[in] monitor The monitor whose gamma ramp to set. * @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] ramp The gamma ramp to use. * @param[in] ramp The gamma ramp to use.
* *
* @note This function may only be called from the main thread.
*
* @note Gamma ramp sizes other than 256 are not supported by all hardware. * @note Gamma ramp sizes other than 256 are not supported by all hardware.
* *
* @ingroup monitor * @ingroup monitor
@ -1374,6 +1398,8 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
* @param[out] ypos Where to store the y-coordinate of the upper-left corner of * @param[out] ypos Where to store the y-coordinate of the upper-left corner of
* the client area, or `NULL`. * the client area, or `NULL`.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwSetWindowPos * @sa glfwSetWindowPos
* *
* @ingroup window * @ingroup window
@ -1420,6 +1446,8 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
* @param[out] height Where to store the height, in screen coordinates, of the * @param[out] height Where to store the height, in screen coordinates, of the
* client area, or `NULL`. * client area, or `NULL`.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwSetWindowSize * @sa glfwSetWindowSize
* *
* @ingroup window * @ingroup window
@ -1462,6 +1490,8 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);
* @param[out] height Where to store the height, in pixels, of the framebuffer, * @param[out] height Where to store the height, in pixels, of the framebuffer,
* or `NULL`. * or `NULL`.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwSetFramebufferSizeCallback * @sa glfwSetFramebufferSizeCallback
* *
* @ingroup window * @ingroup window
@ -1542,6 +1572,8 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window);
* @param[in] window The window to query. * @param[in] window The window to query.
* @return The monitor, or `NULL` if the window is in windowed mode. * @return The monitor, or `NULL` if the window is in windowed mode.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
@ -1556,6 +1588,8 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
* return. * return.
* @return The value of the attribute, or zero if an error occurred. * @return The value of the attribute, or zero if an error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
@ -1569,6 +1603,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
* @param[in] window The window whose pointer to set. * @param[in] window The window whose pointer to set.
* @param[in] pointer The new value. * @param[in] pointer The new value.
* *
* @remarks This function may be called from any thread.
*
* @sa glfwGetWindowUserPointer * @sa glfwGetWindowUserPointer
* *
* @ingroup window * @ingroup window
@ -1582,6 +1618,8 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);
* *
* @param[in] window The window whose pointer to return. * @param[in] window The window whose pointer to return.
* *
* @remarks This function may be called from any thread.
*
* @sa glfwSetWindowUserPointer * @sa glfwSetWindowUserPointer
* *
* @ingroup window * @ingroup window
@ -1600,6 +1638,8 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun); GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
@ -1616,6 +1656,8 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
@ -1643,6 +1685,8 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind
* @remarks **OS X:** Selecting Quit from the application menu will * @remarks **OS X:** Selecting Quit from the application menu will
* trigger the close callback for all windows. * trigger the close callback for all windows.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
@ -1663,6 +1707,8 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @note On compositing window systems such as Aero, Compiz or Aqua, where the * @note On compositing window systems such as Aero, Compiz or Aqua, where the
* window contents are saved off-screen, this callback may be called only very * window contents are saved off-screen, this callback may be called only very
* infrequently or never at all. * infrequently or never at all.
@ -1687,6 +1733,8 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun); GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
@ -1702,6 +1750,8 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun); GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
@ -1717,6 +1767,8 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup window * @ingroup window
*/ */
GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun); GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
@ -1812,6 +1864,8 @@ GLFWAPI void glfwPostEmptyEvent(void);
* @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
* `GLFW_STICKY_MOUSE_BUTTONS`. * `GLFW_STICKY_MOUSE_BUTTONS`.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwSetInputMode * @sa glfwSetInputMode
* *
* @ingroup input * @ingroup input
@ -1850,6 +1904,8 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
* you are only interested in whether mouse buttons have been pressed but not * you are only interested in whether mouse buttons have been pressed but not
* when or in which order. * when or in which order.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwGetInputMode * @sa glfwGetInputMode
* *
* @ingroup input * @ingroup input
@ -1876,6 +1932,8 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
* @param[in] key The desired [keyboard key](@ref keys). * @param[in] key The desired [keyboard key](@ref keys).
* @return One of `GLFW_PRESS` or `GLFW_RELEASE`. * @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
* *
* @note This function may only be called from the main thread.
*
* @note `GLFW_KEY_UNKNOWN` is not a valid key for this function. * @note `GLFW_KEY_UNKNOWN` is not a valid key for this function.
* *
* @ingroup input * @ingroup input
@ -1896,6 +1954,8 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
* @param[in] button The desired [mouse button](@ref buttons). * @param[in] button The desired [mouse button](@ref buttons).
* @return One of `GLFW_PRESS` or `GLFW_RELEASE`. * @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
@ -1921,6 +1981,8 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
* @param[out] ypos Where to store the cursor y-coordinate, relative to the to * @param[out] ypos Where to store the cursor y-coordinate, relative to the to
* top edge of the client area, or `NULL`. * top edge of the client area, or `NULL`.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwSetCursorPos * @sa glfwSetCursorPos
* *
* @ingroup input * @ingroup input
@ -1945,6 +2007,8 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
* @param[in] ypos The desired y-coordinate, relative to the top edge of the * @param[in] ypos The desired y-coordinate, relative to the top edge of the
* client area. * client area.
* *
* @note This function may only be called from the main thread.
*
* @sa glfwGetCursorPos * @sa glfwGetCursorPos
* *
* @ingroup input * @ingroup input
@ -1987,6 +2051,8 @@ GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor);
* @param[in] cursor The cursor to change to, or `NULL` to switch back to the * @param[in] cursor The cursor to change to, or `NULL` to switch back to the
* default system cursor. * default system cursor.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
@ -2021,6 +2087,8 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
@ -2040,6 +2108,8 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
@ -2061,6 +2131,8 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun); GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
@ -2078,6 +2150,8 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun); GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
@ -2094,6 +2168,8 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun); GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
@ -2113,6 +2189,8 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
@ -2129,6 +2207,8 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb
* @return The previously set callback, or `NULL` if no callback was set or an * @return The previously set callback, or `NULL` if no callback was set or an
* error occurred. * error occurred.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
@ -2140,6 +2220,8 @@ GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
* @param[in] joy The joystick to query. * @param[in] joy The joystick to query.
* @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise. * @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise.
* *
* @note This function may only be called from the main thread.
*
* @ingroup input * @ingroup input
*/ */
GLFWAPI int glfwJoystickPresent(int joy); GLFWAPI int glfwJoystickPresent(int joy);
@ -2153,6 +2235,8 @@ GLFWAPI int glfwJoystickPresent(int joy);
* set to zero if an error occurred. * set to zero if an error occurred.
* @return An array of axis values, or `NULL` if the joystick is not present. * @return An array of axis values, or `NULL` if the joystick is not present.
* *
* @note This function may only be called from the main thread.
*
* @note The returned array is allocated and freed by GLFW. You should not * @note The returned array is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -2172,6 +2256,8 @@ GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count);
* set to zero if an error occurred. * set to zero if an error occurred.
* @return An array of button states, or `NULL` if the joystick is not present. * @return An array of button states, or `NULL` if the joystick is not present.
* *
* @note This function may only be called from the main thread.
*
* @note The returned array is allocated and freed by GLFW. You should not * @note The returned array is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -2190,6 +2276,8 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count);
* @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
* is not present. * is not present.
* *
* @note This function may only be called from the main thread.
*
* @note The returned string is allocated and freed by GLFW. You should not * @note The returned string is allocated and freed by GLFW. You should not
* free it yourself. * free it yourself.
* *
@ -2265,6 +2353,8 @@ GLFWAPI double glfwGetTime(void);
* *
* @param[in] time The new value, in seconds. * @param[in] time The new value, in seconds.
* *
* @note This function may only be called from the main thread.
*
* @note The resolution of the timer is system dependent, but is usually on the * @note 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 * order of a few micro- or nanoseconds. It uses the highest-resolution
* monotonic time source on each supported platform. * monotonic time source on each supported platform.
@ -2315,12 +2405,12 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
* *
* @param[in] window The window whose buffers to swap. * @param[in] window The window whose buffers to swap.
* *
* @remarks This function may be called from any thread.
*
* @par New in GLFW 3 * @par New in GLFW 3
* This function no longer calls @ref glfwPollEvents. You need to call it or * This function no longer calls @ref glfwPollEvents. You need to call it or
* @ref glfwWaitEvents yourself. * @ref glfwWaitEvents yourself.
* *
* @remarks This function may be called from any thread.
*
* @sa glfwSwapInterval * @sa glfwSwapInterval
* *
* @ingroup context * @ingroup context