Finished initial window/context backend split.

This commit is contained in:
Camilla Berglund 2012-11-27 15:02:26 +01:00
parent 4ce92262f7
commit 34d383399c
14 changed files with 191 additions and 113 deletions

View File

@ -19,6 +19,10 @@ option(GLFW_USE_EGL "Build for EGL and OpenGL ES platform (Currently only X11)"
if (GLFW_USE_EGL) if (GLFW_USE_EGL)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/modules) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/modules)
find_package(EGL REQUIRED) find_package(EGL REQUIRED)
set(GLFW_BUILD_EXAMPLES OFF)
set(GLFW_BUILD_TESTS OFF)
message(STATUS "NOTE: Examples and tests are disabled for EGL")
else() else()
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
endif() endif()
@ -47,25 +51,39 @@ if (BUILD_SHARED_LIBS)
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Detect and select target platform # Detect and select target APIs
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (WIN32) if (WIN32)
set(_GLFW_WIN32_WGL 1) set(_GLFW_WIN32 1)
message(STATUS "Building GLFW for WGL on a Win32 system") message(STATUS "Using Win32 for window creation")
elseif (UNIX AND APPLE)
set(_GLFW_COCOA_NSGL 1)
message(STATUS "Building GLFW for Cocoa and NSOpenGL on Mac OS X")
elseif (UNIX AND NOT APPLE)
set(_GLFW_X11 1)
if (GLFW_USE_EGL) if (GLFW_USE_EGL)
set(_GLFW_X11_EGL 1) set(_GLFW_EGL 1)
set(GLFW_BUILD_EXAMPLES 0) message(STATUS "Using EGL for context creation")
set(GLFW_BUILD_TESTS 0)
message(STATUS "Building GLFW for X11 and EGL on a Unix-like system")
message(STATUS "NOTE: Examples and tests are disabled for EGL")
else() else()
set(_GLFW_X11_GLX 1) set(_GLFW_WGL 1)
message(STATUS "Building GLFW for X11 and GLX on a Unix-like system") message(STATUS "Using WGL for context creation")
endif()
elseif (APPLE)
set(_GLFW_COCOA 1)
message(STATUS "Using Cocoa for window creation")
if (GLFW_USE_EGL)
message(FATAL_ERROR "EGL not supported on Mac OS X")
else()
set(_GLFW_NSGL 1)
message(STATUS "Using NSGL for context creation")
endif()
elseif (UNIX)
set(_GLFW_X11 1)
message(STATUS "Using X11 for window creation")
if (GLFW_USE_EGL)
set(_GLFW_EGL 1)
message(STATUS "Using EGL for context creation")
else()
set(_GLFW_GLX 1)
message(STATUS "Using GLX for context creation")
endif() endif()
else() else()
message(FATAL_ERROR "No supported platform was detected") message(FATAL_ERROR "No supported platform was detected")
@ -74,7 +92,7 @@ endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Set up GLFW for Win32 and WGL on Windows # Set up GLFW for Win32 and WGL on Windows
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_WIN32_WGL) if (_GLFW_WIN32)
# Set up library and include paths # Set up library and include paths
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
@ -160,16 +178,12 @@ if (_GLFW_X11)
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm")
endif() endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(_GLFW_USE_LINUX_JOYSTICKS 1)
endif()
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# GLX Context # GLX Context
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_X11_GLX) if (_GLFW_GLX)
# Set up library and include paths # Set up library and include paths
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
@ -223,18 +237,19 @@ endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# EGL Context # EGL Context
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_X11_EGL) if (_GLFW_EGL)
# Set up library and include paths # Set up library and include paths
list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR})
list(APPEND glfw_LIBRARIES ${EGL_LIBRARY}) list(APPEND glfw_LIBRARIES ${EGL_LIBRARY})
set(CMAKE_REQUIRED_LIBRARIES ${EGL_LIBRARY})
if (_GLFW_X11)
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl")
include(CheckFunctionExists) include(CheckFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES ${EGL_LIBRARY})
check_function_exists(eglGetProcAddress _GLFW_HAS_EGLGETPROCADDRESS) check_function_exists(eglGetProcAddress _GLFW_HAS_EGLGETPROCADDRESS)
if (NOT _GLFW_HAS_EGLGETPROCADDRESS) if (NOT _GLFW_HAS_EGLGETPROCADDRESS)
@ -261,13 +276,14 @@ if (_GLFW_X11_EGL)
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl")
endif() endif()
endif() endif()
endif()
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Set up GLFW for Cocoa and NSOpenGL on Mac OS X # Set up GLFW for Cocoa and NSOpenGL on Mac OS X
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_COCOA_NSGL) if (_GLFW_COCOA AND _GLFW_NSGL)
option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF) option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF)
@ -349,7 +365,7 @@ install(FILES COPYING.txt readme.html
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Create and install pkg-config file on supported platforms # Create and install pkg-config file on supported platforms
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_X11_GLX OR _GLFW_COCOA_NSGL) if (UNIX)
configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in
${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY)

