summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-09 22:51:28 +0100
committerwm4 <wm4@nowhere>2015-03-09 22:51:28 +0100
commit90adf2904e1c207a239fc4527e328b7facd22cad (patch)
tree601b2352f84e7ced3b3d6d5a7a40d279b56cc274
parentcfa44f4e9077d712be5c1c3cf9a4d7bbe79e605e (diff)
downloadmpv-90adf2904e1c207a239fc4527e328b7facd22cad.tar.bz2
mpv-90adf2904e1c207a239fc4527e328b7facd22cad.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.
-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]);