vo_opengl_cb: deprecate mpv_opengl_cb_render()

Its vp parameter made no sense anymore. Introduce a new one.
This commit is contained in:
wm4
2015-04-09 19:31:01 +02:00
parent 8dc7156bc0
commit e76f6929e5
7 changed files with 42 additions and 24 deletions

View File

@@ -46,9 +46,8 @@ public:
void render()
{
QOpenGLFramebufferObject *fbo = framebufferObject();
int vp[4] = {0, 0, fbo->width(), fbo->height()};
window->resetOpenGLState();
mpv_opengl_cb_render(mpv_gl, fbo->handle(), vp);
mpv_opengl_cb_draw(mpv_gl, fbo->handle(), fbo->width(), fbo->height());
window->resetOpenGLState();
}
};

View File

@@ -39,15 +39,13 @@ void MpvRenderer::paint()
{
window->resetOpenGLState();
// Render to the whole window.
int vp[4] = {0, 0, size.width(), -size.height()};
// This uses 0 as framebuffer, which indicates that mpv will render directly
// to the frontbuffer. Note that mpv will always switch framebuffers
// explicitly. Some QWindow setups (such as using QQuickWidget) actually
// want you to render into a FBO in the beforeRendering() signal, and this
// code won't work there.
mpv_opengl_cb_render(mpv_gl, 0, vp);
// The negation is used for rendering with OpenGL's flipped coordinates.
mpv_opengl_cb_draw(mpv_gl, 0, size.width(), -size.height());
window->resetOpenGLState();
}