2010-09-07 17:34:51 +02:00
|
|
|
//========================================================================
|
2015-06-01 22:55:06 +02:00
|
|
|
// GLFW 3.2 - www.glfw.org
|
2010-09-07 17:34:51 +02:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2002-2006 Marcus Geelnard
|
|
|
|
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
|
|
|
//
|
|
|
|
// This software is provided 'as-is', without any express or implied
|
|
|
|
// warranty. In no event will the authors be held liable for any damages
|
|
|
|
// arising from the use of this software.
|
|
|
|
//
|
|
|
|
// Permission is granted to anyone to use this software for any purpose,
|
|
|
|
// including commercial applications, and to alter it and redistribute it
|
|
|
|
// freely, subject to the following restrictions:
|
|
|
|
//
|
|
|
|
// 1. The origin of this software must not be misrepresented; you must not
|
|
|
|
// claim that you wrote the original software. If you use this software
|
|
|
|
// in a product, an acknowledgment in the product documentation would
|
|
|
|
// be appreciated but is not required.
|
|
|
|
//
|
|
|
|
// 2. Altered source versions must be plainly marked as such, and must not
|
|
|
|
// be misrepresented as being the original software.
|
|
|
|
//
|
|
|
|
// 3. This notice may not be removed or altered from any source
|
|
|
|
// distribution.
|
|
|
|
//
|
|
|
|
//========================================================================
|
|
|
|
|
2015-06-07 19:32:24 +02:00
|
|
|
#ifndef _glfw3_internal_h_
|
|
|
|
#define _glfw3_internal_h_
|
2010-09-07 17:34:51 +02:00
|
|
|
|
|
|
|
|
2013-11-20 11:49:44 +01:00
|
|
|
#if defined(_GLFW_USE_CONFIG_H)
|
|
|
|
#include "glfw_config.h"
|
|
|
|
#endif
|
2013-01-15 22:43:44 +01:00
|
|
|
|
2015-06-01 22:55:06 +02:00
|
|
|
#define _GLFW_VERSION_NUMBER "3.2.0"
|
2013-11-20 13:58:57 +01:00
|
|
|
|
2015-03-17 16:33:21 +01:00
|
|
|
#if defined(GLFW_INCLUDE_GLCOREARB) || \
|
|
|
|
defined(GLFW_INCLUDE_ES1) || \
|
|
|
|
defined(GLFW_INCLUDE_ES2) || \
|
|
|
|
defined(GLFW_INCLUDE_ES3) || \
|
|
|
|
defined(GLFW_INCLUDE_NONE) || \
|
|
|
|
defined(GLFW_INCLUDE_GLEXT) || \
|
|
|
|
defined(GLFW_INCLUDE_GLU) || \
|
|
|
|
defined(GLFW_DLL)
|
|
|
|
#error "You may not define any header option macros when compiling GLFW"
|
|
|
|
#endif
|
|
|
|
|
2015-08-24 01:27:20 +02:00
|
|
|
#define GLFW_INCLUDE_NONE
|
2013-05-22 22:46:34 +02:00
|
|
|
#include "../include/GLFW/glfw3.h"
|
2013-01-15 22:43:44 +01:00
|
|
|
|
2015-08-24 01:27:20 +02:00
|
|
|
#define GL_VERSION 0x1f02
|
|
|
|
#define GL_NONE 0
|
|
|
|
#define GL_COLOR_BUFFER_BIT 0x00004000
|
|
|
|
#define GL_EXTENSIONS 0x1f03
|
|
|
|
#define GL_NUM_EXTENSIONS 0x821d
|
|
|
|
#define GL_CONTEXT_FLAGS 0x821e
|
|
|
|
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
|
|
|
|
#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
|
|
|
|
#define GL_CONTEXT_PROFILE_MASK 0x9126
|
|
|
|
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
|
|
|
|
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
|
|
|
|
#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
|
|
|
#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
|
|
|
#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
|
|
|
|
#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb
|
|
|
|
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc
|
2015-08-10 12:46:14 +02:00
|
|
|
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
|
2015-08-24 01:27:20 +02:00
|
|
|
|
|
|
|
typedef int GLint;
|
|
|
|
typedef unsigned int GLuint;
|
|
|
|
typedef unsigned int GLenum;
|
|
|
|
typedef unsigned int GLbitfield;
|
|
|
|
typedef unsigned char GLubyte;
|
2013-01-15 22:43:44 +01:00
|
|
|
|
2015-08-12 00:59:26 +02:00
|
|
|
typedef void (APIENTRY * PFNGLCLEARPROC)(GLbitfield);
|
|
|
|
typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum);
|
|
|
|
typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*);
|
2015-08-24 01:27:20 +02:00
|
|
|
typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
|
2015-08-12 00:59:26 +02:00
|
|
|
|
2013-01-15 22:43:44 +01:00
|
|
|
typedef struct _GLFWwndconfig _GLFWwndconfig;
|
2014-03-06 20:05:32 +01:00
|
|
|
typedef struct _GLFWctxconfig _GLFWctxconfig;
|
2013-01-15 22:43:44 +01:00
|
|
|
typedef struct _GLFWfbconfig _GLFWfbconfig;
|
|
|
|
typedef struct _GLFWwindow _GLFWwindow;
|
|
|
|
typedef struct _GLFWlibrary _GLFWlibrary;
|
|
|
|
typedef struct _GLFWmonitor _GLFWmonitor;
|
2013-12-04 14:19:22 +01:00
|
|
|
typedef struct _GLFWcursor _GLFWcursor;
|
2013-01-15 22:43:44 +01:00
|
|
|
|
2015-08-23 19:30:04 +02:00
|
|
|
typedef int GLFWbool;
|
|
|
|
|
2013-01-15 22:43:44 +01:00
|
|
|
#if defined(_GLFW_COCOA)
|
|
|
|
#include "cocoa_platform.h"
|
|
|
|
#elif defined(_GLFW_WIN32)
|
|
|
|
#include "win32_platform.h"
|
|
|
|
#elif defined(_GLFW_X11)
|
|
|
|
#include "x11_platform.h"
|
2014-03-17 22:53:43 +01:00
|
|
|
#elif defined(_GLFW_WAYLAND)
|
2014-04-08 17:20:42 +02:00
|
|
|
#include "wl_platform.h"
|
2014-11-06 09:15:37 +01:00
|
|
|
#elif defined(_GLFW_MIR)
|
|
|
|
#include "mir_platform.h"
|
2013-01-15 22:43:44 +01:00
|
|
|
#else
|
|
|
|
#error "No supported window creation API selected"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
//========================================================================
|
|
|
|
// Doxygen group definitions
|
|
|
|
//========================================================================
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @defgroup platform Platform interface
|
|
|
|
* @brief The interface implemented by the platform-specific code.
|
2013-01-02 02:21:38 +01:00
|
|
|
*
|
|
|
|
* The platform API is the interface exposed by the platform-specific code for
|
|
|
|
* each platform and is called by the shared code of the public API It mirrors
|
|
|
|
* the public API except it uses objects instead of handles.
|
|
|
|
*/
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @defgroup event Event interface
|
|
|
|
* @brief The interface used by the platform-specific code to report events.
|
2013-01-02 02:21:38 +01:00
|
|
|
*
|
|
|
|
* The event API is used by the platform-specific code to notify the shared
|
|
|
|
* code of events that can be translated into state changes and/or callback
|
|
|
|
* calls.
|
|
|
|
*/
|
|
|
|
/*! @defgroup utility Utility functions
|
2013-02-14 13:14:17 +01:00
|
|
|
* @brief Various utility functions for internal use.
|
2013-01-02 02:21:38 +01:00
|
|
|
*
|
|
|
|
* These functions are shared code and may be used by any part of GLFW
|
|
|
|
* Each platform may add its own utility functions, but those may only be
|
|
|
|
* called by the platform-specific code
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-09-07 17:34:51 +02:00
|
|
|
//========================================================================
|
2013-01-15 22:43:44 +01:00
|
|
|
// Helper macros
|
2010-09-07 17:34:51 +02:00
|
|
|
//========================================================================
|
|
|
|
|
2015-01-05 21:55:15 +01:00
|
|
|
// Checks for whether the library has been initialized
|
2013-02-20 00:28:08 +01:00
|
|
|
#define _GLFW_REQUIRE_INIT() \
|
|
|
|
if (!_glfwInitialized) \
|
|
|
|
{ \
|
|
|
|
_glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
#define _GLFW_REQUIRE_INIT_OR_RETURN(x) \
|
|
|
|
if (!_glfwInitialized) \
|
|
|
|
{ \
|
|
|
|
_glfwInputError(GLFW_NOT_INITIALIZED, NULL); \
|
|
|
|
return x; \
|
|
|
|
}
|
|
|
|
|
2013-07-30 14:43:01 +02:00
|
|
|
// Swaps the provided pointers
|
|
|
|
#define _GLFW_SWAP_POINTERS(x, y) \
|
|
|
|
{ \
|
|
|
|
void* t; \
|
|
|
|
t = x; \
|
|
|
|
x = y; \
|
|
|
|
y = t; \
|
|
|
|
}
|
|
|
|
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2012-04-22 21:49:38 +02:00
|
|
|
//========================================================================
|
2014-09-02 19:42:43 +02:00
|
|
|
// Platform-independent structures
|
2013-01-02 02:21:38 +01:00
|
|
|
//========================================================================
|
|
|
|
|
2014-03-06 20:05:32 +01:00
|
|
|
/*! @brief Window configuration.
|
2013-01-02 02:21:38 +01:00
|
|
|
*
|
2014-03-06 20:05:32 +01:00
|
|
|
* Parameters relating to the creation of the window but not directly related
|
2014-05-21 11:19:38 +02:00
|
|
|
* to the framebuffer. This is used to pass window creation parameters from
|
2014-03-06 20:05:32 +01:00
|
|
|
* shared code to the platform API.
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-10-04 18:17:53 +02:00
|
|
|
struct _GLFWwndconfig
|
2010-09-09 20:18:10 +02:00
|
|
|
{
|
2012-11-25 14:53:33 +01:00
|
|
|
int width;
|
|
|
|
int height;
|
2010-10-04 18:17:53 +02:00
|
|
|
const char* title;
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool resizable;
|
|
|
|
GLFWbool visible;
|
|
|
|
GLFWbool decorated;
|
|
|
|
GLFWbool focused;
|
|
|
|
GLFWbool autoIconify;
|
|
|
|
GLFWbool floating;
|
2012-09-27 21:37:36 +02:00
|
|
|
_GLFWmonitor* monitor;
|
2014-03-06 20:05:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*! @brief Context configuration.
|
|
|
|
*
|
|
|
|
* Parameters relating to the creation of the context but not directly related
|
|
|
|
* to the framebuffer. This is used to pass context creation parameters from
|
|
|
|
* shared code to the platform API.
|
|
|
|
*/
|
|
|
|
struct _GLFWctxconfig
|
|
|
|
{
|
|
|
|
int api;
|
|
|
|
int major;
|
|
|
|
int minor;
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool forward;
|
|
|
|
GLFWbool debug;
|
2015-08-10 12:46:14 +02:00
|
|
|
GLFWbool noerror;
|
2014-03-06 20:05:32 +01:00
|
|
|
int profile;
|
|
|
|
int robustness;
|
2014-08-21 19:21:45 +02:00
|
|
|
int release;
|
2010-10-04 18:17:53 +02:00
|
|
|
_GLFWwindow* share;
|
|
|
|
};
|
2010-09-07 17:34:51 +02:00
|
|
|
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Framebuffer configuration.
|
|
|
|
*
|
2013-05-13 15:49:59 +02:00
|
|
|
* This describes buffers and their sizes. It also contains
|
2015-01-05 21:55:15 +01:00
|
|
|
* a platform-specific ID used to map back to the backend API object.
|
2013-05-13 15:49:59 +02:00
|
|
|
*
|
|
|
|
* It is used to pass framebuffer parameters from shared code to the platform
|
|
|
|
* API and also to enumerate and select available framebuffer configs.
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-10-04 18:17:53 +02:00
|
|
|
struct _GLFWfbconfig
|
2010-09-09 20:18:10 +02:00
|
|
|
{
|
2010-09-07 17:34:51 +02:00
|
|
|
int redBits;
|
|
|
|
int greenBits;
|
|
|
|
int blueBits;
|
|
|
|
int alphaBits;
|
|
|
|
int depthBits;
|
|
|
|
int stencilBits;
|
|
|
|
int accumRedBits;
|
|
|
|
int accumGreenBits;
|
|
|
|
int accumBlueBits;
|
|
|
|
int accumAlphaBits;
|
|
|
|
int auxBuffers;
|
2014-04-08 18:57:43 +02:00
|
|
|
int stereo;
|
2010-09-07 17:34:51 +02:00
|
|
|
int samples;
|
2014-04-08 18:57:43 +02:00
|
|
|
int sRGB;
|
2014-04-24 19:21:10 +02:00
|
|
|
int doublebuffer;
|
2013-05-13 15:49:59 +02:00
|
|
|
|
2014-04-08 16:25:35 +02:00
|
|
|
// This is defined in the context API's context.h
|
2013-05-13 15:49:59 +02:00
|
|
|
_GLFW_PLATFORM_FBCONFIG;
|
2010-10-04 18:17:53 +02:00
|
|
|
};
|
2010-09-07 17:34:51 +02:00
|
|
|
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Window and context structure.
|
|
|
|
*/
|
2010-10-04 18:17:53 +02:00
|
|
|
struct _GLFWwindow
|
2010-09-09 20:18:10 +02:00
|
|
|
{
|
2010-09-10 00:06:23 +02:00
|
|
|
struct _GLFWwindow* next;
|
|
|
|
|
2010-09-09 20:18:10 +02:00
|
|
|
// Window settings and state
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool resizable;
|
|
|
|
GLFWbool decorated;
|
|
|
|
GLFWbool autoIconify;
|
|
|
|
GLFWbool floating;
|
|
|
|
GLFWbool closed;
|
2013-01-02 16:48:02 +01:00
|
|
|
void* userPointer;
|
2013-01-02 17:29:24 +01:00
|
|
|
GLFWvidmode videoMode;
|
2013-01-02 16:48:02 +01:00
|
|
|
_GLFWmonitor* monitor;
|
2013-12-04 14:19:22 +01:00
|
|
|
_GLFWcursor* cursor;
|
2010-09-09 18:15:32 +02:00
|
|
|
|
2010-09-09 20:18:10 +02:00
|
|
|
// Window input state
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool stickyKeys;
|
|
|
|
GLFWbool stickyMouseButtons;
|
2013-04-04 16:16:21 +02:00
|
|
|
double cursorPosX, cursorPosY;
|
2013-01-02 16:48:02 +01:00
|
|
|
int cursorMode;
|
2014-05-18 21:28:11 +02:00
|
|
|
char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1];
|
|
|
|
char keys[GLFW_KEY_LAST + 1];
|
2010-09-09 18:15:32 +02:00
|
|
|
|
|
|
|
// OpenGL extensions and context attributes
|
2014-03-06 20:05:32 +01:00
|
|
|
struct {
|
|
|
|
int api;
|
|
|
|
int major, minor, revision;
|
2015-08-10 12:46:14 +02:00
|
|
|
GLFWbool forward, debug, noerror;
|
2014-03-06 20:05:32 +01:00
|
|
|
int profile;
|
|
|
|
int robustness;
|
2014-08-21 19:21:45 +02:00
|
|
|
int release;
|
2014-03-06 20:05:32 +01:00
|
|
|
} context;
|
|
|
|
|
2010-09-09 18:15:32 +02:00
|
|
|
PFNGLGETSTRINGIPROC GetStringi;
|
2015-08-12 00:59:26 +02:00
|
|
|
PFNGLGETINTEGERVPROC GetIntegerv;
|
|
|
|
PFNGLGETSTRINGPROC GetString;
|
2010-09-09 18:15:32 +02:00
|
|
|
|
2013-01-15 21:34:26 +01:00
|
|
|
struct {
|
2013-06-03 12:51:57 +02:00
|
|
|
GLFWwindowposfun pos;
|
|
|
|
GLFWwindowsizefun size;
|
|
|
|
GLFWwindowclosefun close;
|
|
|
|
GLFWwindowrefreshfun refresh;
|
|
|
|
GLFWwindowfocusfun focus;
|
|
|
|
GLFWwindowiconifyfun iconify;
|
|
|
|
GLFWframebuffersizefun fbsize;
|
|
|
|
GLFWmousebuttonfun mouseButton;
|
|
|
|
GLFWcursorposfun cursorPos;
|
|
|
|
GLFWcursorenterfun cursorEnter;
|
|
|
|
GLFWscrollfun scroll;
|
|
|
|
GLFWkeyfun key;
|
|
|
|
GLFWcharfun character;
|
2014-06-12 23:04:20 +02:00
|
|
|
GLFWcharmodsfun charmods;
|
2013-07-10 11:42:14 +02:00
|
|
|
GLFWdropfun drop;
|
2013-01-15 21:34:26 +01:00
|
|
|
} callbacks;
|
2012-10-28 13:45:11 +01:00
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
// This is defined in the window API's platform.h
|
2010-09-09 18:15:32 +02:00
|
|
|
_GLFW_PLATFORM_WINDOW_STATE;
|
2014-04-08 16:25:35 +02:00
|
|
|
// This is defined in the context API's context.h
|
2010-09-09 20:36:23 +02:00
|
|
|
_GLFW_PLATFORM_CONTEXT_STATE;
|
2010-10-04 18:17:53 +02:00
|
|
|
};
|
2010-09-09 18:15:32 +02:00
|
|
|
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Monitor structure.
|
|
|
|
*/
|
2011-10-03 09:24:35 +02:00
|
|
|
struct _GLFWmonitor
|
2011-05-07 10:53:50 +02:00
|
|
|
{
|
2013-01-02 16:48:02 +01:00
|
|
|
char* name;
|
2012-09-13 17:46:40 +02:00
|
|
|
|
2013-01-02 16:48:02 +01:00
|
|
|
// Physical dimensions in millimeters.
|
|
|
|
int widthMM, heightMM;
|
2011-10-02 22:13:47 +02:00
|
|
|
|
2013-01-02 16:48:02 +01:00
|
|
|
GLFWvidmode* modes;
|
|
|
|
int modeCount;
|
2013-05-22 22:16:43 +02:00
|
|
|
GLFWvidmode currentMode;
|
2012-08-03 02:57:33 +02:00
|
|
|
|
2013-02-12 13:50:41 +01:00
|
|
|
GLFWgammaramp originalRamp;
|
2013-05-19 15:46:44 +02:00
|
|
|
GLFWgammaramp currentRamp;
|
2013-02-12 13:50:41 +01:00
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
// This is defined in the window API's platform.h
|
2011-10-03 09:24:35 +02:00
|
|
|
_GLFW_PLATFORM_MONITOR_STATE;
|
2011-05-07 10:53:50 +02:00
|
|
|
};
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-12-04 14:19:22 +01:00
|
|
|
/*! @brief Cursor structure
|
|
|
|
*/
|
|
|
|
struct _GLFWcursor
|
|
|
|
{
|
|
|
|
_GLFWcursor* next;
|
|
|
|
|
|
|
|
// This is defined in the window API's platform.h
|
|
|
|
_GLFW_PLATFORM_CURSOR_STATE;
|
|
|
|
};
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Library global data.
|
|
|
|
*/
|
2010-10-04 18:17:53 +02:00
|
|
|
struct _GLFWlibrary
|
2010-09-09 20:18:10 +02:00
|
|
|
{
|
2013-04-24 23:47:08 +02:00
|
|
|
struct {
|
2015-06-07 18:22:38 +02:00
|
|
|
_GLFWfbconfig framebuffer;
|
|
|
|
_GLFWwndconfig window;
|
|
|
|
_GLFWctxconfig context;
|
|
|
|
int refreshRate;
|
2013-04-24 23:47:08 +02:00
|
|
|
} hints;
|
2010-09-10 00:06:23 +02:00
|
|
|
|
2015-06-07 18:22:38 +02:00
|
|
|
double cursorPosX, cursorPosY;
|
2013-04-16 20:46:58 +02:00
|
|
|
|
2015-06-07 18:22:38 +02:00
|
|
|
_GLFWcursor* cursorListHead;
|
2013-12-04 14:19:22 +01:00
|
|
|
|
2015-06-07 18:22:38 +02:00
|
|
|
_GLFWwindow* windowListHead;
|
2015-06-17 11:59:39 +02:00
|
|
|
_GLFWwindow* cursorWindow;
|
2012-09-12 19:35:52 +02:00
|
|
|
|
2015-06-07 18:22:38 +02:00
|
|
|
_GLFWmonitor** monitors;
|
|
|
|
int monitorCount;
|
2013-07-30 17:06:06 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
GLFWmonitorfun monitor;
|
|
|
|
} callbacks;
|
2010-10-24 18:28:55 +02:00
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
// This is defined in the window API's platform.h
|
2012-04-22 15:53:02 +02:00
|
|
|
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
|
2014-04-08 16:25:35 +02:00
|
|
|
// This is defined in the context API's context.h
|
2014-04-08 16:29:38 +02:00
|
|
|
_GLFW_PLATFORM_LIBRARY_CONTEXT_STATE;
|
2014-03-27 17:19:22 +01:00
|
|
|
// This is defined in the platform's time.h
|
|
|
|
_GLFW_PLATFORM_LIBRARY_TIME_STATE;
|
2014-03-19 15:27:49 +01:00
|
|
|
// This is defined in the platform's joystick.h
|
|
|
|
_GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE;
|
2014-03-30 14:37:20 +02:00
|
|
|
// This is defined in the platform's tls.h
|
2014-04-08 17:35:05 +02:00
|
|
|
_GLFW_PLATFORM_LIBRARY_TLS_STATE;
|
2010-10-04 18:17:53 +02:00
|
|
|
};
|
2010-09-09 18:15:32 +02:00
|
|
|
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
//========================================================================
|
2012-08-26 20:11:32 +02:00
|
|
|
// Global state shared between compilation units of GLFW
|
2013-01-02 02:21:38 +01:00
|
|
|
//========================================================================
|
|
|
|
|
|
|
|
/*! @brief Flag indicating whether GLFW has been successfully initialized.
|
|
|
|
*/
|
2015-08-23 19:30:04 +02:00
|
|
|
extern GLFWbool _glfwInitialized;
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief All global data protected by @ref _glfwInitialized.
|
|
|
|
* This should only be touched after a call to @ref glfwInit that has not been
|
|
|
|
* followed by a call to @ref glfwTerminate.
|
|
|
|
*/
|
2013-01-02 01:40:42 +01:00
|
|
|
extern _GLFWlibrary _glfw;
|
2010-09-09 18:15:32 +02:00
|
|
|
|
2010-09-07 17:34:51 +02:00
|
|
|
|
|
|
|
//========================================================================
|
2013-01-02 02:21:38 +01:00
|
|
|
// Platform API functions
|
2010-09-07 17:34:51 +02:00
|
|
|
//========================================================================
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Initializes the platform-specific part of the library.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an error occurred.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2010-09-08 17:30:21 +02:00
|
|
|
int _glfwPlatformInit(void);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Terminates the platform-specific part of the library.
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2012-12-30 01:15:48 +01:00
|
|
|
void _glfwPlatformTerminate(void);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetVersionString
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*
|
|
|
|
* @note The returned string must be available for the duration of the program.
|
|
|
|
*
|
|
|
|
* @note The returned string must not change for the duration of the program.
|
|
|
|
*/
|
2010-09-13 18:05:59 +02:00
|
|
|
const char* _glfwPlatformGetVersionString(void);
|
2010-09-09 21:06:59 +02:00
|
|
|
|
2014-02-11 18:24:01 +01:00
|
|
|
/*! @copydoc glfwGetCursorPos
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetCursorPos
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2013-04-04 16:16:21 +02:00
|
|
|
void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2015-07-02 13:04:56 +02:00
|
|
|
/*! @brief Sets the specified cursor mode of the specified window.
|
|
|
|
* @param[in] window The window whose cursor mode to set.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2015-07-02 13:04:56 +02:00
|
|
|
void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetMonitors
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-09-12 19:35:52 +02:00
|
|
|
_GLFWmonitor** _glfwPlatformGetMonitors(int* count);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-04-22 14:43:13 +02:00
|
|
|
/*! @brief Checks whether two monitor objects represent the same monitor.
|
|
|
|
*
|
|
|
|
* @param[in] first The first monitor.
|
|
|
|
* @param[in] second The second monitor.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @return @c GLFW_TRUE if the monitor objects represent the same monitor, or
|
|
|
|
* @c GLFW_FALSE otherwise.
|
2013-04-22 14:43:13 +02:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second);
|
2013-04-22 14:43:13 +02:00
|
|
|
|
2013-02-20 16:00:53 +01:00
|
|
|
/*! @copydoc glfwGetMonitorPos
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetVideoModes
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-08-03 02:57:33 +02:00
|
|
|
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @ingroup platform
|
|
|
|
*/
|
2012-08-30 01:53:23 +02:00
|
|
|
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetGammaRamp
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2013-02-12 13:50:41 +01:00
|
|
|
void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetGammaRamp
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2013-02-12 13:50:41 +01:00
|
|
|
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);
|
2010-10-13 04:04:43 +02:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetClipboardString
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2012-04-09 16:00:54 +02:00
|
|
|
void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetClipboardString
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*
|
|
|
|
* @note The returned string must be valid until the next call to @ref
|
|
|
|
* _glfwPlatformGetClipboardString or @ref _glfwPlatformSetClipboardString.
|
|
|
|
*/
|
2012-04-12 00:51:58 +02:00
|
|
|
const char* _glfwPlatformGetClipboardString(_GLFWwindow* window);
|
2011-09-21 11:09:47 +02:00
|
|
|
|
2013-04-24 19:25:42 +02:00
|
|
|
/*! @copydoc glfwJoystickPresent
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2013-04-24 19:25:42 +02:00
|
|
|
int _glfwPlatformJoystickPresent(int joy);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetJoystickAxes
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2013-06-04 18:20:38 +02:00
|
|
|
const float* _glfwPlatformGetJoystickAxes(int joy, int* count);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetJoystickButtons
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2013-06-04 18:20:38 +02:00
|
|
|
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetJoystickName
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-09-07 01:01:34 +02:00
|
|
|
const char* _glfwPlatformGetJoystickName(int joy);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetTime
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2010-09-08 17:30:21 +02:00
|
|
|
double _glfwPlatformGetTime(void);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetTime
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2010-09-08 17:30:21 +02:00
|
|
|
void _glfwPlatformSetTime(double time);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @ingroup platform
|
|
|
|
*/
|
|
|
|
int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
|
|
|
const _GLFWwndconfig* wndconfig,
|
2014-03-06 20:05:32 +01:00
|
|
|
const _GLFWctxconfig* ctxconfig,
|
2013-01-02 02:21:38 +01:00
|
|
|
const _GLFWfbconfig* fbconfig);
|
|
|
|
|
|
|
|
/*! @ingroup platform
|
|
|
|
*/
|
2012-08-06 17:56:41 +02:00
|
|
|
void _glfwPlatformDestroyWindow(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetWindowTitle
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-09 18:15:32 +02:00
|
|
|
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetWindowPos
|
|
|
|
* @ingroup platform
|
2013-01-24 19:30:31 +01:00
|
|
|
*/
|
|
|
|
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetWindowPos
|
|
|
|
* @ingroup platform
|
2013-01-24 19:30:31 +01:00
|
|
|
*/
|
|
|
|
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetWindowSize
|
|
|
|
* @ingroup platform
|
2012-11-25 14:53:33 +01:00
|
|
|
*/
|
|
|
|
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSetWindowSize
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-09 18:15:32 +02:00
|
|
|
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2014-02-13 02:57:59 +01:00
|
|
|
/*! @copydoc glfwSetWindowSizeLimits
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
|
|
|
|
|
|
|
|
/*! @copydoc glfwSetWindowAspectRatio
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom);
|
|
|
|
|
2013-06-03 12:51:57 +02:00
|
|
|
/*! @copydoc glfwGetFramebufferSize
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height);
|
|
|
|
|
2014-03-25 21:30:13 +01:00
|
|
|
/*! @copydoc glfwGetWindowFrameSize
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* left, int* top, int* right, int* bottom);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwIconifyWindow
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-09 18:15:32 +02:00
|
|
|
void _glfwPlatformIconifyWindow(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwRestoreWindow
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-09 18:15:32 +02:00
|
|
|
void _glfwPlatformRestoreWindow(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwShowWindow
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-08-21 20:01:57 +02:00
|
|
|
void _glfwPlatformShowWindow(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2014-06-20 13:39:06 +02:00
|
|
|
/*! @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformUnhideWindow(_GLFWwindow* window);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwHideWindow
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-08-21 20:01:57 +02:00
|
|
|
void _glfwPlatformHideWindow(_GLFWwindow* window);
|
2010-09-09 18:15:32 +02:00
|
|
|
|
2014-12-26 12:25:48 +01:00
|
|
|
/*! @brief Returns whether the window is focused.
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
int _glfwPlatformWindowFocused(_GLFWwindow* window);
|
|
|
|
|
|
|
|
/*! @brief Returns whether the window is iconified.
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
int _glfwPlatformWindowIconified(_GLFWwindow* window);
|
|
|
|
|
|
|
|
/*! @brief Returns whether the window is visible.
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
int _glfwPlatformWindowVisible(_GLFWwindow* window);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwPollEvents
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-09 18:15:32 +02:00
|
|
|
void _glfwPlatformPollEvents(void);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwWaitEvents
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-09 18:15:32 +02:00
|
|
|
void _glfwPlatformWaitEvents(void);
|
|
|
|
|
2014-02-10 18:16:58 +01:00
|
|
|
/*! @copydoc glfwPostEmptyEvent
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
void _glfwPlatformPostEmptyEvent(void);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwMakeContextCurrent
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2011-07-27 16:01:27 +02:00
|
|
|
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetCurrentContext
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-08-12 14:13:18 +02:00
|
|
|
_GLFWwindow* _glfwPlatformGetCurrentContext(void);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSwapBuffers
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2012-08-06 18:13:37 +02:00
|
|
|
void _glfwPlatformSwapBuffers(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwSwapInterval
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2010-09-08 17:30:21 +02:00
|
|
|
void _glfwPlatformSwapInterval(int interval);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2014-04-23 13:30:11 +02:00
|
|
|
/*! @copydoc glfwExtensionSupported
|
|
|
|
* @ingroup platform
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
|
|
|
int _glfwPlatformExtensionSupported(const char* extension);
|
|
|
|
|
2013-02-14 13:14:17 +01:00
|
|
|
/*! @copydoc glfwGetProcAddress
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2012-06-05 00:16:40 +02:00
|
|
|
GLFWglproc _glfwPlatformGetProcAddress(const char* procname);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2014-04-23 13:30:11 +02:00
|
|
|
/*! @copydoc glfwCreateCursor
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2014-02-23 16:43:17 +01:00
|
|
|
int _glfwPlatformCreateCursor(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot);
|
2013-12-04 14:19:22 +01:00
|
|
|
|
2014-09-02 16:52:16 +02:00
|
|
|
/*! @copydoc glfwCreateStandardCursor
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
|
|
|
int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape);
|
|
|
|
|
2014-04-23 13:30:11 +02:00
|
|
|
/*! @copydoc glfwDestroyCursor
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2013-12-04 14:19:22 +01:00
|
|
|
void _glfwPlatformDestroyCursor(_GLFWcursor* cursor);
|
|
|
|
|
2014-04-23 13:30:11 +02:00
|
|
|
/*! @copydoc glfwSetCursor
|
|
|
|
* @ingroup platform
|
|
|
|
*/
|
2013-12-04 14:19:22 +01:00
|
|
|
void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2014-09-02 19:42:43 +02:00
|
|
|
|
2010-09-07 17:34:51 +02:00
|
|
|
//========================================================================
|
2013-01-02 02:21:38 +01:00
|
|
|
// Event API functions
|
2010-09-07 17:34:51 +02:00
|
|
|
//========================================================================
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Notifies shared code of a window focus event.
|
|
|
|
* @param[in] window The window that received the event.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @param[in] focused `GLFW_TRUE` if the window received focus, or `GLFW_FALSE`
|
2013-01-02 02:21:38 +01:00
|
|
|
* if it lost focus.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-08-23 19:30:04 +02:00
|
|
|
void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a window movement event.
|
|
|
|
* @param[in] window The window that received the event.
|
2013-02-14 13:14:17 +01:00
|
|
|
* @param[in] xpos The new x-coordinate of the client area of the window.
|
|
|
|
* @param[in] ypos The new y-coordinate of the client area of the window.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-02-14 13:14:17 +01:00
|
|
|
void _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a window resize event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] width The new width of the client area of the window.
|
|
|
|
* @param[in] height The new height of the client area of the window.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2011-10-09 17:10:40 +02:00
|
|
|
void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-06-03 12:51:57 +02:00
|
|
|
/*! @brief Notifies shared code of a framebuffer resize event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] width The new width, in pixels, of the framebuffer.
|
|
|
|
* @param[in] height The new height, in pixels, of the framebuffer.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
|
|
|
void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height);
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Notifies shared code of a window iconification event.
|
|
|
|
* @param[in] window The window that received the event.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
|
|
|
|
* `GLFW_FALSE` if it was restored.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2011-10-09 17:10:40 +02:00
|
|
|
void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a window damage event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
*/
|
2011-10-09 21:12:13 +02:00
|
|
|
void _glfwInputWindowDamage(_GLFWwindow* window);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a window close request event
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2012-08-10 13:31:15 +02:00
|
|
|
void _glfwInputWindowCloseRequest(_GLFWwindow* window);
|
2011-10-09 17:10:40 +02:00
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Notifies shared code of a physical key event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] key The key that was pressed or released.
|
2013-05-30 17:19:12 +02:00
|
|
|
* @param[in] scancode The system-specific scan code of the key.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @param[in] action @ref GLFW_PRESS or @ref GLFW_RELEASE.
|
2012-12-09 19:19:00 +01:00
|
|
|
* @param[in] mods The modifiers pressed when the event was generated.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-05-30 17:19:12 +02:00
|
|
|
void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a Unicode character input event.
|
|
|
|
* @param[in] window The window that received the event.
|
2013-10-10 19:41:56 +02:00
|
|
|
* @param[in] codepoint The Unicode code point of the input character.
|
2014-06-12 23:04:20 +02:00
|
|
|
* @param[in] mods Bit field describing which modifier keys were held down.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @param[in] plain `GLFW_TRUE` if the character is regular text input, or
|
|
|
|
* `GLFW_FALSE` otherwise.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2014-06-12 23:04:20 +02:00
|
|
|
void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, int plain);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a scroll event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] x The scroll offset along the x-axis.
|
|
|
|
* @param[in] y The scroll offset along the y-axis.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2012-03-28 21:54:09 +02:00
|
|
|
void _glfwInputScroll(_GLFWwindow* window, double x, double y);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a mouse button click event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] button The button that was pressed or released.
|
|
|
|
* @param[in] action @ref GLFW_PRESS or @ref GLFW_RELEASE.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2012-12-09 19:19:00 +01:00
|
|
|
void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a cursor motion event.
|
|
|
|
* @param[in] window The window that received the event.
|
|
|
|
* @param[in] x The new x-coordinate of the cursor, relative to the left edge
|
|
|
|
* of the client area of the window.
|
|
|
|
* @param[in] y The new y-coordinate of the cursor, relative to the top edge
|
|
|
|
* of the client area of the window.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-04-04 16:16:21 +02:00
|
|
|
void _glfwInputCursorMotion(_GLFWwindow* window, double x, double y);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Notifies shared code of a cursor enter/leave event.
|
|
|
|
* @param[in] window The window that received the event.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @param[in] entered `GLFW_TRUE` if the cursor entered the client area of the
|
|
|
|
* window, or `GLFW_FALSE` if it left it.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2012-01-30 22:59:38 +01:00
|
|
|
void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @ingroup event
|
|
|
|
*/
|
2012-09-12 19:35:52 +02:00
|
|
|
void _glfwInputMonitorChange(void);
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Notifies shared code of an error.
|
|
|
|
* @param[in] error The error code most suitable for the error.
|
2013-03-12 15:33:05 +01:00
|
|
|
* @param[in] format The `printf` style format string of the error
|
2013-01-02 02:21:38 +01:00
|
|
|
* description.
|
|
|
|
* @ingroup event
|
|
|
|
*/
|
2015-10-24 23:52:29 +02:00
|
|
|
#if defined(__GNUC__)
|
|
|
|
void _glfwInputError(int error, const char* format, ...) __attribute__((format(printf, 2, 3)));
|
|
|
|
#else
|
|
|
|
void _glfwInputError(int error, const char* format, ...);
|
2015-10-24 01:53:03 +02:00
|
|
|
#endif
|
2012-12-31 21:05:28 +01:00
|
|
|
|
2013-07-10 11:42:14 +02:00
|
|
|
/*! @brief Notifies dropped object over window.
|
|
|
|
* @param[in] window The window that received the event.
|
2013-12-22 19:28:46 +01:00
|
|
|
* @param[in] count The number of dropped objects.
|
|
|
|
* @param[in] names The names of the dropped objects.
|
2013-07-10 11:42:14 +02:00
|
|
|
* @ingroup event
|
|
|
|
*/
|
2013-12-22 19:28:46 +01:00
|
|
|
void _glfwInputDrop(_GLFWwindow* window, int count, const char** names);
|
2013-07-10 11:42:14 +02:00
|
|
|
|
2012-08-27 03:25:58 +02:00
|
|
|
|
|
|
|
//========================================================================
|
2013-01-02 02:21:38 +01:00
|
|
|
// Utility functions
|
2012-08-27 03:25:58 +02:00
|
|
|
//========================================================================
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
2013-01-02 17:29:24 +01:00
|
|
|
const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor,
|
|
|
|
const GLFWvidmode* desired);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Performs lexical comparison between two @ref GLFWvidmode structures.
|
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2012-08-27 03:25:58 +02:00
|
|
|
int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Splits a color depth into red, green and blue bit depths.
|
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2012-08-27 03:25:58 +02:00
|
|
|
void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
|
|
|
|
|
2013-01-02 02:21:38 +01:00
|
|
|
/*! @brief Searches an extension string for the specified extension.
|
|
|
|
* @param[in] string The extension string to search.
|
2013-02-14 13:14:17 +01:00
|
|
|
* @param[in] extensions The extension to search for.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @return `GLFW_TRUE` if the extension was found, or `GLFW_FALSE` otherwise.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2015-07-28 14:12:16 +02:00
|
|
|
int _glfwStringInExtensionString(const char* string, const char* extensions);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-05-13 15:49:59 +02:00
|
|
|
/*! @brief Chooses the framebuffer config that best matches the desired one.
|
|
|
|
* @param[in] desired The desired framebuffer config.
|
|
|
|
* @param[in] alternatives The framebuffer configs supported by the system.
|
|
|
|
* @param[in] count The number of entries in the alternatives array.
|
|
|
|
* @return The framebuffer config most closely matching the desired one, or @c
|
|
|
|
* NULL if none fulfilled the hard constraints of the desired values.
|
|
|
|
* @ingroup utility
|
|
|
|
*/
|
|
|
|
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
|
|
|
|
const _GLFWfbconfig* alternatives,
|
|
|
|
unsigned int count);
|
|
|
|
|
2013-05-27 15:30:32 +02:00
|
|
|
/*! @brief Retrieves the attributes of the current context.
|
2014-03-06 20:05:32 +01:00
|
|
|
* @param[in] ctxconfig The desired context attributes.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if the context is
|
|
|
|
* unusable.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-05-27 15:30:32 +02:00
|
|
|
/*! @brief Checks whether the desired context attributes are valid.
|
2014-03-06 20:05:32 +01:00
|
|
|
* @param[in] ctxconfig The context attributes to check.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @return `GLFW_TRUE` if the context attributes are valid, or `GLFW_FALSE`
|
2013-01-02 02:21:38 +01:00
|
|
|
* otherwise.
|
|
|
|
* @ingroup utility
|
|
|
|
*
|
|
|
|
* This function checks things like whether the specified client API version
|
|
|
|
* exists and whether all relevant options have supported and non-conflicting
|
|
|
|
* values.
|
|
|
|
*/
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @brief Checks whether the current context fulfils the specified hard
|
|
|
|
* constraints.
|
2014-03-06 20:05:32 +01:00
|
|
|
* @param[in] ctxconfig The desired context attributes.
|
2015-08-23 19:30:04 +02:00
|
|
|
* @return `GLFW_TRUE` if the context fulfils the hard constraints, or
|
|
|
|
* `GLFW_FALSE` otherwise.
|
2013-01-02 02:21:38 +01:00
|
|
|
* @ingroup utility
|
|
|
|
*/
|
2015-08-23 19:30:04 +02:00
|
|
|
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2013-05-19 15:46:44 +02:00
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
2013-07-04 14:51:52 +02:00
|
|
|
void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size);
|
2013-05-19 15:46:44 +02:00
|
|
|
|
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
2013-07-04 14:51:52 +02:00
|
|
|
void _glfwFreeGammaArrays(GLFWgammaramp* ramp);
|
2013-05-19 15:46:44 +02:00
|
|
|
|
2013-11-24 23:31:26 +01:00
|
|
|
/*! @brief Allocates and returns a monitor object with the specified name
|
|
|
|
* and dimensions.
|
|
|
|
* @param[in] name The name of the monitor.
|
|
|
|
* @param[in] widthMM The width, in mm, of the monitor's display area.
|
|
|
|
* @param[in] heightMM The height, in mm, of the monitor's display area.
|
|
|
|
* @return The newly created object.
|
|
|
|
* @ingroup utility
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2014-01-21 15:23:11 +01:00
|
|
|
_GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
2013-11-24 23:31:26 +01:00
|
|
|
/*! @brief Frees a monitor object and any data associated with it.
|
|
|
|
* @ingroup utility
|
2013-01-02 02:21:38 +01:00
|
|
|
*/
|
2014-01-21 15:23:11 +01:00
|
|
|
void _glfwFreeMonitor(_GLFWmonitor* monitor);
|
2013-01-02 02:21:38 +01:00
|
|
|
|
|
|
|
/*! @ingroup utility
|
|
|
|
*/
|
2014-01-21 15:23:11 +01:00
|
|
|
void _glfwFreeMonitors(_GLFWmonitor** monitors, int count);
|
2010-09-07 17:34:51 +02:00
|
|
|
|
2015-06-07 19:32:24 +02:00
|
|
|
#endif // _glfw3_internal_h_
|