Camilla Berglund | d83119a | 2012-07-22 15:24:35 +0200 | [diff] [blame] | 1 | /************************************************************************* |
| 2 | * GLFW - An OpenGL library |
| 3 | * API version: 3.0 |
| 4 | * WWW: http://www.glfw.org/ |
| 5 | *------------------------------------------------------------------------ |
| 6 | * Copyright (c) 2002-2006 Marcus Geelnard |
| 7 | * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org> |
| 8 | * |
| 9 | * This software is provided 'as-is', without any express or implied |
| 10 | * warranty. In no event will the authors be held liable for any damages |
| 11 | * arising from the use of this software. |
| 12 | * |
| 13 | * Permission is granted to anyone to use this software for any purpose, |
| 14 | * including commercial applications, and to alter it and redistribute it |
| 15 | * freely, subject to the following restrictions: |
| 16 | * |
| 17 | * 1. The origin of this software must not be misrepresented; you must not |
| 18 | * claim that you wrote the original software. If you use this software |
| 19 | * in a product, an acknowledgment in the product documentation would |
| 20 | * be appreciated but is not required. |
| 21 | * |
| 22 | * 2. Altered source versions must be plainly marked as such, and must not |
| 23 | * be misrepresented as being the original software. |
| 24 | * |
| 25 | * 3. This notice may not be removed or altered from any source |
| 26 | * distribution. |
| 27 | * |
| 28 | *************************************************************************/ |
| 29 | |
| 30 | #ifndef __glfw3_platform_h__ |
| 31 | #define __glfw3_platform_h__ |
| 32 | |
| 33 | #ifdef __cplusplus |
| 34 | extern "C" { |
| 35 | #endif |
| 36 | |
| 37 | |
| 38 | /************************************************************************* |
| 39 | * System headers and types |
| 40 | *************************************************************************/ |
| 41 | |
| 42 | #if defined(GLFW_EXPOSE_NATIVE_WIN32_WGL) |
| 43 | |
| 44 | /* We are building for Win32 and WGL */ |
| 45 | #include <windows.h> |
| 46 | |
| 47 | #elif defined(GLFW_EXPOSE_NATIVE_COCOA_NSGL) |
| 48 | |
| 49 | /* We are building for Cocoa and NSOpenGL */ |
| 50 | #if defined(__OBJC__) |
| 51 | #import <Cocoa/Cocoa.h> |
| 52 | #else |
| 53 | typedef void* id; |
| 54 | #endif |
| 55 | |
| 56 | #elif defined(GLFW_EXPOSE_NATIVE_X11_GLX) |
| 57 | |
| 58 | /* We are building for X11 and GLX */ |
| 59 | #include <X11/Xlib.h> |
| 60 | |
| 61 | #else |
| 62 | |
| 63 | #error "No platform specified" |
| 64 | |
| 65 | #endif |
| 66 | |
| 67 | |
| 68 | /************************************************************************* |
| 69 | * Functions |
| 70 | *************************************************************************/ |
| 71 | |
| 72 | #if defined(GLFW_EXPOSE_NATIVE_WIN32_WGL) |
| 73 | |
| 74 | GLFWAPI HWND glfwGetWin32Window(GLFWwindow window); |
| 75 | GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow window); |
| 76 | |
| 77 | #elif defined(GLFW_EXPOSE_NATIVE_COCOA_NSGL) |
| 78 | |
| 79 | GLFWAPI id glfwGetCocoaWindow(GLFWwindow window); |
| 80 | GLFWAPI id glfwGetNSGLContext(GLFWwindow window); |
| 81 | |
| 82 | #elif defined(GLFW_EXPOSE_NATIVE_X11_GLX) |
| 83 | |
| 84 | GLFWAPI Display* glfwGetX11Display(void); |
| 85 | |
| 86 | GLFWAPI Window glfwGetX11Window(GLFWwindow window); |
| 87 | GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow window); |
| 88 | |
| 89 | #endif |
| 90 | |
| 91 | |
| 92 | #ifdef __cplusplus |
| 93 | } |
| 94 | #endif |
| 95 | |
| 96 | #endif /* __glfw3_platform_h__ */ |
| 97 | |