summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-09 22:51:28 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-03-11 12:49:40 +0900
commitefc72daea937fe5942c2e4e39e7f781082a5d65f (patch)
tree1e6e370918898beff651d11145b0fc386f2f5fd1
parentb414d9a9a7ae41a247ce5e33027112be398df895 (diff)
downloadmpv-efc72daea937fe5942c2e4e39e7f781082a5d65f.tar.bz2
mpv-efc72daea937fe5942c2e4e39e7f781082a5d65f.tar.xz
client API: clarify mpv_opengl_cb_render() viewport parameter
Basically, the idea behind the vp parameter is broken - I guess the intention was to enable rendering to a specific subrectangle of the target framebuffer, but there's nothing to specify the actual target rectangle (the VO will still clear e.g. the borders between video and framebuffer borders). We're not going to keep the current semantics either with the upcoming rework of vo_opengl, so declare this for broken. Maybe we can introduce a function later which does this properly. (cherry picked from commit 90adf2904e1c207a239fc4527e328b7facd22cad)
-rw-r--r--libmpv/opengl_cb.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpv/opengl_cb.h b/libmpv/opengl_cb.h
index bf6dfb4136..0e679e5edf 100644
--- a/libmpv/opengl_cb.h
+++ b/libmpv/opengl_cb.h
@@ -186,11 +186,14 @@ int mpv_opengl_cb_init_gl(mpv_opengl_cb_context *ctx, const char *exts,
* postprocessing, it will always bind and unbind FBOs itself. If
* you want mpv to render on the main framebuffer, pass 0.
* @param vp Viewport to render on. The renderer will essentially call:
- * glViewport(vp[0], vp[1], vp[2], vp[3]);
+ * glViewport(0, 0, vp[2], vp[3]);
* before rendering. The height (vp[3]) can be negative to flip the
* image - the renderer will flip it before setting the viewport
* (typically you want to flip the image if you are rendering
* directly to the main framebuffer).
+ * vp[0] and vp[1] should be set to 0.
+ * The viewport width and height imply the target FBO or framebuffer's
+ * size. It will always render to the full size of it.
* @return the number of left frames in the internal queue to be rendered
*/
int mpv_opengl_cb_render(mpv_opengl_cb_context *ctx, int fbo, int vp[4]);