blob: b8b01f9ab20a6e2b6e62cca08132c9f9a066409f [file] [log] [blame]
Camilla Berglundd83119a2012-07-22 15:24:35 +02001/*************************************************************************
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
34extern "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
74GLFWAPI HWND glfwGetWin32Window(GLFWwindow window);
75GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow window);
76
77#elif defined(GLFW_EXPOSE_NATIVE_COCOA_NSGL)
78
79GLFWAPI id glfwGetCocoaWindow(GLFWwindow window);
80GLFWAPI id glfwGetNSGLContext(GLFWwindow window);
81
82#elif defined(GLFW_EXPOSE_NATIVE_X11_GLX)
83
84GLFWAPI Display* glfwGetX11Display(void);
85
86GLFWAPI Window glfwGetX11Window(GLFWwindow window);
87GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow window);
88
89#endif
90
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif /* __glfw3_platform_h__ */
97