Skip to content
Snippets Groups Projects
Commit 228e5826 authored by Camilla Löwy's avatar Camilla Löwy
Browse files

EGL: Allow native access with defaults on Wayland

The intent of enforcing GLFW_EGL_CONTEXT_API for EGL native access
functions was to ensure that the application had requested the same
context creation API at window creation time that it then attempted
native access for.

With the 3.4 ABI this both isn't true anymore, as a single binary may
have multiple meanings of GLFW_NATIVE_CONTEXT_API, and is no longer
necessary, since glfwGetPlatform provides enough information to
disambiguate even without knowing what GLFW_PLATFORM was set to.

This all leaves the requirement that the context creation API be
GLFW_EGL_CONTEXT_API as just an unnecessary annoyance.

Fixes #2518
parent 3573c5a8
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ video tutorials.
- Nicolas Caramelli
- David Carlier
- Arturo Castro
- Jose Luis Cercós Pita
- Chi-kwan Chan
- Victor Chernyakin
- TheChocolateOre
......
......@@ -127,6 +127,8 @@ information on what to include when reporting a bug.
- [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
`GLFW_NATIVE_CONTEXT_API` (#2518)
## Contact
......
......@@ -914,10 +914,14 @@ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle)
assert(window != NULL);
if (window->context.source != GLFW_EGL_CONTEXT_API)
{
if (_glfw.platform.platformID != GLFW_PLATFORM_WAYLAND ||
window->context.source != GLFW_NATIVE_CONTEXT_API)
{
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
return EGL_NO_CONTEXT;
}
}
return window->context.egl.handle;
}
......@@ -930,9 +934,13 @@ GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle)
assert(window != NULL);
if (window->context.source != GLFW_EGL_CONTEXT_API)
{
if (_glfw.platform.platformID != GLFW_PLATFORM_WAYLAND ||
window->context.source != GLFW_NATIVE_CONTEXT_API)
{
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
return EGL_NO_SURFACE;
return EGL_NO_CONTEXT;
}
}
return window->context.egl.surface;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment