Loading...
Searching...
No Matches
glfw3native.h
Go to the documentation of this file.
/*************************************************************************
* GLFW 3.5 - www.glfw.org
* A library for OpenGL, window and input
*------------------------------------------------------------------------
* Copyright (c) 2002-2006 Marcus Geelnard
* Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would
* be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and must not
* be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*
*************************************************************************/
#ifndef _glfw3_native_h_
#define _glfw3_native_h_
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
* Doxygen documentation
*************************************************************************/
/*************************************************************************
* System headers and types
*************************************************************************/
#if !defined(GLFW_NATIVE_INCLUDE_NONE)
#if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
/* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
* example to allow applications to correctly declare a GL_KHR_debug callback)
* but windows.h assumes no one will define APIENTRY before it does
*/
#if defined(GLFW_APIENTRY_DEFINED)
#undef APIENTRY
#undef GLFW_APIENTRY_DEFINED
#endif
#include <windows.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
#if defined(__OBJC__)
#import <Cocoa/Cocoa.h>
#else
#include <ApplicationServices/ApplicationServices.h>
#include <objc/objc.h>
#endif
#endif
#if defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
#include <wayland-client.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)
/* WGL is declared by windows.h */
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
/* NSGL is declared by Cocoa.h */
#endif
#if defined(GLFW_EXPOSE_NATIVE_GLX)
/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
* default it also acts as an OpenGL header
* However, glx.h will include gl.h, which will define it unconditionally
*/
#if defined(GLFW_GLAPIENTRY_DEFINED)
#undef GLAPIENTRY
#undef GLFW_GLAPIENTRY_DEFINED
#endif
#include <GL/glx.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_EGL)
#include <EGL/egl.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
* default it also acts as an OpenGL header
* However, osmesa.h will include gl.h, which will define it unconditionally
*/
#if defined(GLFW_GLAPIENTRY_DEFINED)
#undef GLAPIENTRY
#undef GLFW_GLAPIENTRY_DEFINED
#endif
#include <GL/osmesa.h>
#endif
#endif /*GLFW_NATIVE_INCLUDE_NONE*/
/*************************************************************************
* Functions
*************************************************************************/
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WGL)
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
GLFWAPI id glfwGetCocoaView(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_X11)
GLFWAPI Display* glfwGetX11Display(void);
GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
GLFWAPI void glfwSetX11SelectionString(const char* string);
GLFWAPI const char* glfwGetX11SelectionString(void);
#endif
#if defined(GLFW_EXPOSE_NATIVE_GLX)
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
GLFWAPI int glfwGetGLXFBConfig(GLFWwindow* window, GLXFBConfig* config);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_EGL)
GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
GLFWAPI int glfwGetEGLConfig(GLFWwindow* window, EGLConfig* config);
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _glfw3_native_h_ */
GLFWmonitor
struct GLFWmonitor GLFWmonitor
Opaque monitor object.
Definition glfw3.h:1396
glfwGetX11Adapter
RRCrtc glfwGetX11Adapter(GLFWmonitor *monitor)
Returns the RRCrtc of the specified monitor.
glfwGetEGLDisplay
EGLDisplay glfwGetEGLDisplay(void)
Returns the EGLDisplay used by GLFW.
glfwGetGLXWindow
GLXWindow glfwGetGLXWindow(GLFWwindow *window)
Returns the GLXWindow of the specified window.
glfwGetEGLSurface
EGLSurface glfwGetEGLSurface(GLFWwindow *window)
Returns the EGLSurface of the specified window.
glfwGetOSMesaColorBuffer
int glfwGetOSMesaColorBuffer(GLFWwindow *window, int *width, int *height, int *format, void **buffer)
Retrieves the color buffer associated with the specified window.
glfwGetWaylandMonitor
struct wl_output * glfwGetWaylandMonitor(GLFWmonitor *monitor)
Returns the struct wl_output* of the specified monitor.
glfwGetNSGLContext
id glfwGetNSGLContext(GLFWwindow *window)
Returns the NSOpenGLContext of the specified window.
glfwSetX11SelectionString
void glfwSetX11SelectionString(const char *string)
Sets the current primary selection to the specified string.
glfwGetWaylandWindow
struct wl_surface * glfwGetWaylandWindow(GLFWwindow *window)
Returns the main struct wl_surface* of the specified window.
glfwGetGLXContext
GLXContext glfwGetGLXContext(GLFWwindow *window)
Returns the GLXContext of the specified window.
glfwGetEGLContext
EGLContext glfwGetEGLContext(GLFWwindow *window)
Returns the EGLContext of the specified window.
glfwGetOSMesaDepthBuffer
int glfwGetOSMesaDepthBuffer(GLFWwindow *window, int *width, int *height, int *bytesPerValue, void **buffer)
Retrieves the depth buffer associated with the specified window.
glfwGetX11Display
Display * glfwGetX11Display(void)
Returns the Display used by GLFW.
glfwGetCocoaView
id glfwGetCocoaView(GLFWwindow *window)
Returns the NSView of the specified window.
glfwGetX11Window
Window glfwGetX11Window(GLFWwindow *window)
Returns the Window of the specified window.
glfwGetOSMesaContext
OSMesaContext glfwGetOSMesaContext(GLFWwindow *window)
Returns the OSMesaContext of the specified window.
glfwGetEGLConfig
int glfwGetEGLConfig(GLFWwindow *window, EGLConfig *config)
Retrieves the EGLConfig of the specified window's EGLSurface.
glfwGetX11Monitor
RROutput glfwGetX11Monitor(GLFWmonitor *monitor)
Returns the RROutput of the specified monitor.
glfwGetCocoaWindow
id glfwGetCocoaWindow(GLFWwindow *window)
Returns the NSWindow of the specified window.
glfwGetWin32Monitor
const char * glfwGetWin32Monitor(GLFWmonitor *monitor)
Returns the display device name of the specified monitor.
glfwGetWaylandDisplay
struct wl_display * glfwGetWaylandDisplay(void)
Returns the struct wl_display* used by GLFW.
glfwGetWin32Adapter
const char * glfwGetWin32Adapter(GLFWmonitor *monitor)
Returns the adapter device name of the specified monitor.
glfwGetGLXFBConfig
int glfwGetGLXFBConfig(GLFWwindow *window, GLXFBConfig *config)
Retrieves the GLXFBConfig of the specified window's GLXWindow.
glfwGetWGLContext
HGLRC glfwGetWGLContext(GLFWwindow *window)
Returns the HGLRC of the specified window.
glfwGetX11SelectionString
const char * glfwGetX11SelectionString(void)
Returns the contents of the current primary selection as a string.
glfwGetCocoaMonitor
CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor *monitor)
Returns the CGDirectDisplayID of the specified monitor.
glfwGetWin32Window
HWND glfwGetWin32Window(GLFWwindow *window)
Returns the HWND of the specified window.
GLFWwindow
struct GLFWwindow GLFWwindow
Opaque window object.
Definition glfw3.h:1408