View File

@ -10,11 +10,11 @@ set(common_HEADERS ${GLFW_SOURCE_DIR}/include/GL/glfw3.h internal.h)
set(common_SOURCES clipboard.c fullscreen.c gamma.c init.c input.c set(common_SOURCES clipboard.c fullscreen.c gamma.c init.c input.c
joystick.c opengl.c time.c window.c) joystick.c opengl.c time.c window.c)
if (_GLFW_COCOA_NSGL) if (_GLFW_COCOA)
set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h) set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h)
set(glfw_SOURCES ${common_SOURCES} cocoa_clipboard.m cocoa_fullscreen.m set(glfw_SOURCES ${common_SOURCES} cocoa_clipboard.m cocoa_fullscreen.m
cocoa_gamma.c cocoa_init.m cocoa_joystick.m cocoa_gamma.c cocoa_init.m cocoa_joystick.m cocoa_time.c
cocoa_opengl.m cocoa_time.c cocoa_window.m) cocoa_window.m)
if (GLFW_NATIVE_API) if (GLFW_NATIVE_API)
list(APPEND glfw_SOURCES cocoa_native.m) list(APPEND glfw_SOURCES cocoa_native.m)
@ -22,30 +22,38 @@ if (_GLFW_COCOA_NSGL)
# For some reason, CMake doesn't know about .m # For some reason, CMake doesn't know about .m
set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C) set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
elseif (_GLFW_WIN32_WGL) elseif (_GLFW_WIN32)
set(glfw_HEADERS ${common_HEADERS} win32_platform.h) set(glfw_HEADERS ${common_HEADERS} win32_platform.h)
set(glfw_SOURCES ${common_SOURCES} wgl_opengl.c win32_clipboard.c set(glfw_SOURCES ${common_SOURCES} win32_clipboard.c win32_fullscreen.c
win32_fullscreen.c win32_gamma.c win32_init.c win32_gamma.c win32_init.c win32_joystick.c win32_time.c
win32_joystick.c win32_time.c win32_window.c) win32_window.c)
if (GLFW_NATIVE_API) if (GLFW_NATIVE_API)
list(APPEND glfw_SOURCES win32_native.c) list(APPEND glfw_SOURCES win32_native.c)
endif() endif()
elseif (_GLFW_X11_GLX) elseif (_GLFW_X11)
set(glfw_HEADERS ${common_HEADERS} x11_platform.h) set(glfw_HEADERS ${common_HEADERS} x11_platform.h)
set(glfw_SOURCES ${common_SOURCES} glx_opengl.c x11_clipboard.c set(glfw_SOURCES ${common_SOURCES} x11_clipboard.c x11_fullscreen.c
x11_fullscreen.c x11_gamma.c x11_init.c x11_joystick.c x11_gamma.c x11_init.c x11_joystick.c x11_keysym2unicode.c
x11_keysym2unicode.c x11_time.c x11_window.c) x11_time.c x11_window.c)
if (GLFW_NATIVE_API) if (GLFW_NATIVE_API)
list(APPEND glfw_SOURCES x11_native.c) list(APPEND glfw_SOURCES x11_native.c)
endif() endif()
elseif (_GLFW_X11_EGL) endif()
set(glfw_HEADERS ${common_HEADERS} x11_platform.h egl_platform.h)
set(glfw_SOURCES ${common_SOURCES} egl_opengl.c x11_clipboard.c if (_GLFW_EGL)
x11_fullscreen.c x11_gamma.c x11_init.c list(APPEND glfw_HEADERS ${common_HEADERS} egl_platform.h)
x11_joystick.c x11_keysym2unicode.c x11_time.c list(APPEND glfw_SOURCES ${common_SOURCES} egl_opengl.c)
x11_window.c) elseif (_GLFW_NSGL)
list(APPEND glfw_HEADERS ${common_HEADERS} nsgl_platform.h)
list(APPEND glfw_SOURCES ${common_SOURCES} nsgl_opengl.c)
elseif (_GLFW_WGL)
list(APPEND glfw_HEADERS ${common_HEADERS} wgl_platform.h)
list(APPEND glfw_SOURCES ${common_SOURCES} wgl_opengl.c)
elseif (_GLFW_X11)
list(APPEND glfw_HEADERS ${common_HEADERS} glx_platform.h)
list(APPEND glfw_SOURCES ${common_SOURCES} glx_opengl.c)
endif() endif()
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
@ -58,7 +66,7 @@ if (BUILD_SHARED_LIBS)
set_target_properties(glfw PROPERTIES SOVERSION ${GLFW_VERSION_MAJOR}) set_target_properties(glfw PROPERTIES SOVERSION ${GLFW_VERSION_MAJOR})
endif() endif()
if (_GLFW_WIN32_WGL) if (_GLFW_WIN32)
# The GLFW DLL needs a special compile-time macro and import library name # The GLFW DLL needs a special compile-time macro and import library name
set_target_properties(glfw PROPERTIES PREFIX "" IMPORT_PREFIX "") set_target_properties(glfw PROPERTIES PREFIX "" IMPORT_PREFIX "")
@ -67,7 +75,7 @@ if (BUILD_SHARED_LIBS)
else() else()
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib") set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
endif() endif()
elseif (_GLFW_COCOA_NSGL) elseif (_GLFW_COCOA)
# Append -fno-common to the compile flags to work around a bug in the Apple GCC # Append -fno-common to the compile flags to work around a bug in the Apple GCC
get_target_property(glfw_CFLAGS glfw COMPILE_FLAGS) get_target_property(glfw_CFLAGS glfw COMPILE_FLAGS)
if (NOT glfw_CFLAGS) if (NOT glfw_CFLAGS)

