[Feat] (MG_Impl/EGLImpl): expose surfaceless platform extensions

This commit is contained in:
2026-07-02 08:09:56 +08:00
parent 4613167abb
commit 59976a7f7b
3 changed files with 19 additions and 1 deletions
+8 -1
View File
@@ -382,7 +382,14 @@ namespace MobileGL::MG_Impl::EGLImpl {
case EGL_CLIENT_APIS:
return "OpenGL OpenGL_ES";
case EGL_EXTENSIONS:
return "";
if (display == EGL_NO_DISPLAY) {
return "EGL_EXT_client_extensions "
"EGL_EXT_platform_base "
"EGL_KHR_platform_base "
"EGL_MESA_platform_surfaceless";
}
return "EGL_KHR_create_context "
"EGL_MESA_platform_surfaceless";
default:
state->SetError(EGL_BAD_PARAMETER);
return nullptr;
@@ -235,6 +235,14 @@ MOBILEGL_EGL_API EGLDisplay eglGetPlatformDisplay(EGLenum platform, void* native
return MobileGL::MG_Impl::EGLImpl::GetPlatformDisplay(platform, native_display, attrib_list);
}
MOBILEGL_EGL_API EGLDisplay eglGetPlatformDisplayEXT(EGLenum platform, void* native_display,
const EGLint* attrib_list) {
MGLOG_D("eglGetPlatformDisplayEXT(platform=%u, native_display=%p, attrib_list=%p)", platform, native_display,
attrib_list);
return MobileGL::MG_Impl::EGLImpl::GetPlatformDisplay(
platform, native_display, reinterpret_cast<const EGLAttrib*>(attrib_list));
}
MOBILEGL_EGL_API EGLSurface eglCreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void* native_window,
const EGLAttrib* attrib_list) {
MGLOG_D("eglCreatePlatformWindowSurface(dpy=%p, config=%p, native_window=%p, attrib_list=%p)", dpy, config,
+3
View File
@@ -14,6 +14,8 @@
#include <OpenGL/OpenGL.h>
#endif
extern "C" EGLDisplay eglGetPlatformDisplayEXT(EGLenum platform, void* native_display, const EGLint* attrib_list);
#define GETPROC(name, var) \
if (strcmp(#name, var) == 0) { \
return (void*)name; \
@@ -63,6 +65,7 @@ namespace MobileGL::MG_Impl {
GETPROC(eglCreateImage, name);
GETPROC(eglDestroyImage, name);
GETPROC(eglGetPlatformDisplay, name);
GETPROC(eglGetPlatformDisplayEXT, name);
GETPROC(eglCreatePlatformWindowSurface, name);
GETPROC(eglCreatePlatformPixmapSurface, name);
GETPROC(eglWaitSync, name);