diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index d37ee178..5ffa8ed3 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -522,6 +522,10 @@ extern "C" { /*! @brief The number of samples used for default framebuffer multisampling. */ #define GLFW_FSAA_SAMPLES 0x0002100E +/*! @brief @c GL_TRUE if the framebuffer should be sRGB capable, or @c GL_FALSE + * otherwise. + */ +#define GLFW_SRGB_CAPABLE 0x0002100F /*! @brief The @link clients client API @endlink to create a context for. */ @@ -710,6 +714,16 @@ typedef void* GLFWwindow; */ typedef void (* GLFWerrorfun)(int,const char*); +/*! @brief The function signature for window position callbacks. + * @param[in] window The window that the user moved. + * @param[in] x The new x-coordinate, in pixels, of the upper-left corner of + * the client area of the window. + * @param[in] y The new y-coordinate, in pixels, of the upper-left corner of + * the client area of the window. + * @ingroup window + */ +typedef void (* GLFWwindowposfun)(GLFWwindow,int,int); + /*! @brief The function signature for window resize callbacks. * @param[in] window The window that the user resized. * @param[in] width The new width, in pixels, of the window. @@ -948,7 +962,7 @@ GLFWAPI void glfwGetDesktopMode(GLFWvidmode* mode); /*! @brief Sets the system gamma ramp to one generated from the specified * exponent. - * @param[in] The desired exponent. + * @param[in] gamma The desired exponent. * @ingroup gamma */ GLFWAPI void glfwSetGamma(float gamma); @@ -1014,6 +1028,9 @@ GLFWAPI void glfwDefaultWindowHints(void); * The @ref GLFW_FSAA_SAMPLES hint specifies the desired number of samples to * use for multisampling. * + * The @ref GLFW_SRGB_CAPABLE hint specifies whether the framebuffer should be + * sRGB capable. + * * The @ref GLFW_CLIENT_API hint specifies which client API to create the * context for. Possible values are @ref GLFW_OPENGL_API and @ref * GLFW_OPENGL_ES_API. @@ -1042,7 +1059,8 @@ GLFWAPI void glfwDefaultWindowHints(void); * used by the OpenGL context. * * The @ref GLFW_RESIZABLE hint specifies whether the window will be resizable - * by the user. This hint is ignored for fullscreen windows. + * by the user. The window will still be resizable using the @ref + * glfwSetWindowSize function. This hint is ignored for fullscreen windows. * * The @ref GLFW_VISIBLE hint specifies whether the window will be initially * visible. This hint is ignored for fullscreen windows. @@ -1053,7 +1071,9 @@ GLFWAPI void glfwDefaultWindowHints(void); * Some window hints are hard constraints. These must match the available * capabilities @em exactly for window and context creation to succeed. Hints * that are not hard constraints are matched as closely as possible, but the - * resulting window and context may differ from what these hints requested. + * resulting window and context may differ from what these hints requested. To + * find out the actual properties of the created window and context, use the + * @ref glfwGetWindowParam function. * * The following window hints are hard constraints: * @arg @ref GLFW_STEREO @@ -1278,11 +1298,21 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow window, void* pointer); */ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow window); +/*! @brief Sets the position callback for the specified window. + * @param[in] window The window whose callback to set. + * @param[in] cbfun The new callback, or @c NULL to remove the currently set + * callback. + * @ingroup window + */ +GLFWAPI void glfwSetWindowPosCallback(GLFWwindow window, GLFWwindowposfun cbfun); + /*! @brief Sets the size callback for the specified window. * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or @c NULL to remove the currently set * callback. * @ingroup window + * + * This callback is called when the window is resized. */ GLFWAPI void glfwSetWindowSizeCallback(GLFWwindow window, GLFWwindowsizefun cbfun); @@ -1291,6 +1321,14 @@ GLFWAPI void glfwSetWindowSizeCallback(GLFWwindow window, GLFWwindowsizefun cbfu * @param[in] cbfun The new callback, or @c NULL to remove the currently set * callback. * @ingroup window + * + * This callback is called when the user attempts to close the window, i.e. + * clicks the window's close widget or, on Mac OS X, selects @b Quit from the + * application menu. Calling @ref glfwDestroyWindow does not cause this + * callback to be called. + * + * The return value of the close callback becomes the new value of the @ref + * GLFW_CLOSE_REQUESTED window parameter. */ GLFWAPI void glfwSetWindowCloseCallback(GLFWwindow window, GLFWwindowclosefun cbfun); @@ -1299,6 +1337,13 @@ GLFWAPI void glfwSetWindowCloseCallback(GLFWwindow window, GLFWwindowclosefun cb * @param[in] cbfun The new callback, or @c NULL to remove the currently set * callback. * @ingroup window + * + * This callback is called when the client area of the window needs to be + * redrawn, for example if the window has been exposed after having been + * covered by another window. + * + * @note On compositing window systems such as Mac OS X, where the window + * contents are saved off-screen, this callback may never be called. */ GLFWAPI void glfwSetWindowRefreshCallback(GLFWwindow window, GLFWwindowrefreshfun cbfun); @@ -1307,6 +1352,8 @@ GLFWAPI void glfwSetWindowRefreshCallback(GLFWwindow window, GLFWwindowrefreshfu * @param[in] cbfun The new callback, or @c NULL to remove the currently set * callback. * @ingroup window + * + * This callback is called when the window gains or loses focus. */ GLFWAPI void glfwSetWindowFocusCallback(GLFWwindow window, GLFWwindowfocusfun cbfun); @@ -1315,6 +1362,8 @@ GLFWAPI void glfwSetWindowFocusCallback(GLFWwindow window, GLFWwindowfocusfun cb * @param[in] cbfun The new callback, or @c NULL to remove the currently set * callback. * @ingroup window + * + * This callback is called when the window is iconified or restored. */ GLFWAPI void glfwSetWindowIconifyCallback(GLFWwindow window, GLFWwindowiconifyfun cbfun); @@ -1413,7 +1462,7 @@ GLFWAPI void glfwGetScrollOffset(GLFWwindow window, double* xoffset, double* yof * set callback. * @ingroup input * - * @note The key callback deals with physical keys, with @link keys tokens + * @remarks The key callback deals with physical keys, with @link keys tokens * @endlink named after their use on the standard US keyboard layout. If you * want to input text, use the Unicode character callback instead. */ @@ -1424,8 +1473,8 @@ GLFWAPI void glfwSetKeyCallback(GLFWwindow window, GLFWkeyfun cbfun); * the currently set callback. * @ingroup input * - * @note The Unicode character callback is for text input. If you want to know - * whether a specific key was pressed or released, use the key callback. + * @remarks The Unicode character callback is for text input. If you want to + * know whether a specific key was pressed or released, use the key callback. */ GLFWAPI void glfwSetCharCallback(GLFWwindow window, GLFWcharfun cbfun); @@ -1440,6 +1489,9 @@ GLFWAPI void glfwSetMouseButtonCallback(GLFWwindow window, GLFWmousebuttonfun cb * @param[in] cbfun The new cursor position callback, or @c NULL to remove the * currently set callback. * @ingroup input + * + * @remarks The position is relative to the upper-left corner of the client + * area of the window. */ GLFWAPI void glfwSetCursorPosCallback(GLFWwindow window, GLFWcursorposfun cbfun); @@ -1492,6 +1544,8 @@ GLFWAPI int glfwGetJoystickButtons(int joy, unsigned char* buttons, int numbutto * @param[in] string A UTF-8 encoded string. * @ingroup clipboard * + * @note This function may only be called from the main thread. + * * @sa glfwGetClipboardString */ GLFWAPI void glfwSetClipboardString(GLFWwindow window, const char* string); @@ -1502,6 +1556,8 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow window, const char* string); * if that format was unavailable. * @ingroup clipboard * + * @note This function may only be called from the main thread. + * * @note The returned string is valid only until the next call to @ref * glfwGetClipboardString or @ref glfwSetClipboardString. * diff --git a/readme.html b/readme.html index 5f299f98..25198815 100644 --- a/readme.html +++ b/readme.html @@ -274,17 +274,19 @@ version of GLFW.
glfwSetErrorCallback
function and GLFWerrorfun
type for receiving more specific and/or nested errorsglfwSetWindowUserPointer
and glfwGetWindowUserPointer
functions for per-window user pointersglfwGetVersionString
function for determining which code paths were enabled at compile timeglfwGetWindowPos
function for querying the position of the specified windowglfwSetWindowPosCallback
function and GLFWwindowposfun
type for reciving window position eventsglfwSetWindowFocusCallback
function and GLFWwindowfocusfun
type for receiving window focus eventsglfwSetWindowIconifyCallback
function and GLFWwindowiconifyfun
type for receiving window iconification eventsglfwGetClipboardString
and glfwSetClipboardString
functions for interacting with the system clipboardglfwGetCurrentContext
function for retrieving the window whose OpenGL context is currentGLFW_CLIENT_API
window hint for creating contexts for APIs other than desktop OpenGLGLFW_SRGB_CAPABLE
for requesting sRGB capable framebuffersGLFW_CLIENT_API
, GLFW_OPENGL_API
and GLFW_OPENGL_ES_API
for selecting client APIGLFW_OPENGL_ROBUSTNESS
window hint and associated strategy tokens for GL_ARB_robustness
supportGLFW_OPENGL_REVISION
window parameter to make up for removal of glfwGetGLVersion
GLFW_INCLUDE_GLCOREARB
macro for including glcorearb.h
instead of gl.h
GLFW_INCLUDE_ES2
macro for telling the GLFW header to include the OpenGL ES 2.0 header instead of gl.h
GLFW_VISIBLE
window hint and parameter for controlling and polling window visibilityGLFW_POSITION_X
and GLFW_POSITION_Y
window hints and parameter for controlling and polling window positionwindows
simple multi-window test programsharing
simple OpenGL object sharing test programmodes
video mode enumeration and setting test program