blob: 5f511c4a883b7d1d10a7aec7c8d69bba41963aea [file] [log] [blame]
Camilla Berglund3249f812010-09-07 17:34:51 +02001//========================================================================
Camilla Berglund6e553c72011-03-06 01:46:39 +01002// GLFW - An OpenGL library
Camilla Berglund3249f812010-09-07 17:34:51 +02003// Platform: Any
Camilla Berglund38b0ccb2010-09-07 17:41:26 +02004// API version: 3.0
Camilla Berglund3249f812010-09-07 17:34:51 +02005// WWW: http://www.glfw.org/
6//------------------------------------------------------------------------
7// Copyright (c) 2002-2006 Marcus Geelnard
8// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
9//
10// This software is provided 'as-is', without any express or implied
11// warranty. In no event will the authors be held liable for any damages
12// arising from the use of this software.
13//
14// Permission is granted to anyone to use this software for any purpose,
15// including commercial applications, and to alter it and redistribute it
16// freely, subject to the following restrictions:
17//
18// 1. The origin of this software must not be misrepresented; you must not
19// claim that you wrote the original software. If you use this software
20// in a product, an acknowledgment in the product documentation would
21// be appreciated but is not required.
22//
23// 2. Altered source versions must be plainly marked as such, and must not
24// be misrepresented as being the original software.
25//
26// 3. This notice may not be removed or altered from any source
27// distribution.
28//
29//========================================================================
30
31#ifndef _internal_h_
32#define _internal_h_
33
Camilla Berglund3249f812010-09-07 17:34:51 +020034
35//========================================================================
36// Input handling definitions
37//========================================================================
38
39// Internal key and button state/action definitions
40#define GLFW_STICK 2
41
42
Camilla Berglund1a998272012-04-22 21:49:38 +020043//========================================================================
44// Internal type declarations
45//========================================================================
46
47typedef struct _GLFWhints _GLFWhints;
48typedef struct _GLFWwndconfig _GLFWwndconfig;
49typedef struct _GLFWfbconfig _GLFWfbconfig;
50typedef struct _GLFWwindow _GLFWwindow;
51typedef struct _GLFWlibrary _GLFWlibrary;
Camilla Berglunda0429e42012-07-11 00:33:19 +020052typedef struct _GLFWmonitor _GLFWmonitor;
Camilla Berglund1a998272012-04-22 21:49:38 +020053
54
Camilla Berglund3249f812010-09-07 17:34:51 +020055//------------------------------------------------------------------------
Camilla Berglund135194a2010-09-09 18:15:32 +020056// Platform specific definitions goes in platform.h (which also includes
57// glfw.h)
58//------------------------------------------------------------------------
59
Camilla Berglund3ca63a02010-09-17 00:54:11 +020060#include "config.h"
Camilla Berglund3be0c052010-11-17 14:52:47 +010061
Camilla Berglund53f4f542011-07-26 15:16:34 +020062#include "../include/GL/glfw3.h"
Camilla Berglunda98c66c2011-09-22 14:15:07 +020063
64// This path may need to be changed if you build GLFW using your own setup
65// We ship and use our own copy of glext.h since GLFW uses fairly new
66// extensions and not all operating systems come with an up-to-date version
Camilla Berglund3b733b92011-09-06 17:32:41 +020067#include "../support/GL/glext.h"
Camilla Berglund3be0c052010-11-17 14:52:47 +010068
Camilla Berglund34d38332012-11-27 15:02:26 +010069#if defined(_GLFW_COCOA)
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010070 #include "cocoa_platform.h"
Camilla Berglund34d38332012-11-27 15:02:26 +010071#elif defined(_GLFW_WIN32)
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010072 #include "win32_platform.h"
Camilla Berglund34d38332012-11-27 15:02:26 +010073#elif defined(_GLFW_X11)
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010074 #include "x11_platform.h"
Camilla Berglund53f4f542011-07-26 15:16:34 +020075#else
Camilla Berglund5da8ed22012-12-02 19:01:20 +010076 #error "No supported window creation API selected"
Camilla Berglund53f4f542011-07-26 15:16:34 +020077#endif
Camilla Berglund135194a2010-09-09 18:15:32 +020078
Camilla Berglund99ddce32010-10-04 18:17:53 +020079
Camilla Berglund135194a2010-09-09 18:15:32 +020080//------------------------------------------------------------------------
Camilla Berglundaff30d02012-08-06 17:56:41 +020081// Window hints, set by glfwWindowHint and consumed by glfwCreateWindow
Camilla Berglund12d17b92010-09-09 20:18:10 +020082// A bucket of semi-random stuff lumped together for historical reasons
Camilla Berglund3249f812010-09-07 17:34:51 +020083// This is used only by the platform independent code and only to store
Camilla Berglundaff30d02012-08-06 17:56:41 +020084// parameters passed to us by glfwWindowHint
Camilla Berglund3249f812010-09-07 17:34:51 +020085//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +020086struct _GLFWhints
Camilla Berglund12d17b92010-09-09 20:18:10 +020087{
Camilla Berglund950a3be2010-09-09 19:58:51 +020088 int redBits;
89 int greenBits;
90 int blueBits;
91 int alphaBits;
92 int depthBits;
93 int stencilBits;
Camilla Berglund3249f812010-09-07 17:34:51 +020094 int accumRedBits;
95 int accumGreenBits;
96 int accumBlueBits;
97 int accumAlphaBits;
98 int auxBuffers;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +020099 GLboolean stereo;
Camilla Berglunda18cd1b2011-11-02 16:56:34 +0100100 GLboolean resizable;
Camilla Berglund8bb5c592012-08-21 21:18:09 +0200101 GLboolean visible;
Camilla Berglund3249f812010-09-07 17:34:51 +0200102 int samples;
Camilla Berglund69a90052012-12-02 16:10:00 +0100103 GLboolean sRGB;
Camilla Berglund38cad9a2012-09-30 15:32:50 +0200104 int clientAPI;
Camilla Berglund3249f812010-09-07 17:34:51 +0200105 int glMajor;
106 int glMinor;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +0200107 GLboolean glForward;
108 GLboolean glDebug;
Camilla Berglund3249f812010-09-07 17:34:51 +0200109 int glProfile;
Camilla Berglundd43e0b52011-03-07 20:51:34 +0100110 int glRobustness;
m@bitsnbites.euc9f4ded2012-10-28 00:23:28 +0200111 int positionX;
112 int positionY;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200113};
Camilla Berglund3249f812010-09-07 17:34:51 +0200114
115
116//------------------------------------------------------------------------
Camilla Berglund3249f812010-09-07 17:34:51 +0200117// Parameters relating to the creation of the context and window but not
118// directly related to the properties of the framebuffer
119// This is used to pass window and context creation parameters from the
120// platform independent code to the platform specific code
121//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200122struct _GLFWwndconfig
Camilla Berglund12d17b92010-09-09 20:18:10 +0200123{
Camilla Berglund99ddce32010-10-04 18:17:53 +0200124 const char* title;
Camilla Berglunda18cd1b2011-11-02 16:56:34 +0100125 GLboolean resizable;
Camilla Berglund8bb5c592012-08-21 21:18:09 +0200126 GLboolean visible;
m@bitsnbites.euc9f4ded2012-10-28 00:23:28 +0200127 int positionX;
128 int positionY;
Camilla Berglund38cad9a2012-09-30 15:32:50 +0200129 int clientAPI;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200130 int glMajor;
131 int glMinor;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +0200132 GLboolean glForward;
133 GLboolean glDebug;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200134 int glProfile;
Camilla Berglundd43e0b52011-03-07 20:51:34 +0100135 int glRobustness;
Camilla Berglund1be16362012-09-27 21:37:36 +0200136 _GLFWmonitor* monitor;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200137 _GLFWwindow* share;
138};
Camilla Berglund3249f812010-09-07 17:34:51 +0200139
140
141//------------------------------------------------------------------------
142// Framebuffer configuration descriptor, i.e. buffers and their sizes
143// Also a platform specific ID used to map back to the actual backend APIs
144// This is used to pass framebuffer parameters from the platform independent
145// code to the platform specific code, and also to enumerate and select
146// available framebuffer configurations
147//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200148struct _GLFWfbconfig
Camilla Berglund12d17b92010-09-09 20:18:10 +0200149{
Camilla Berglund3249f812010-09-07 17:34:51 +0200150 int redBits;
151 int greenBits;
152 int blueBits;
153 int alphaBits;
154 int depthBits;
155 int stencilBits;
156 int accumRedBits;
157 int accumGreenBits;
158 int accumBlueBits;
159 int accumAlphaBits;
160 int auxBuffers;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +0200161 GLboolean stereo;
Camilla Berglund3249f812010-09-07 17:34:51 +0200162 int samples;
Camilla Berglund69a90052012-12-02 16:10:00 +0100163 GLboolean sRGB;
Camilla Berglund3249f812010-09-07 17:34:51 +0200164 GLFWintptr platformID;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200165};
Camilla Berglund3249f812010-09-07 17:34:51 +0200166
167
Camilla Berglund135194a2010-09-09 18:15:32 +0200168//------------------------------------------------------------------------
169// Window structure
170//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200171struct _GLFWwindow
Camilla Berglund12d17b92010-09-09 20:18:10 +0200172{
Camilla Berglund326d9972010-09-10 00:06:23 +0200173 struct _GLFWwindow* next;
174
Camilla Berglund12d17b92010-09-09 20:18:10 +0200175 // Window settings and state
Camilla Berglund12d17b92010-09-09 20:18:10 +0200176 GLboolean iconified; // GL_TRUE if this window is iconified
Camilla Berglund867e7472010-09-16 06:02:44 +0200177 GLboolean closeRequested; // GL_TRUE if this window should be closed
Camilla Berglund12d17b92010-09-09 20:18:10 +0200178 int width, height;
Camilla Berglund318f7312010-09-14 03:53:22 +0200179 int positionX, positionY;
Camilla Berglunda18cd1b2011-11-02 16:56:34 +0100180 GLboolean resizable; // GL_TRUE if user may resize this window
Camilla Berglund8bb5c592012-08-21 21:18:09 +0200181 GLboolean visible; // GL_TRUE if this window is visible
Camilla Berglund48f5a7e2010-09-09 22:44:38 +0200182 void* userPointer;
Camilla Berglund1be16362012-09-27 21:37:36 +0200183 _GLFWmonitor* monitor;
Camilla Berglund135194a2010-09-09 18:15:32 +0200184
Camilla Berglund12d17b92010-09-09 20:18:10 +0200185 // Window input state
Camilla Berglund135194a2010-09-09 18:15:32 +0200186 GLboolean stickyKeys;
187 GLboolean stickyMouseButtons;
Camilla Berglund2660b272011-10-13 15:20:59 +0200188 int cursorPosX, cursorPosY;
Camilla Berglundb1656d72011-09-06 13:55:29 +0200189 int cursorMode;
Camilla Berglund4ef9aec2012-03-28 21:54:09 +0200190 double scrollX, scrollY;
Camilla Berglund135194a2010-09-09 18:15:32 +0200191 char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1];
192 char key[GLFW_KEY_LAST + 1];
Camilla Berglund135194a2010-09-09 18:15:32 +0200193
Camilla Berglund135194a2010-09-09 18:15:32 +0200194 // OpenGL extensions and context attributes
Camilla Berglund38cad9a2012-09-30 15:32:50 +0200195 int clientAPI;
Camilla Berglund135194a2010-09-09 18:15:32 +0200196 int glMajor, glMinor, glRevision;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +0200197 GLboolean glForward, glDebug;
198 int glProfile;
Camilla Berglundd43e0b52011-03-07 20:51:34 +0100199 int glRobustness;
Camilla Berglund135194a2010-09-09 18:15:32 +0200200 PFNGLGETSTRINGIPROC GetStringi;
201
Camilla Berglund1a3d47d2012-11-30 13:56:42 +0100202 GLFWwindowposfun windowPosCallback;
Camilla Berglund18d71c22012-10-28 13:45:11 +0100203 GLFWwindowsizefun windowSizeCallback;
204 GLFWwindowclosefun windowCloseCallback;
205 GLFWwindowrefreshfun windowRefreshCallback;
206 GLFWwindowfocusfun windowFocusCallback;
207 GLFWwindowiconifyfun windowIconifyCallback;
208 GLFWmousebuttonfun mouseButtonCallback;
209 GLFWcursorposfun cursorPosCallback;
210 GLFWcursorenterfun cursorEnterCallback;
211 GLFWscrollfun scrollCallback;
212 GLFWkeyfun keyCallback;
213 GLFWcharfun charCallback;
214
Camilla Berglunde9eb8412010-10-14 16:40:10 +0200215 // These are defined in the current port's platform.h
Camilla Berglund135194a2010-09-09 18:15:32 +0200216 _GLFW_PLATFORM_WINDOW_STATE;
Camilla Berglund32287552010-09-09 20:36:23 +0200217 _GLFW_PLATFORM_CONTEXT_STATE;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200218};
Camilla Berglund135194a2010-09-09 18:15:32 +0200219
220
221//------------------------------------------------------------------------
Marcel Metzbeacbb32011-05-07 10:53:50 +0200222// Display structure
223//------------------------------------------------------------------------
Marcel Metz426df422011-10-03 03:24:35 -0400224struct _GLFWmonitor
Marcel Metzbeacbb32011-05-07 10:53:50 +0200225{
Marcel Metzbeacbb32011-05-07 10:53:50 +0200226 void* userPointer;
227
Camilla Berglund97387282011-10-06 23:28:56 +0200228 char* name;
Camilla Berglund20a49a72012-09-13 17:46:40 +0200229
230 GLboolean primary;
231
Marcel Metzbeacbb32011-05-07 10:53:50 +0200232 // physical dimensions in millimeters.
233 int physicalWidth;
234 int physicalHeight;
235 // logical orientation of the screen on the desktop
Camilla Berglund21083602012-10-22 02:39:22 +0200236 int positionX;
237 int positionY;
Marcel Metz58d43232011-10-02 16:13:47 -0400238
Camilla Berglund854e6342012-08-03 02:57:33 +0200239 GLFWvidmode* modes;
Camilla Berglundb66e1de2012-12-27 18:37:55 +0100240 int modeCount;
Camilla Berglund854e6342012-08-03 02:57:33 +0200241
Marcel Metz58d43232011-10-02 16:13:47 -0400242 // These are defined in the current port's platform.h
Marcel Metz426df422011-10-03 03:24:35 -0400243 _GLFW_PLATFORM_MONITOR_STATE;
Marcel Metzbeacbb32011-05-07 10:53:50 +0200244};
245
246//------------------------------------------------------------------------
Camilla Berglund135194a2010-09-09 18:15:32 +0200247// Library global data
248//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200249struct _GLFWlibrary
Camilla Berglund12d17b92010-09-09 20:18:10 +0200250{
Camilla Berglund2630d492010-10-13 04:04:43 +0200251 _GLFWhints hints;
Camilla Berglund326d9972010-09-10 00:06:23 +0200252
Camilla Berglund2630d492010-10-13 04:04:43 +0200253 _GLFWwindow* windowListHead;
Camilla Berglund14355d62012-11-22 17:04:44 +0100254 _GLFWwindow* focusedWindow;
Camilla Berglund830f2b42012-09-12 19:35:52 +0200255
256 _GLFWmonitor** monitors;
257 int monitorCount;
Camilla Berglund7c426d12012-11-01 00:07:01 +0100258 GLFWmonitorfun monitorCallback;
Camilla Berglund4044c2d2010-10-24 18:28:55 +0200259
Camilla Berglund2630d492010-10-13 04:04:43 +0200260 GLFWgammaramp currentRamp;
261 GLFWgammaramp originalRamp;
262 int originalRampSize;
Camilla Berglund79bef682012-05-24 11:46:51 +0200263 GLboolean rampChanged;
Camilla Berglund135194a2010-09-09 18:15:32 +0200264
Camilla Berglunde9eb8412010-10-14 16:40:10 +0200265 // This is defined in the current port's platform.h
Camilla Berglund21e77fe2012-04-22 15:53:02 +0200266 _GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
267 _GLFW_PLATFORM_LIBRARY_OPENGL_STATE;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200268};
Camilla Berglund135194a2010-09-09 18:15:32 +0200269
270
Camilla Berglundaaaac002012-08-26 20:11:32 +0200271//------------------------------------------------------------------------
272// Global state shared between compilation units of GLFW
273// These are exported from and documented in init.c
274//------------------------------------------------------------------------
Camilla Berglund5d52ad12012-08-26 18:42:15 +0200275extern GLboolean _glfwInitialized;
Camilla Berglund5d52ad12012-08-26 18:42:15 +0200276extern _GLFWlibrary _glfwLibrary;
Camilla Berglund135194a2010-09-09 18:15:32 +0200277
Camilla Berglund3249f812010-09-07 17:34:51 +0200278
279//========================================================================
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200280// Prototypes for the platform API
281// This is the interface exposed by the platform-specific code for each
282// platform and is called by the shared code of the public API
283// It mirrors the public API except it uses objects instead of handles
Camilla Berglund3249f812010-09-07 17:34:51 +0200284//========================================================================
285
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200286// Platform init and version
Camilla Berglundd46b2222010-09-08 17:30:21 +0200287int _glfwPlatformInit(void);
Camilla Berglund9af61d02012-12-30 01:15:48 +0100288void _glfwPlatformTerminate(void);
Camilla Berglundd6fe4472010-09-13 18:05:59 +0200289const char* _glfwPlatformGetVersionString(void);
Camilla Berglundf5d74c42010-09-09 21:06:59 +0200290
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200291// Input mode support
Camilla Berglundcef9dea2012-06-22 13:53:02 +0200292void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y);
Camilla Berglundc1dd2452012-04-06 14:37:31 +0200293void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
Camilla Berglund3249f812010-09-07 17:34:51 +0200294
Camilla Berglund830f2b42012-09-12 19:35:52 +0200295// Monitor support
296_GLFWmonitor** _glfwPlatformGetMonitors(int* count);
297void _glfwPlatformDestroyMonitor(_GLFWmonitor* monitor);
298
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200299// Video mode support
Camilla Berglund854e6342012-08-03 02:57:33 +0200300GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count);
Camilla Berglund89b42d02012-08-30 01:53:23 +0200301void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode);
Camilla Berglund3249f812010-09-07 17:34:51 +0200302
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200303// Gamma ramp support
Camilla Berglund85bcd1f2010-10-13 22:42:31 +0200304void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp);
Camilla Berglund2630d492010-10-13 04:04:43 +0200305void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp);
306
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200307// Clipboard support
Camilla Berglundbf1ada02012-04-09 16:00:54 +0200308void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);
Camilla Berglundf8687122012-04-12 00:51:58 +0200309const char* _glfwPlatformGetClipboardString(_GLFWwindow* window);
Ralph Eastwood31c91542011-09-21 10:09:47 +0100310
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200311// Joystick input
Camilla Berglundd46b2222010-09-08 17:30:21 +0200312int _glfwPlatformGetJoystickParam(int joy, int param);
Camilla Berglund2502e4d2012-08-29 18:31:12 +0200313int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200314int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
Camilla Berglund93a1d1c2012-09-07 01:01:34 +0200315const char* _glfwPlatformGetJoystickName(int joy);
Camilla Berglund3249f812010-09-07 17:34:51 +0200316
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200317// Time input
Camilla Berglundd46b2222010-09-08 17:30:21 +0200318double _glfwPlatformGetTime(void);
319void _glfwPlatformSetTime(double time);
Camilla Berglund3249f812010-09-07 17:34:51 +0200320
321// Window management
Camilla Berglundaff30d02012-08-06 17:56:41 +0200322int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig);
323void _glfwPlatformDestroyWindow(_GLFWwindow* window);
Camilla Berglund135194a2010-09-09 18:15:32 +0200324void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
325void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
Camilla Berglund135194a2010-09-09 18:15:32 +0200326void _glfwPlatformIconifyWindow(_GLFWwindow* window);
327void _glfwPlatformRestoreWindow(_GLFWwindow* window);
Riku Salminen596132c2012-08-21 21:01:57 +0300328void _glfwPlatformShowWindow(_GLFWwindow* window);
329void _glfwPlatformHideWindow(_GLFWwindow* window);
Camilla Berglund135194a2010-09-09 18:15:32 +0200330
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200331// Event processing
Camilla Berglund135194a2010-09-09 18:15:32 +0200332void _glfwPlatformPollEvents(void);
333void _glfwPlatformWaitEvents(void);
334
335// OpenGL context management
Camilla Berglundc1ab73b2011-07-27 16:01:27 +0200336void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
Camilla Berglund9e4bc362012-08-12 14:13:18 +0200337_GLFWwindow* _glfwPlatformGetCurrentContext(void);
Camilla Berglund585a8402012-08-06 18:13:37 +0200338void _glfwPlatformSwapBuffers(_GLFWwindow* window);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200339void _glfwPlatformSwapInterval(int interval);
Camilla Berglund135194a2010-09-09 18:15:32 +0200340int _glfwPlatformExtensionSupported(const char* extension);
Camilla Berglundbf42c3c2012-06-05 00:16:40 +0200341GLFWglproc _glfwPlatformGetProcAddress(const char* procname);
Camilla Berglund3249f812010-09-07 17:34:51 +0200342
343
344//========================================================================
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200345// Prototypes for the event API
346// This is used by the platform-specific code to notify the shared code of
347// events that can be translated into state changes and/or callback calls,
348// instead of directly calling callbacks or modifying shared state
Camilla Berglund3249f812010-09-07 17:34:51 +0200349//========================================================================
350
Camilla Berglundb016d642012-01-31 15:27:15 +0100351// Window event notification (window.c)
Camilla Berglund14355d62012-11-22 17:04:44 +0100352void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);
Camilla Berglundd0840bd2011-10-09 17:10:40 +0200353void _glfwInputWindowPos(_GLFWwindow* window, int x, int y);
354void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
355void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
Camilla Berglund8bb5c592012-08-21 21:18:09 +0200356void _glfwInputWindowVisibility(_GLFWwindow* window, int visible);
Camilla Berglund72ef5372011-10-09 21:12:13 +0200357void _glfwInputWindowDamage(_GLFWwindow* window);
Camilla Berglund2410e2a2012-08-10 13:31:15 +0200358void _glfwInputWindowCloseRequest(_GLFWwindow* window);
Camilla Berglundd0840bd2011-10-09 17:10:40 +0200359
Camilla Berglundb016d642012-01-31 15:27:15 +0100360// Input event notification (input.c)
Camilla Berglund135194a2010-09-09 18:15:32 +0200361void _glfwInputKey(_GLFWwindow* window, int key, int action);
Camilla Berglund93ea3412010-09-09 19:33:37 +0200362void _glfwInputChar(_GLFWwindow* window, int character);
Camilla Berglund4ef9aec2012-03-28 21:54:09 +0200363void _glfwInputScroll(_GLFWwindow* window, double x, double y);
Camilla Berglund135194a2010-09-09 18:15:32 +0200364void _glfwInputMouseClick(_GLFWwindow* window, int button, int action);
Camilla Berglundd0840bd2011-10-09 17:10:40 +0200365void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y);
Camilla Berglundc4806b92012-01-30 22:59:38 +0100366void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
Camilla Berglund3249f812010-09-07 17:34:51 +0200367
Camilla Berglund830f2b42012-09-12 19:35:52 +0200368// Monitor event notification (monitor.c)
369void _glfwInputMonitorChange(void);
370
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200371
372//========================================================================
373// Prototypes for internal utility functions
374// These functions are shared code and may be used by any part of GLFW
375// Each platform may add its own utility functions, but those may only be
376// called by the platform-specific code
377//========================================================================
378
379// Fullscren management (fullscreen.c)
Camilla Berglundcf422822012-12-31 03:04:04 +0100380const GLFWvidmode* _glfwChooseVideoMode(const GLFWvidmode* desired,
381 const GLFWvidmode* alternatives,
382 unsigned int count);
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200383int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
384void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
385
386// Error handling (init.c)
387void _glfwSetError(int error, const char* format, ...);
388
Camilla Berglund596f56f2011-03-07 13:56:28 +0100389// OpenGL context helpers (opengl.c)
Camilla Berglundd46b2222010-09-08 17:30:21 +0200390int _glfwStringInExtensionString(const char* string, const GLubyte* extensions);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200391const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
392 const _GLFWfbconfig* alternatives,
393 unsigned int count);
Camilla Berglund59896c32012-08-02 14:42:24 +0200394GLboolean _glfwRefreshContextParams(void);
Camilla Berglund19be24a2011-03-07 14:55:11 +0100395GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
Camilla Berglund59896c32012-08-02 14:42:24 +0200396GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig);
Camilla Berglund3249f812010-09-07 17:34:51 +0200397
Marcel Metz6f970f52012-01-30 12:04:16 +0100398// Monitor management (monitor.c)
Camilla Berglund830f2b42012-09-12 19:35:52 +0200399_GLFWmonitor* _glfwCreateMonitor(const char* name,
Camilla Berglund20a49a72012-09-13 17:46:40 +0200400 GLboolean primary,
Camilla Berglund830f2b42012-09-12 19:35:52 +0200401 int physicalWidth, int physicalHeight,
Camilla Berglund21083602012-10-22 02:39:22 +0200402 int x, int y);
Camilla Berglund830f2b42012-09-12 19:35:52 +0200403void _glfwDestroyMonitor(_GLFWmonitor* monitor);
404void _glfwDestroyMonitors(void);
Camilla Berglund3249f812010-09-07 17:34:51 +0200405
406#endif // _internal_h_