Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 1 | //======================================================================== |
| 2 | // GLFW - An OpenGL framework |
| 3 | // Platform: Any |
Camilla Berglund | 38b0ccb | 2010-09-07 17:41:26 +0200 | [diff] [blame] | 4 | // API version: 3.0 |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 5 | // 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 | |
| 34 | //======================================================================== |
| 35 | // GLFWGLOBAL is a macro that places all global variables in the init.c |
| 36 | // module (all other modules reference global variables as 'extern') |
| 37 | //======================================================================== |
| 38 | |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 39 | #if defined(_init_c_) |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 40 | #define GLFWGLOBAL |
| 41 | #else |
| 42 | #define GLFWGLOBAL extern |
| 43 | #endif |
| 44 | |
| 45 | |
| 46 | //======================================================================== |
| 47 | // Input handling definitions |
| 48 | //======================================================================== |
| 49 | |
| 50 | // Internal key and button state/action definitions |
| 51 | #define GLFW_STICK 2 |
| 52 | |
| 53 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 54 | //------------------------------------------------------------------------ |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 55 | // Platform specific definitions goes in platform.h (which also includes |
| 56 | // glfw.h) |
| 57 | //------------------------------------------------------------------------ |
| 58 | |
Camilla Berglund | 3ca63a0 | 2010-09-17 00:54:11 +0200 | [diff] [blame] | 59 | #include "config.h" |
Camilla Berglund | 3be0c05 | 2010-11-17 14:52:47 +0100 | [diff] [blame] | 60 | |
| 61 | #include "../../include/GL/glfw3.h" |
| 62 | #include "../../include/GL/glext.h" |
| 63 | |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 64 | #include "platform.h" |
| 65 | |
| 66 | |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 67 | typedef struct _GLFWhints _GLFWhints; |
| 68 | typedef struct _GLFWwndconfig _GLFWwndconfig; |
| 69 | typedef struct _GLFWfbconfig _GLFWfbconfig; |
| 70 | typedef struct _GLFWwindow _GLFWwindow; |
| 71 | typedef struct _GLFWlibrary _GLFWlibrary; |
| 72 | |
| 73 | |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 74 | //------------------------------------------------------------------------ |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 75 | // Window hints, set by glfwOpenWindowHint and consumed by glfwOpenWindow |
| 76 | // A bucket of semi-random stuff lumped together for historical reasons |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 77 | // This is used only by the platform independent code and only to store |
| 78 | // parameters passed to us by glfwOpenWindowHint |
| 79 | //------------------------------------------------------------------------ |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 80 | struct _GLFWhints |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 81 | { |
Camilla Berglund | 950a3be | 2010-09-09 19:58:51 +0200 | [diff] [blame] | 82 | int redBits; |
| 83 | int greenBits; |
| 84 | int blueBits; |
| 85 | int alphaBits; |
| 86 | int depthBits; |
| 87 | int stencilBits; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 88 | int refreshRate; |
| 89 | int accumRedBits; |
| 90 | int accumGreenBits; |
| 91 | int accumBlueBits; |
| 92 | int accumAlphaBits; |
| 93 | int auxBuffers; |
Camilla Berglund | 70b9a1f | 2010-10-25 12:36:14 +0200 | [diff] [blame] | 94 | GLboolean stereo; |
| 95 | GLboolean windowNoResize; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 96 | int samples; |
| 97 | int glMajor; |
| 98 | int glMinor; |
Camilla Berglund | 70b9a1f | 2010-10-25 12:36:14 +0200 | [diff] [blame] | 99 | GLboolean glForward; |
| 100 | GLboolean glDebug; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 101 | int glProfile; |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 102 | }; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 103 | |
| 104 | |
| 105 | //------------------------------------------------------------------------ |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 106 | // Parameters relating to the creation of the context and window but not |
| 107 | // directly related to the properties of the framebuffer |
| 108 | // This is used to pass window and context creation parameters from the |
| 109 | // platform independent code to the platform specific code |
| 110 | //------------------------------------------------------------------------ |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 111 | struct _GLFWwndconfig |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 112 | { |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 113 | int mode; |
| 114 | const char* title; |
| 115 | int refreshRate; |
Camilla Berglund | 70b9a1f | 2010-10-25 12:36:14 +0200 | [diff] [blame] | 116 | GLboolean windowNoResize; |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 117 | int glMajor; |
| 118 | int glMinor; |
Camilla Berglund | 70b9a1f | 2010-10-25 12:36:14 +0200 | [diff] [blame] | 119 | GLboolean glForward; |
| 120 | GLboolean glDebug; |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 121 | int glProfile; |
| 122 | _GLFWwindow* share; |
| 123 | }; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 124 | |
| 125 | |
| 126 | //------------------------------------------------------------------------ |
| 127 | // Framebuffer configuration descriptor, i.e. buffers and their sizes |
| 128 | // Also a platform specific ID used to map back to the actual backend APIs |
| 129 | // This is used to pass framebuffer parameters from the platform independent |
| 130 | // code to the platform specific code, and also to enumerate and select |
| 131 | // available framebuffer configurations |
| 132 | //------------------------------------------------------------------------ |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 133 | struct _GLFWfbconfig |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 134 | { |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 135 | int redBits; |
| 136 | int greenBits; |
| 137 | int blueBits; |
| 138 | int alphaBits; |
| 139 | int depthBits; |
| 140 | int stencilBits; |
| 141 | int accumRedBits; |
| 142 | int accumGreenBits; |
| 143 | int accumBlueBits; |
| 144 | int accumAlphaBits; |
| 145 | int auxBuffers; |
Camilla Berglund | 70b9a1f | 2010-10-25 12:36:14 +0200 | [diff] [blame] | 146 | GLboolean stereo; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 147 | int samples; |
| 148 | GLFWintptr platformID; |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 149 | }; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 150 | |
| 151 | |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 152 | //------------------------------------------------------------------------ |
| 153 | // Window structure |
| 154 | //------------------------------------------------------------------------ |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 155 | struct _GLFWwindow |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 156 | { |
Camilla Berglund | 326d997 | 2010-09-10 00:06:23 +0200 | [diff] [blame] | 157 | struct _GLFWwindow* next; |
| 158 | |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 159 | // Window settings and state |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 160 | GLboolean iconified; // GL_TRUE if this window is iconified |
Camilla Berglund | 867e747 | 2010-09-16 06:02:44 +0200 | [diff] [blame] | 161 | GLboolean closeRequested; // GL_TRUE if this window should be closed |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 162 | int width, height; |
Camilla Berglund | 318f731 | 2010-09-14 03:53:22 +0200 | [diff] [blame] | 163 | int positionX, positionY; |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 164 | int mode; // GLFW_WINDOW or GLFW_FULLSCREEN |
| 165 | GLboolean sysKeysDisabled; // system keys disabled flag |
| 166 | GLboolean windowNoResize; // resize- and maximize gadgets disabled flag |
| 167 | int refreshRate; // monitor refresh rate |
Camilla Berglund | 48f5a7e | 2010-09-09 22:44:38 +0200 | [diff] [blame] | 168 | void* userPointer; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 169 | |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 170 | // Window input state |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 171 | GLboolean stickyKeys; |
| 172 | GLboolean stickyMouseButtons; |
| 173 | GLboolean keyRepeat; |
| 174 | int mousePosX, mousePosY; |
Camilla Berglund | 007766b | 2010-09-27 02:09:54 +0200 | [diff] [blame] | 175 | int scrollX, scrollY; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 176 | char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1]; |
| 177 | char key[GLFW_KEY_LAST + 1]; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 178 | |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 179 | // Framebuffer attributes |
| 180 | int redBits; |
| 181 | int greenBits; |
| 182 | int blueBits; |
| 183 | int alphaBits; |
| 184 | int depthBits; |
| 185 | int stencilBits; |
| 186 | int accumRedBits; |
| 187 | int accumGreenBits; |
| 188 | int accumBlueBits; |
| 189 | int accumAlphaBits; |
| 190 | int auxBuffers; |
| 191 | GLboolean stereo; |
| 192 | int samples; |
| 193 | |
| 194 | // OpenGL extensions and context attributes |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 195 | GLboolean accelerated; // GL_TRUE if OpenGL context is "accelerated" |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 196 | int glMajor, glMinor, glRevision; |
Camilla Berglund | 70b9a1f | 2010-10-25 12:36:14 +0200 | [diff] [blame] | 197 | GLboolean glForward, glDebug; |
| 198 | int glProfile; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 199 | PFNGLGETSTRINGIPROC GetStringi; |
| 200 | |
Camilla Berglund | e9eb841 | 2010-10-14 16:40:10 +0200 | [diff] [blame] | 201 | // These are defined in the current port's platform.h |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 202 | _GLFW_PLATFORM_WINDOW_STATE; |
Camilla Berglund | 3228755 | 2010-09-09 20:36:23 +0200 | [diff] [blame] | 203 | _GLFW_PLATFORM_CONTEXT_STATE; |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 204 | }; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 205 | |
| 206 | |
| 207 | //------------------------------------------------------------------------ |
| 208 | // Library global data |
| 209 | //------------------------------------------------------------------------ |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 210 | struct _GLFWlibrary |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 211 | { |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 212 | _GLFWhints hints; |
Camilla Berglund | 326d997 | 2010-09-10 00:06:23 +0200 | [diff] [blame] | 213 | |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 214 | _GLFWwindow* windowListHead; |
| 215 | _GLFWwindow* currentWindow; |
| 216 | _GLFWwindow* activeWindow; |
| 217 | _GLFWwindow* cursorLockWindow; |
| 218 | |
Camilla Berglund | f1e7d7c | 2010-11-23 17:45:23 +0100 | [diff] [blame] | 219 | GLFWerrorfun errorCallback; |
Camilla Berglund | 4044c2d | 2010-10-24 18:28:55 +0200 | [diff] [blame] | 220 | GLFWwindowsizefun windowSizeCallback; |
| 221 | GLFWwindowclosefun windowCloseCallback; |
| 222 | GLFWwindowrefreshfun windowRefreshCallback; |
| 223 | GLFWwindowfocusfun windowFocusCallback; |
| 224 | GLFWwindowiconifyfun windowIconifyCallback; |
| 225 | GLFWmousebuttonfun mouseButtonCallback; |
| 226 | GLFWmouseposfun mousePosCallback; |
| 227 | GLFWscrollfun scrollCallback; |
| 228 | GLFWkeyfun keyCallback; |
| 229 | GLFWcharfun charCallback; |
| 230 | |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 231 | GLFWgammaramp currentRamp; |
| 232 | GLFWgammaramp originalRamp; |
| 233 | int originalRampSize; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 234 | |
Camilla Berglund | e9eb841 | 2010-10-14 16:40:10 +0200 | [diff] [blame] | 235 | // This is defined in the current port's platform.h |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 236 | _GLFW_PLATFORM_LIBRARY_STATE; |
Camilla Berglund | 99ddce3 | 2010-10-04 18:17:53 +0200 | [diff] [blame] | 237 | }; |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 238 | |
| 239 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 240 | //======================================================================== |
| 241 | // System independent global variables (GLFW internals) |
| 242 | //======================================================================== |
| 243 | |
| 244 | // Flag indicating if GLFW has been initialized |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 245 | #if defined(_init_c_) |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 246 | GLboolean _glfwInitialized = GL_FALSE; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 247 | #else |
Camilla Berglund | 12d17b9 | 2010-09-09 20:18:10 +0200 | [diff] [blame] | 248 | GLFWGLOBAL GLboolean _glfwInitialized; |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 249 | #endif |
| 250 | |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 251 | GLFWGLOBAL _GLFWlibrary _glfwLibrary; |
| 252 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 253 | |
| 254 | //======================================================================== |
| 255 | // Prototypes for platform specific implementation functions |
| 256 | //======================================================================== |
| 257 | |
| 258 | // Init/terminate |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 259 | int _glfwPlatformInit(void); |
| 260 | int _glfwPlatformTerminate(void); |
Camilla Berglund | d6fe447 | 2010-09-13 18:05:59 +0200 | [diff] [blame] | 261 | const char* _glfwPlatformGetVersionString(void); |
Camilla Berglund | f5d74c4 | 2010-09-09 21:06:59 +0200 | [diff] [blame] | 262 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 263 | // Enable/Disable |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 264 | void _glfwPlatformEnableSystemKeys(_GLFWwindow* window); |
| 265 | void _glfwPlatformDisableSystemKeys(_GLFWwindow* window); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 266 | |
| 267 | // Fullscreen |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 268 | int _glfwPlatformGetVideoModes(GLFWvidmode* list, int maxcount); |
| 269 | void _glfwPlatformGetDesktopMode(GLFWvidmode* mode); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 270 | |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 271 | // Gamma ramp |
Camilla Berglund | 85bcd1f | 2010-10-13 22:42:31 +0200 | [diff] [blame] | 272 | void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp); |
Camilla Berglund | 2630d49 | 2010-10-13 04:04:43 +0200 | [diff] [blame] | 273 | void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp); |
| 274 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 275 | // Joystick |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 276 | int _glfwPlatformGetJoystickParam(int joy, int param); |
| 277 | int _glfwPlatformGetJoystickPos(int joy, float* pos, int numaxes); |
| 278 | int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, int numbuttons); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 279 | |
| 280 | // Time |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 281 | double _glfwPlatformGetTime(void); |
| 282 | void _glfwPlatformSetTime(double time); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 283 | |
| 284 | // Window management |
Camilla Berglund | 819d044 | 2010-09-13 23:42:51 +0200 | [diff] [blame] | 285 | int _glfwPlatformOpenWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig); |
Camilla Berglund | 1bac996 | 2010-09-13 23:47:43 +0200 | [diff] [blame] | 286 | void _glfwPlatformMakeWindowCurrent(_GLFWwindow* window); |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 287 | void _glfwPlatformCloseWindow(_GLFWwindow* window); |
| 288 | void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title); |
| 289 | void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height); |
| 290 | void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y); |
| 291 | void _glfwPlatformIconifyWindow(_GLFWwindow* window); |
| 292 | void _glfwPlatformRestoreWindow(_GLFWwindow* window); |
| 293 | void _glfwPlatformHideMouseCursor(_GLFWwindow* window); |
| 294 | void _glfwPlatformShowMouseCursor(_GLFWwindow* window); |
| 295 | void _glfwPlatformSetMouseCursorPos(_GLFWwindow* window, int x, int y); |
| 296 | |
| 297 | // Event management |
| 298 | void _glfwPlatformPollEvents(void); |
| 299 | void _glfwPlatformWaitEvents(void); |
| 300 | |
| 301 | // OpenGL context management |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 302 | void _glfwPlatformSwapBuffers(void); |
| 303 | void _glfwPlatformSwapInterval(int interval); |
| 304 | void _glfwPlatformRefreshWindowParams(void); |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 305 | int _glfwPlatformExtensionSupported(const char* extension); |
| 306 | void* _glfwPlatformGetProcAddress(const char* procname); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 307 | |
| 308 | |
| 309 | //======================================================================== |
| 310 | // Prototypes for platform independent internal functions |
| 311 | //======================================================================== |
| 312 | |
Camilla Berglund | 3089e60 | 2010-09-16 03:48:19 +0200 | [diff] [blame] | 313 | // Fullscren management (fullscreen.c) |
| 314 | void _glfwSplitBPP(int bpp, int* red, int* green, int* blue); |
| 315 | |
Camilla Berglund | d6fe447 | 2010-09-13 18:05:59 +0200 | [diff] [blame] | 316 | // Error handling |
Camilla Berglund | f1e7d7c | 2010-11-23 17:45:23 +0100 | [diff] [blame] | 317 | void _glfwSetError(int error, const char* description); |
Camilla Berglund | d6fe447 | 2010-09-13 18:05:59 +0200 | [diff] [blame] | 318 | |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 319 | // Window management (window.c) |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 320 | void _glfwClearWindowHints(void); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 321 | |
| 322 | // Input handling (window.c) |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 323 | void _glfwInputKey(_GLFWwindow* window, int key, int action); |
Camilla Berglund | 93ea341 | 2010-09-09 19:33:37 +0200 | [diff] [blame] | 324 | void _glfwInputChar(_GLFWwindow* window, int character); |
Camilla Berglund | f93801c | 2010-09-27 02:16:17 +0200 | [diff] [blame] | 325 | void _glfwInputScroll(_GLFWwindow* window, int x, int y); |
Camilla Berglund | 135194a | 2010-09-09 18:15:32 +0200 | [diff] [blame] | 326 | void _glfwInputMouseClick(_GLFWwindow* window, int button, int action); |
Camilla Berglund | bc7a8d4 | 2010-09-19 02:49:42 +0200 | [diff] [blame] | 327 | void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean activated); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 328 | |
| 329 | // OpenGL extensions (glext.c) |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 330 | void _glfwParseGLVersion(int* major, int* minor, int* rev); |
| 331 | int _glfwStringInExtensionString(const char* string, const GLubyte* extensions); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 332 | |
| 333 | // Framebuffer configs |
Camilla Berglund | d46b222 | 2010-09-08 17:30:21 +0200 | [diff] [blame] | 334 | const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, |
| 335 | const _GLFWfbconfig* alternatives, |
| 336 | unsigned int count); |
Camilla Berglund | 3249f81 | 2010-09-07 17:34:51 +0200 | [diff] [blame] | 337 | |
| 338 | |
| 339 | #endif // _internal_h_ |