By using the native access functions you assert that you know what you're doing and how to fix problems caused by using them. If you don't, you shouldn't be using them.
Before the inclusion of glfw3native.h, you may define exactly one window system API macro and zero or more context creation API macros.
The chosen backends must match those the library was compiled for. Failure to do this will cause a link-time error.
The available window API macros are:
GLFW_EXPOSE_NATIVE_WIN32
GLFW_EXPOSE_NATIVE_COCOA
GLFW_EXPOSE_NATIVE_X11
GLFW_EXPOSE_NATIVE_WAYLAND
GLFW_EXPOSE_NATIVE_MIR
The available context API macros are:
GLFW_EXPOSE_NATIVE_WGL
GLFW_EXPOSE_NATIVE_NSGL
GLFW_EXPOSE_NATIVE_GLX
GLFW_EXPOSE_NATIVE_EGL
These macros select which of the native access functions that are declared and which platform-specific headers to include. It is then up your (by definition platform-specific) code to handle which of these should be defined.
CGDirectDisplayID glfwGetCocoaMonitor |
( |
GLFWmonitor * |
monitor | ) |
|
- Returns
- The
CGDirectDisplayID
of the specified monitor, or kCGNullDirectDisplay
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.1.
- Returns
- The
NSWindow
of the specified window, or nil
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
EGLContext glfwGetEGLContext |
( |
GLFWwindow * |
window | ) |
|
- Returns
- The
EGLContext
of the specified window, or EGL_NO_CONTEXT
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
EGLDisplay glfwGetEGLDisplay |
( |
void |
| ) |
|
- Returns
- The
EGLDisplay
used by GLFW, or EGL_NO_DISPLAY
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
EGLSurface glfwGetEGLSurface |
( |
GLFWwindow * |
window | ) |
|
- Returns
- The
EGLSurface
of the specified window, or EGL_NO_SURFACE
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
GLXContext glfwGetGLXContext |
( |
GLFWwindow * |
window | ) |
|
- Returns
- The
GLXContext
of the specified window, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
- Returns
- The
GLXWindow
of the specified window, or None
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
MirConnection* glfwGetMirDisplay |
( |
void |
| ) |
|
- Returns
- The
MirConnection*
used by GLFW, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
- Returns
- The Mir output ID of the specified monitor, or zero if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
MirSurface* glfwGetMirWindow |
( |
GLFWwindow * |
window | ) |
|
- Returns
- The
MirSurface*
of the specified window, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
- Returns
- The
NSOpenGLContext
of the specified window, or nil
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
struct wl_display* glfwGetWaylandDisplay |
( |
void |
| ) |
|
- Returns
- The
struct wl_display*
used by GLFW, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
struct wl_output* glfwGetWaylandMonitor |
( |
GLFWmonitor * |
monitor | ) |
|
- Returns
- The
struct wl_output*
of the specified monitor, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
struct wl_surface* glfwGetWaylandWindow |
( |
GLFWwindow * |
window | ) |
|
- Returns
- The main
struct wl_surface*
of the specified window, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.2.
- Returns
- The
HGLRC
of the specified window, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
const char* glfwGetWin32Adapter |
( |
GLFWmonitor * |
monitor | ) |
|
- Returns
- The UTF-8 encoded adapter device name (for example
\\.\DISPLAY1
) of the specified monitor, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.1.
const char* glfwGetWin32Monitor |
( |
GLFWmonitor * |
monitor | ) |
|
- Returns
- The UTF-8 encoded display device name (for example
\\.\DISPLAY1\Monitor0
) of the specified monitor, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.1.
- Returns
- The
HWND
of the specified window, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
- Returns
- The
RRCrtc
of the specified monitor, or None
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.1.
Display* glfwGetX11Display |
( |
void |
| ) |
|
- Returns
- The
Display
used by GLFW, or NULL
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.
- Returns
- The
RROutput
of the specified monitor, or None
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.1.
- Returns
- The
Window
of the specified window, or None
if an error occurred.
- Thread safety
- This function may be called from any thread. Access is not synchronized.
- Since
- Added in version 3.0.