blob: 2ef8f10c0da15c1de6cd7698ca80dd7a0f86ce15 [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;
52
53
Camilla Berglund3249f812010-09-07 17:34:51 +020054//------------------------------------------------------------------------
Camilla Berglund135194a2010-09-09 18:15:32 +020055// Platform specific definitions goes in platform.h (which also includes
56// glfw.h)
57//------------------------------------------------------------------------
58
Camilla Berglund3ca63a02010-09-17 00:54:11 +020059#include "config.h"
Camilla Berglund3be0c052010-11-17 14:52:47 +010060
Camilla Berglund53f4f542011-07-26 15:16:34 +020061#include "../include/GL/glfw3.h"
Camilla Berglunda98c66c2011-09-22 14:15:07 +020062
63// This path may need to be changed if you build GLFW using your own setup
64// We ship and use our own copy of glext.h since GLFW uses fairly new
65// extensions and not all operating systems come with an up-to-date version
Camilla Berglund3b733b92011-09-06 17:32:41 +020066#include "../support/GL/glext.h"
Camilla Berglund3be0c052010-11-17 14:52:47 +010067
Camilla Berglund53f4f542011-07-26 15:16:34 +020068#if defined(_GLFW_COCOA_NSGL)
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010069 #include "cocoa_platform.h"
Camilla Berglund53f4f542011-07-26 15:16:34 +020070#elif defined(_GLFW_WIN32_WGL)
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010071 #include "win32_platform.h"
Camilla Berglund53f4f542011-07-26 15:16:34 +020072#elif defined(_GLFW_X11_GLX)
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010073 #include "x11_platform.h"
Camilla Berglund53f4f542011-07-26 15:16:34 +020074#else
Camilla Berglundf6dfaf52012-02-05 16:56:26 +010075 #error "No supported platform selected"
Camilla Berglund53f4f542011-07-26 15:16:34 +020076#endif
Camilla Berglund135194a2010-09-09 18:15:32 +020077
Camilla Berglund99ddce32010-10-04 18:17:53 +020078
Camilla Berglund135194a2010-09-09 18:15:32 +020079//------------------------------------------------------------------------
Camilla Berglundaff30d02012-08-06 17:56:41 +020080// Window hints, set by glfwWindowHint and consumed by glfwCreateWindow
Camilla Berglund12d17b92010-09-09 20:18:10 +020081// A bucket of semi-random stuff lumped together for historical reasons
Camilla Berglund3249f812010-09-07 17:34:51 +020082// This is used only by the platform independent code and only to store
Camilla Berglundaff30d02012-08-06 17:56:41 +020083// parameters passed to us by glfwWindowHint
Camilla Berglund3249f812010-09-07 17:34:51 +020084//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +020085struct _GLFWhints
Camilla Berglund12d17b92010-09-09 20:18:10 +020086{
Camilla Berglund950a3be2010-09-09 19:58:51 +020087 int redBits;
88 int greenBits;
89 int blueBits;
90 int alphaBits;
91 int depthBits;
92 int stencilBits;
Camilla Berglund3249f812010-09-07 17:34:51 +020093 int refreshRate;
94 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 Berglund38cad9a2012-09-30 15:32:50 +0200103 int clientAPI;
Camilla Berglund3249f812010-09-07 17:34:51 +0200104 int glMajor;
105 int glMinor;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +0200106 GLboolean glForward;
107 GLboolean glDebug;
Camilla Berglund3249f812010-09-07 17:34:51 +0200108 int glProfile;
Camilla Berglundd43e0b52011-03-07 20:51:34 +0100109 int glRobustness;
m@bitsnbites.euc9f4ded2012-10-28 00:23:28 +0200110 int positionX;
111 int positionY;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200112};
Camilla Berglund3249f812010-09-07 17:34:51 +0200113
114
115//------------------------------------------------------------------------
Camilla Berglund3249f812010-09-07 17:34:51 +0200116// Parameters relating to the creation of the context and window but not
117// directly related to the properties of the framebuffer
118// This is used to pass window and context creation parameters from the
119// platform independent code to the platform specific code
120//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200121struct _GLFWwndconfig
Camilla Berglund12d17b92010-09-09 20:18:10 +0200122{
Camilla Berglund99ddce32010-10-04 18:17:53 +0200123 int mode;
124 const char* title;
125 int refreshRate;
Camilla Berglunda18cd1b2011-11-02 16:56:34 +0100126 GLboolean resizable;
Camilla Berglund8bb5c592012-08-21 21:18:09 +0200127 GLboolean visible;
m@bitsnbites.euc9f4ded2012-10-28 00:23:28 +0200128 int positionX;
129 int positionY;
Camilla Berglund38cad9a2012-09-30 15:32:50 +0200130 int clientAPI;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200131 int glMajor;
132 int glMinor;
Camilla Berglund70b9a1f2010-10-25 12:36:14 +0200133 GLboolean glForward;
134 GLboolean glDebug;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200135 int glProfile;
Camilla Berglundd43e0b52011-03-07 20:51:34 +0100136 int glRobustness;
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;
163 GLFWintptr platformID;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200164};
Camilla Berglund3249f812010-09-07 17:34:51 +0200165
166
Camilla Berglund135194a2010-09-09 18:15:32 +0200167//------------------------------------------------------------------------
168// Window structure
169//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200170struct _GLFWwindow
Camilla Berglund12d17b92010-09-09 20:18:10 +0200171{
Camilla Berglund326d9972010-09-10 00:06:23 +0200172 struct _GLFWwindow* next;
173
Camilla Berglund12d17b92010-09-09 20:18:10 +0200174 // Window settings and state
Camilla Berglund12d17b92010-09-09 20:18:10 +0200175 GLboolean iconified; // GL_TRUE if this window is iconified
Camilla Berglund867e7472010-09-16 06:02:44 +0200176 GLboolean closeRequested; // GL_TRUE if this window should be closed
Camilla Berglund12d17b92010-09-09 20:18:10 +0200177 int width, height;
Camilla Berglund318f7312010-09-14 03:53:22 +0200178 int positionX, positionY;
Camilla Berglund4fc32a42012-10-31 16:11:09 +0100179 int mode; // GLFW_WINDOWED or GLFW_FULLSCREEN
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 Berglund12d17b92010-09-09 20:18:10 +0200182 int refreshRate; // monitor refresh rate
Camilla Berglund48f5a7e2010-09-09 22:44:38 +0200183 void* userPointer;
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//------------------------------------------------------------------------
222// Library global data
223//------------------------------------------------------------------------
Camilla Berglund99ddce32010-10-04 18:17:53 +0200224struct _GLFWlibrary
Camilla Berglund12d17b92010-09-09 20:18:10 +0200225{
Camilla Berglund2630d492010-10-13 04:04:43 +0200226 _GLFWhints hints;
Camilla Berglund326d9972010-09-10 00:06:23 +0200227
Camilla Berglund2630d492010-10-13 04:04:43 +0200228 _GLFWwindow* windowListHead;
Camilla Berglund14355d62012-11-22 17:04:44 +0100229 _GLFWwindow* focusedWindow;
Camilla Berglund2630d492010-10-13 04:04:43 +0200230
231 GLFWgammaramp currentRamp;
232 GLFWgammaramp originalRamp;
233 int originalRampSize;
Camilla Berglund79bef682012-05-24 11:46:51 +0200234 GLboolean rampChanged;
Camilla Berglund135194a2010-09-09 18:15:32 +0200235
Camilla Berglund871e1a72012-08-02 18:03:43 +0200236 GLFWvidmode* modes;
237
Camilla Berglunde9eb8412010-10-14 16:40:10 +0200238 // This is defined in the current port's platform.h
Camilla Berglund21e77fe2012-04-22 15:53:02 +0200239 _GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
240 _GLFW_PLATFORM_LIBRARY_OPENGL_STATE;
Camilla Berglund99ddce32010-10-04 18:17:53 +0200241};
Camilla Berglund135194a2010-09-09 18:15:32 +0200242
243
Camilla Berglundaaaac002012-08-26 20:11:32 +0200244//------------------------------------------------------------------------
245// Global state shared between compilation units of GLFW
246// These are exported from and documented in init.c
247//------------------------------------------------------------------------
Camilla Berglund5d52ad12012-08-26 18:42:15 +0200248extern GLboolean _glfwInitialized;
Camilla Berglund5d52ad12012-08-26 18:42:15 +0200249extern _GLFWlibrary _glfwLibrary;
Camilla Berglund135194a2010-09-09 18:15:32 +0200250
Camilla Berglund3249f812010-09-07 17:34:51 +0200251
252//========================================================================
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200253// Prototypes for the platform API
254// This is the interface exposed by the platform-specific code for each
255// platform and is called by the shared code of the public API
256// It mirrors the public API except it uses objects instead of handles
Camilla Berglund3249f812010-09-07 17:34:51 +0200257//========================================================================
258
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200259// Platform init and version
Camilla Berglundd46b2222010-09-08 17:30:21 +0200260int _glfwPlatformInit(void);
261int _glfwPlatformTerminate(void);
Camilla Berglundd6fe4472010-09-13 18:05:59 +0200262const char* _glfwPlatformGetVersionString(void);
Camilla Berglundf5d74c42010-09-09 21:06:59 +0200263
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200264// Input mode support
Camilla Berglund135194a2010-09-09 18:15:32 +0200265void _glfwPlatformEnableSystemKeys(_GLFWwindow* window);
266void _glfwPlatformDisableSystemKeys(_GLFWwindow* window);
Camilla Berglundcef9dea2012-06-22 13:53:02 +0200267void _glfwPlatformSetCursorPos(_GLFWwindow* window, int x, int y);
Camilla Berglundc1dd2452012-04-06 14:37:31 +0200268void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode);
Camilla Berglund3249f812010-09-07 17:34:51 +0200269
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200270// Video mode support
Camilla Berglund871e1a72012-08-02 18:03:43 +0200271GLFWvidmode* _glfwPlatformGetVideoModes(int* count);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200272void _glfwPlatformGetDesktopMode(GLFWvidmode* mode);
Camilla Berglund3249f812010-09-07 17:34:51 +0200273
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200274// Gamma ramp support
Camilla Berglund85bcd1f2010-10-13 22:42:31 +0200275void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp);
Camilla Berglund2630d492010-10-13 04:04:43 +0200276void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp);
277
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200278// Clipboard support
Camilla Berglundbf1ada02012-04-09 16:00:54 +0200279void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string);
Camilla Berglundf8687122012-04-12 00:51:58 +0200280const char* _glfwPlatformGetClipboardString(_GLFWwindow* window);
Ralph Eastwood31c91542011-09-21 10:09:47 +0100281
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200282// Joystick input
Camilla Berglundd46b2222010-09-08 17:30:21 +0200283int _glfwPlatformGetJoystickParam(int joy, int param);
Camilla Berglund2502e4d2012-08-29 18:31:12 +0200284int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numaxes);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200285int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons);
Camilla Berglund3249f812010-09-07 17:34:51 +0200286
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200287// Time input
Camilla Berglundd46b2222010-09-08 17:30:21 +0200288double _glfwPlatformGetTime(void);
289void _glfwPlatformSetTime(double time);
Camilla Berglund3249f812010-09-07 17:34:51 +0200290
291// Window management
Camilla Berglundaff30d02012-08-06 17:56:41 +0200292int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig);
293void _glfwPlatformDestroyWindow(_GLFWwindow* window);
Camilla Berglund135194a2010-09-09 18:15:32 +0200294void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
295void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
Camilla Berglund135194a2010-09-09 18:15:32 +0200296void _glfwPlatformIconifyWindow(_GLFWwindow* window);
297void _glfwPlatformRestoreWindow(_GLFWwindow* window);
Riku Salminen596132c2012-08-21 21:01:57 +0300298void _glfwPlatformShowWindow(_GLFWwindow* window);
299void _glfwPlatformHideWindow(_GLFWwindow* window);
Camilla Berglund135194a2010-09-09 18:15:32 +0200300
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200301// Event processing
Camilla Berglund135194a2010-09-09 18:15:32 +0200302void _glfwPlatformPollEvents(void);
303void _glfwPlatformWaitEvents(void);
304
305// OpenGL context management
Camilla Berglundc1ab73b2011-07-27 16:01:27 +0200306void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
Camilla Berglund9e4bc362012-08-12 14:13:18 +0200307_GLFWwindow* _glfwPlatformGetCurrentContext(void);
Camilla Berglund585a8402012-08-06 18:13:37 +0200308void _glfwPlatformSwapBuffers(_GLFWwindow* window);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200309void _glfwPlatformSwapInterval(int interval);
Camilla Berglund17361322012-08-03 15:21:49 +0200310void _glfwPlatformRefreshWindowParams(_GLFWwindow* window);
Camilla Berglund135194a2010-09-09 18:15:32 +0200311int _glfwPlatformExtensionSupported(const char* extension);
Camilla Berglundbf42c3c2012-06-05 00:16:40 +0200312GLFWglproc _glfwPlatformGetProcAddress(const char* procname);
Camilla Berglund3249f812010-09-07 17:34:51 +0200313
314
315//========================================================================
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200316// Prototypes for the event API
317// This is used by the platform-specific code to notify the shared code of
318// events that can be translated into state changes and/or callback calls,
319// instead of directly calling callbacks or modifying shared state
Camilla Berglund3249f812010-09-07 17:34:51 +0200320//========================================================================
321
Camilla Berglundb016d642012-01-31 15:27:15 +0100322// Window event notification (window.c)
Camilla Berglund14355d62012-11-22 17:04:44 +0100323void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused);
Camilla Berglundd0840bd2011-10-09 17:10:40 +0200324void _glfwInputWindowPos(_GLFWwindow* window, int x, int y);
325void _glfwInputWindowSize(_GLFWwindow* window, int width, int height);
326void _glfwInputWindowIconify(_GLFWwindow* window, int iconified);
Camilla Berglund8bb5c592012-08-21 21:18:09 +0200327void _glfwInputWindowVisibility(_GLFWwindow* window, int visible);
Camilla Berglund72ef5372011-10-09 21:12:13 +0200328void _glfwInputWindowDamage(_GLFWwindow* window);
Camilla Berglund2410e2a2012-08-10 13:31:15 +0200329void _glfwInputWindowCloseRequest(_GLFWwindow* window);
Camilla Berglundd0840bd2011-10-09 17:10:40 +0200330
Camilla Berglundb016d642012-01-31 15:27:15 +0100331// Input event notification (input.c)
Camilla Berglund135194a2010-09-09 18:15:32 +0200332void _glfwInputKey(_GLFWwindow* window, int key, int action);
Camilla Berglund93ea3412010-09-09 19:33:37 +0200333void _glfwInputChar(_GLFWwindow* window, int character);
Camilla Berglund4ef9aec2012-03-28 21:54:09 +0200334void _glfwInputScroll(_GLFWwindow* window, double x, double y);
Camilla Berglund135194a2010-09-09 18:15:32 +0200335void _glfwInputMouseClick(_GLFWwindow* window, int button, int action);
Camilla Berglundd0840bd2011-10-09 17:10:40 +0200336void _glfwInputCursorMotion(_GLFWwindow* window, int x, int y);
Camilla Berglundc4806b92012-01-30 22:59:38 +0100337void _glfwInputCursorEnter(_GLFWwindow* window, int entered);
Camilla Berglund3249f812010-09-07 17:34:51 +0200338
Camilla Berglund2a8b2cc2012-08-27 03:25:58 +0200339
340//========================================================================
341// Prototypes for internal utility functions
342// These functions are shared code and may be used by any part of GLFW
343// Each platform may add its own utility functions, but those may only be
344// called by the platform-specific code
345//========================================================================
346
347// Fullscren management (fullscreen.c)
348int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second);
349void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
350
351// Error handling (init.c)
352void _glfwSetError(int error, const char* format, ...);
353
Camilla Berglund596f56f2011-03-07 13:56:28 +0100354// OpenGL context helpers (opengl.c)
Camilla Berglundd46b2222010-09-08 17:30:21 +0200355int _glfwStringInExtensionString(const char* string, const GLubyte* extensions);
Camilla Berglundd46b2222010-09-08 17:30:21 +0200356const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
357 const _GLFWfbconfig* alternatives,
358 unsigned int count);
Camilla Berglund59896c32012-08-02 14:42:24 +0200359GLboolean _glfwRefreshContextParams(void);
Camilla Berglund19be24a2011-03-07 14:55:11 +0100360GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig);
Camilla Berglund59896c32012-08-02 14:42:24 +0200361GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig);
Camilla Berglund3249f812010-09-07 17:34:51 +0200362
363
364#endif // _internal_h_