pass renderer
This commit is contained in:
parent
90b7f38f0e
commit
c5b94c8168
|
@ -39,13 +39,7 @@ on_mpv_redraw(void* ctx)
|
||||||
static void*
|
static void*
|
||||||
get_proc_address_mpv(void* ctx, const char* name)
|
get_proc_address_mpv(void* ctx, const char* name)
|
||||||
{
|
{
|
||||||
(void)ctx;
|
return reinterpret_cast<void*>(reinterpret_cast<QOpenGLContext*>(ctx)->getProcAddress(QByteArray(name)));
|
||||||
QOpenGLContext *glctx = QOpenGLContext::currentContext();
|
|
||||||
if (!glctx) {
|
|
||||||
std::cerr << "No GLCTX :(" << std::endl;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
return reinterpret_cast<void*>(glctx->getProcAddress(QByteArray(name)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -69,7 +63,7 @@ public:
|
||||||
// init mpv_gl:
|
// init mpv_gl:
|
||||||
if (!obj->mpv_gl) {
|
if (!obj->mpv_gl) {
|
||||||
mpv_opengl_init_params gl_init_params{ get_proc_address_mpv,
|
mpv_opengl_init_params gl_init_params{ get_proc_address_mpv,
|
||||||
nullptr,
|
QOpenGLContext::currentContext(),
|
||||||
nullptr };
|
nullptr };
|
||||||
mpv_render_param params[]{
|
mpv_render_param params[]{
|
||||||
{ MPV_RENDER_PARAM_API_TYPE,
|
{ MPV_RENDER_PARAM_API_TYPE,
|
||||||
|
|
Loading…
Reference in a new issue