mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
EGL: Add support for EGL_EXT_platform_base
This adds support for EGL_EXT_platform_base and its associated X11 and Wayland extensions, allowing us to explicitly tell EGL which window system we are using. This is based on work by @linkmauve in #1691. Closes #1691.
This commit is contained in:
+12
-1
@@ -3048,6 +3048,14 @@ const char* _glfwPlatformGetClipboardString(void)
|
||||
return getSelectionString(_glfw.x11.CLIPBOARD);
|
||||
}
|
||||
|
||||
EGLenum _glfwPlatformGetEGLPlatform(void)
|
||||
{
|
||||
if (_glfw.egl.EXT_platform_base && _glfw.egl.EXT_platform_x11)
|
||||
return EGL_PLATFORM_X11_EXT;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void)
|
||||
{
|
||||
return _glfw.x11.display;
|
||||
@@ -3055,7 +3063,10 @@ EGLNativeDisplayType _glfwPlatformGetEGLNativeDisplay(void)
|
||||
|
||||
EGLNativeWindowType _glfwPlatformGetEGLNativeWindow(_GLFWwindow* window)
|
||||
{
|
||||
return (EGLNativeWindowType) window->x11.handle;
|
||||
if (_glfw.egl.platform)
|
||||
return &window->x11.handle;
|
||||
else
|
||||
return (EGLNativeWindowType) window->x11.handle;
|
||||
}
|
||||
|
||||
void _glfwPlatformGetRequiredInstanceExtensions(char** extensions)
|
||||
|
||||
Reference in New Issue
Block a user