Merge branch 'master' into multi-monitor

Conflicts:
	CMakeLists.txt
	readme.html
	src/CMakeLists.txt
	src/cocoa_platform.h
	src/win32_platform.h
	src/x11_platform.h
	tests/events.c
This commit is contained in:
Camilla Berglund
2012-12-02 20:52:03 +01:00
32 changed files with 1911 additions and 261 deletions

View File

@@ -188,6 +188,10 @@ extern "C" {
#else
#if defined(GLFW_INCLUDE_GLCOREARB)
#include <GL/glcorearb.h>
#elif defined(GLFW_INCLUDE_ES1)
#include <GLES/gl.h>
#elif defined(GLFW_INCLUDE_ES2)
#include <GLES2/gl2.h>
#else
#include <GL/gl.h>
#endif
@@ -509,6 +513,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.
*/
@@ -709,6 +717,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.
@@ -1005,7 +1023,7 @@ GLFWAPI void glfwGetVideoMode(GLFWmonitor monitor, 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);
@@ -1071,6 +1089,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.
@@ -1099,7 +1120,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.
@@ -1110,7 +1132,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
@@ -1343,11 +1367,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);
@@ -1356,6 +1390,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);
@@ -1364,6 +1406,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);
@@ -1372,6 +1421,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);
@@ -1380,6 +1431,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);
@@ -1478,7 +1531,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.
*/
@@ -1489,8 +1542,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);
@@ -1505,6 +1558,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);
@@ -1552,11 +1608,24 @@ GLFWAPI int glfwGetJoystickAxes(int joy, float* axes, int numaxes);
*/
GLFWAPI int glfwGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
/*! @brief Returns the name of the specified joystick.
* @param[in] joy The joystick to query.
* @return The UTF-8 encoded name of the joystick, or @c NULL if the joystick
* is not present.
* @ingroup input
*
* @note The returned string is valid only until the next call to @ref
* glfwGetJoystickName.
*/
GLFWAPI const char* glfwGetJoystickName(int joy);
/*! @brief Sets the clipboard to the specified string.
* @param[in] window The window that will own the clipboard contents.
* @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);
@@ -1567,6 +1636,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.
*