From c5b94c8168fd0783b61b981c60331277817019b8 Mon Sep 17 00:00:00 2001 From: namedkitten Date: Sat, 11 Apr 2020 16:21:04 +0100 Subject: [PATCH] pass renderer --- src/Backends/MPV/MPVBackend.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Backends/MPV/MPVBackend.cpp b/src/Backends/MPV/MPVBackend.cpp index 14fb288..d4c1bd7 100644 --- a/src/Backends/MPV/MPVBackend.cpp +++ b/src/Backends/MPV/MPVBackend.cpp @@ -39,13 +39,7 @@ on_mpv_redraw(void* ctx) static void* get_proc_address_mpv(void* ctx, const char* name) { - (void)ctx; - QOpenGLContext *glctx = QOpenGLContext::currentContext(); - if (!glctx) { - std::cerr << "No GLCTX :(" << std::endl; - return nullptr; - } - return reinterpret_cast(glctx->getProcAddress(QByteArray(name))); + return reinterpret_cast(reinterpret_cast(ctx)->getProcAddress(QByteArray(name))); } } // namespace @@ -69,7 +63,7 @@ public: // init mpv_gl: if (!obj->mpv_gl) { mpv_opengl_init_params gl_init_params{ get_proc_address_mpv, - nullptr, + QOpenGLContext::currentContext(), nullptr }; mpv_render_param params[]{ { MPV_RENDER_PARAM_API_TYPE,