View File

@ -1,6 +1,6 @@
//======================================================================== //========================================================================
// GLFW - An OpenGL library // GLFW - An OpenGL library
// Platform: Cocoa/NSOpenGL // Platform: Cocoa
// API Version: 3.0 // API Version: 3.0
// WWW: http://www.glfw.org/ // WWW: http://www.glfw.org/
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -27,13 +27,12 @@
// //
//======================================================================== //========================================================================
#ifndef _platform_h_ #ifndef _cocoa_platform_h_
#define _platform_h_ #define _cocoa_platform_h_
#include <stdint.h> #include <stdint.h>
#if defined(__OBJC__) #if defined(__OBJC__)
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#else #else
@ -41,12 +40,13 @@
typedef void* id; typedef void* id;
#endif #endif
#if defined(_GLFW_NSGL)
#include "nsgl_platform.h"
#endif
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS NS #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS NS
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS NS #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS NS
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL NSGL
#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryNSGL NSGL
//======================================================================== //========================================================================
// GLFW platform specific types // GLFW platform specific types
@ -58,16 +58,6 @@ typedef void* id;
typedef intptr_t GLFWintptr; typedef intptr_t GLFWintptr;
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextNSGL
{
id pixelFormat;
id context;
} _GLFWcontextNSGL;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Platform-specific window structure // Platform-specific window structure
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@ -99,16 +89,6 @@ typedef struct _GLFWlibraryNS
} _GLFWlibraryNS; } _GLFWlibraryNS;
//------------------------------------------------------------------------
// Platform-specific library global data for NSGL
//------------------------------------------------------------------------
typedef struct _GLFWlibraryNSGL
{
// dlopen handle for dynamically loading OpenGL extension entry points
void* framework;
} _GLFWlibraryNSGL;
//======================================================================== //========================================================================
// Prototypes for platform specific internal functions // Prototypes for platform specific internal functions
//======================================================================== //========================================================================
@ -128,4 +108,4 @@ void _glfwRestoreVideoMode(void);
int _glfwInitOpenGL(void); int _glfwInitOpenGL(void);
void _glfwTerminateOpenGL(void); void _glfwTerminateOpenGL(void);
#endif // _platform_h_ #endif // _cocoa_platform_h_

