glfw3native.h
Go to the documentation of this file.
1 /*************************************************************************
2  * GLFW 3.0 - www.glfw.org
3  * A library for OpenGL, window and input
4  *------------------------------------------------------------------------
5  * Copyright (c) 2002-2006 Marcus Geelnard
6  * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
7  *
8  * This software is provided 'as-is', without any express or implied
9  * warranty. In no event will the authors be held liable for any damages
10  * arising from the use of this software.
11  *
12  * Permission is granted to anyone to use this software for any purpose,
13  * including commercial applications, and to alter it and redistribute it
14  * freely, subject to the following restrictions:
15  *
16  * 1. The origin of this software must not be misrepresented; you must not
17  * claim that you wrote the original software. If you use this software
18  * in a product, an acknowledgment in the product documentation would
19  * be appreciated but is not required.
20  *
21  * 2. Altered source versions must be plainly marked as such, and must not
22  * be misrepresented as being the original software.
23  *
24  * 3. This notice may not be removed or altered from any source
25  * distribution.
26  *
27  *************************************************************************/
28 
29 #ifndef _glfw3_native_h_
30 #define _glfw3_native_h_
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 
37 /*************************************************************************
38  * Doxygen documentation
39  *************************************************************************/
40 
69 /*************************************************************************
70  * System headers and types
71  *************************************************************************/
72 
73 #if defined(GLFW_EXPOSE_NATIVE_WIN32)
74  #include <windows.h>
75 #elif defined(GLFW_EXPOSE_NATIVE_COCOA)
76  #if defined(__OBJC__)
77  #import <Cocoa/Cocoa.h>
78  #else
79  typedef void* id;
80  #endif
81 #elif defined(GLFW_EXPOSE_NATIVE_X11)
82  #include <X11/Xlib.h>
83 #else
84  #error "No window API specified"
85 #endif
86 
87 #if defined(GLFW_EXPOSE_NATIVE_WGL)
88  /* WGL is declared by windows.h */
89 #elif defined(GLFW_EXPOSE_NATIVE_NSGL)
90  /* NSGL is declared by Cocoa.h */
91 #elif defined(GLFW_EXPOSE_NATIVE_GLX)
92  #include <GL/glx.h>
93 #elif defined(GLFW_EXPOSE_NATIVE_EGL)
94  #include <EGL/egl.h>
95 #else
96  #error "No context API specified"
97 #endif
98 
99 
100 /*************************************************************************
101  * Functions
102  *************************************************************************/
103 
104 #if defined(GLFW_EXPOSE_NATIVE_WIN32)
105 
109 GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
110 #endif
111 
112 #if defined(GLFW_EXPOSE_NATIVE_WGL)
113 
117 GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
118 #endif
119 
120 #if defined(GLFW_EXPOSE_NATIVE_COCOA)
121 
125 GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
126 #endif
127 
128 #if defined(GLFW_EXPOSE_NATIVE_NSGL)
129 
133 GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
134 #endif
135 
136 #if defined(GLFW_EXPOSE_NATIVE_X11)
137 
141 GLFWAPI Display* glfwGetX11Display(void);
146 GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
147 #endif
148 
149 #if defined(GLFW_EXPOSE_NATIVE_GLX)
150 
154 GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
155 #endif
156 
157 #if defined(GLFW_EXPOSE_NATIVE_EGL)
158 
162 GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
167 GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
172 GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
173 #endif
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif /* _glfw3_native_h_ */
180 
HGLRC glfwGetWGLContext(GLFWwindow *window)
Returns the HGLRC of the specified window.
id glfwGetCocoaWindow(GLFWwindow *window)
Returns the NSWindow of the specified window.
EGLSurface glfwGetEGLSurface(GLFWwindow *window)
Returns the EGLSurface of the specified window.
HWND glfwGetWin32Window(GLFWwindow *window)
Returns the HWND of the specified window.
id glfwGetNSGLContext(GLFWwindow *window)
Returns the NSOpenGLContext of the specified window.
EGLDisplay glfwGetEGLDisplay(void)
Returns the EGLDisplay used by GLFW.
Window glfwGetX11Window(GLFWwindow *window)
Returns the Window of the specified window.
struct GLFWwindow GLFWwindow
Opaque window object.
Definition: glfw3.h:574
Display * glfwGetX11Display(void)
Returns the Display used by GLFW.
GLXContext glfwGetGLXContext(GLFWwindow *window)
Returns the GLXContext of the specified window.
EGLContext glfwGetEGLContext(GLFWwindow *window)
Returns the EGLContext of the specified window.