PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image;
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d;
+
+ QPlatformNativeInterface::NativeResourceForContextFunction get_egl_context;
};
WaylandEglIntegration::WaylandEglIntegration(WaylandCompositor *compositor)
const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS);
if (extensionString && strstr(extensionString, "EGL_WL_bind_wayland_display"))
{
+ d->get_egl_context = nativeInterface->nativeResourceFunctionForContext("get_egl_context");
+ if (!d->get_egl_context) {
+ qWarning("Failed to retrieve the get_egl_context function");
+ }
d->egl_bind_wayland_display =
reinterpret_cast<PFNEGLBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglBindWaylandDisplayWL"));
d->egl_unbind_wayland_display =
reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (d->egl_bind_wayland_display
+ && d->get_egl_context
&& d->egl_unbind_wayland_display
&& d->egl_create_image
&& d->egl_destroy_image
}
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
-//#####jl: fix to use functions pointer
- EGLContext egl_context = nativeInterface->nativeResourceForContext("EglContext", context);
+ EGLContext egl_context = d->get_egl_context(context);
EGLImageKHR image = d->egl_create_image(d->egl_display, egl_context,
EGL_WAYLAND_BUFFER_WL,
Q_D(const WaylandEglIntegration);
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
-//#####jl: fix to use functions pointer
- EGLContext egl_context = nativeInterface->nativeResourceForContext("EglContext", context);
+ EGLContext egl_context = d->get_egl_context(context);
EGLImageKHR image = d->egl_create_image(d->egl_display, egl_context,
EGL_WAYLAND_BUFFER_WL,