View File

@ -35,14 +35,21 @@
// it. Instead, you should modify the config.h.in file. // it. Instead, you should modify the config.h.in file.
//======================================================================== //========================================================================
// Define this to 1 if building GLFW for X11/GLX // Define this to 1 if building GLFW for X11
#cmakedefine _GLFW_X11_GLX #cmakedefine _GLFW_X11
// Define this to 1 if building GLFW for X11/EGL // Define this to 1 if building GLFW for Win32
#cmakedefine _GLFW_X11_EGL #cmakedefine _GLFW_WIN32
// Define this to 1 if building GLFW for Win32/WGL // Define this to 1 if building GLFW for Cocoa
#cmakedefine _GLFW_WIN32_WGL #cmakedefine _GLFW_COCOA
// Define this to 1 if building GLFW for Cocoa/NSOpenGL
#cmakedefine _GLFW_COCOA_NSGL // Define this to 1 if building GLFW for EGL
#cmakedefine _GLFW_EGL
// Define this to 1 if building GLFW for GLX
#cmakedefine _GLFW_GLX
// Define this to 1 if building GLFW for WGL
#cmakedefine _GLFW_WGL
// Define this to 1 if building GLFW for NSGL
#cmakedefine _GLFW_NSGL
// Define this to 1 if building as a shared library / dynamic library / DLL // Define this to 1 if building as a shared library / dynamic library / DLL
#cmakedefine _GLFW_BUILD_DLL #cmakedefine _GLFW_BUILD_DLL

View File

