GLFW  3.0.1
A multi-platform library for OpenGL, window and input
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
glfw3native.h
Go to the documentation of this file.
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_native_h_
31 #define _glfw3_native_h_
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 
38 /*************************************************************************
39  * Doxygen documentation
40  *************************************************************************/
41 
70 /*************************************************************************
71  * System headers and types
72  *************************************************************************/
73 
74 #if defined(GLFW_EXPOSE_NATIVE_WIN32)
75  #include <windows.h>
76 #elif defined(GLFW_EXPOSE_NATIVE_COCOA)
77  #if defined(__OBJC__)
78  #import <Cocoa/Cocoa.h>
79  #else
80  typedef void* id;
81  #endif
82 #elif defined(GLFW_EXPOSE_NATIVE_X11)
83  #include <X11/Xlib.h>
84 #else
85  #error "No window API specified"
86 #endif
87 
88 #if defined(GLFW_EXPOSE_NATIVE_WGL)
89  /* WGL is declared by windows.h */
90 #elif defined(GLFW_EXPOSE_NATIVE_NSGL)
91  /* NSGL is declared by Cocoa.h */
92 #elif defined(GLFW_EXPOSE_NATIVE_GLX)
93  #include <GL/glx.h>
94 #elif defined(GLFW_EXPOSE_NATIVE_EGL)
95  #include <EGL/egl.h>
96 #else
97  #error "No context API specified"
98 #endif
99 
100 
101 /*************************************************************************
102  * Functions
103  *************************************************************************/
104 
105 #if defined(GLFW_EXPOSE_NATIVE_WIN32)
106 
110 GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
111 #endif
112 
113 #if defined(GLFW_EXPOSE_NATIVE_WGL)
114 
118 GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
119 #endif
120 
121 #if defined(GLFW_EXPOSE_NATIVE_COCOA)
122 
126 GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
127 #endif
128 
129 #if defined(GLFW_EXPOSE_NATIVE_NSGL)
130 
134 GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
135 #endif
136 
137 #if defined(GLFW_EXPOSE_NATIVE_X11)
138 
142 GLFWAPI Display* glfwGetX11Display(void);
147 GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
148 #endif
149 
150 #if defined(GLFW_EXPOSE_NATIVE_GLX)
151 
155 GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
156 #endif
157 
158 #if defined(GLFW_EXPOSE_NATIVE_EGL)
159 
163 GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
168 GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
173 GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
174 #endif
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif /* _glfw3_native_h_ */
181