@ -208,7 +208,7 @@ static int createContext(_GLFWwindow* window,
// Retrieve the corresponding visual // Retrieve the corresponding visual
// NOTE: This is the only non-portable code in this file. // NOTE: This is the only non-portable code in this file.
// Maybe it would not hurt too much to add #ifdefs for different platforms? // Maybe it would not hurt too much to add #ifdefs for different platforms?
#if defined(_GLFW_X11_EGL) #if defined(_GLFW_X11)
{ {
int mask; int mask;
EGLint redBits, greenBits, blueBits, alphaBits, visualID = 0; EGLint redBits, greenBits, blueBits, alphaBits, visualID = 0;

View File

@ -71,7 +71,7 @@ typedef struct _GLFWcontextEGL
EGLContext context; EGLContext context;
EGLSurface surface; EGLSurface surface;
#if defined(_GLFW_X11_EGL) #if defined(_GLFW_X11)
XVisualInfo* visual; XVisualInfo* visual;
#endif #endif
} _GLFWcontextEGL; } _GLFWcontextEGL;

View File

@ -65,11 +65,11 @@ typedef struct _GLFWlibrary _GLFWlibrary;
// extensions and not all operating systems come with an up-to-date version // extensions and not all operating systems come with an up-to-date version
#include "../support/GL/glext.h" #include "../support/GL/glext.h"
#if defined(_GLFW_COCOA_NSGL) #if defined(_GLFW_COCOA)
#include "cocoa_platform.h" #include "cocoa_platform.h"
#elif defined(_GLFW_WIN32_WGL) #elif defined(_GLFW_WIN32)
#include "win32_platform.h" #include "win32_platform.h"
#elif defined(_GLFW_X11_GLX) || defined(_GLFW_X11_EGL) #elif defined(_GLFW_X11)
#include "x11_platform.h" #include "x11_platform.h"
#else #else
#error "No supported platform selected" #error "No supported platform selected"

62
src/nsgl_platform.h Normal file
View File

@ -0,0 +1,62 @@
//========================================================================
// GLFW - An OpenGL library
// Platform: NSOpenGL
// API Version: 3.0
// WWW: http://www.glfw.org/
//------------------------------------------------------------------------
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.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 _nsgl_platform_h_
#define _nsgl_platform_h_
#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL NSGL
#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryNSGL NSGL
//========================================================================
// GLFW platform specific types
//========================================================================
//------------------------------------------------------------------------
// Platform-specific OpenGL context structure
//------------------------------------------------------------------------
typedef struct _GLFWcontextNSGL
{
id pixelFormat;
id context;
} _GLFWcontextNSGL;
//------------------------------------------------------------------------
// Platform-specific library global data for NSGL
//------------------------------------------------------------------------
typedef struct _GLFWlibraryNSGL
{
// dlopen handle for dynamically loading OpenGL extension entry points
void* framework;
} _GLFWlibraryNSGL;
#endif // _nsgl_platform_h_

View File

@ -232,6 +232,11 @@ int _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void) const char* _glfwPlatformGetVersionString(void)
{ {
const char* version = _GLFW_VERSION_FULL const char* version = _GLFW_VERSION_FULL
#if defined(_GLFW_WGL)
" WGL"
#elif defined(_GLFW_EGL)
" EGL"
#endif
#if defined(__MINGW32__) #if defined(__MINGW32__)
" MinGW" " MinGW"
#elif defined(_MSC_VER) #elif defined(_MSC_VER)

View File

@ -105,9 +105,9 @@ typedef DWORD (WINAPI * TIMEGETTIME_T) (void);
#define _GLFW_WNDCLASSNAME L"GLFW30" #define _GLFW_WNDCLASSNAME L"GLFW30"
#if defined(_GLFW_WIN32_WGL) #if defined(_GLFW_WGL)
#include "wgl_platform.h" #include "wgl_platform.h"
#elif defined(_GLFW_WIN32_EGL) #elif defined(_GLFW_EGL)
#define _GLFW_EGL_NATIVE_WINDOW window->Win32.handle #define _GLFW_EGL_NATIVE_WINDOW window->Win32.handle
#define _GLFW_EGL_NATIVE_DISPLAY NULL #define _GLFW_EGL_NATIVE_DISPLAY NULL
#include "egl_platform.h" #include "egl_platform.h"

View File

@ -449,7 +449,7 @@ GLFWvidmode* _glfwPlatformGetVideoModes(int* found)
rgbs = (int*) malloc(sizeof(int) * visualCount); rgbs = (int*) malloc(sizeof(int) * visualCount);
rgbCount = 0; rgbCount = 0;
#if !defined(_GLFW_X11_EGL) #if defined(_GLFW_GLX)
for (i = 0; i < visualCount; i++) for (i = 0; i < visualCount; i++)
{ {
int gl, rgba, rgb, r, g, b; int gl, rgba, rgb, r, g, b;

View File

@ -693,9 +693,9 @@ int _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void) const char* _glfwPlatformGetVersionString(void)
{ {
const char* version = _GLFW_VERSION_FULL const char* version = _GLFW_VERSION_FULL
#if defined(_GLFW_X11_GLX) #if defined(_GLFW_GLX)
" GLX" " GLX"
#elif defined(_GLFW_X11_EGL) #elif defined(_GLFW_EGL)
" EGL" " EGL"
#endif #endif
#if defined(_GLFW_HAS_XRANDR) #if defined(_GLFW_HAS_XRANDR)

View File

@ -53,10 +53,10 @@
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#endif #endif
#if defined(_GLFW_X11_GLX) #if defined(_GLFW_GLX)
#define _GLFW_X11_CONTEXT_VISUAL window->GLX.visual #define _GLFW_X11_CONTEXT_VISUAL window->GLX.visual
#include "glx_platform.h" #include "glx_platform.h"
#elif defined(_GLFW_X11_EGL) #elif defined(_GLFW_EGL)
#define _GLFW_X11_CONTEXT_VISUAL window->EGL.visual #define _GLFW_X11_CONTEXT_VISUAL window->EGL.visual
#define _GLFW_EGL_NATIVE_WINDOW window->X11.handle #define _GLFW_EGL_NATIVE_WINDOW window->X11.handle
#define _GLFW_EGL_NATIVE_DISPLAY _glfwLibrary.X11.display #define _GLFW_EGL_NATIVE_DISPLAY _glfwLibrary.X11.display