diff options
author | wm4 <wm4@nowhere> | 2015-01-29 14:58:26 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-29 15:16:17 +0100 |
commit | 14bbbffa99f2b3d85ab7d2cf9aa80e41a15d7761 (patch) | |
tree | 8f7e7ab428df24f61c93580272206562d3880290 /video/out/gl_utils.h | |
parent | bf8abc0ca947151949d259ce9bc8b45829647f23 (diff) | |
download | mpv-14bbbffa99f2b3d85ab7d2cf9aa80e41a15d7761.tar.bz2 mpv-14bbbffa99f2b3d85ab7d2cf9aa80e41a15d7761.tar.xz |
vo_opengl: move FBO helper to gl_utils
This is somewhat messy, because fbotex_init() itself was depending on
some gl_video parameters unrelated to FBO creation (like what scaler was
in use - what the fuck did this check do in this function?), so this
commit does a bit more than moving code around. In particular, the FBO
for the separate scaling intermediate step now always uses GL_NEAREST
sampling, and all FBOs are destroyed/recreated on renderer
reinitialization.
This also moves the function matrix_ortho2d() - trivial enough not to
put it into a separate commit.
Diffstat (limited to 'video/out/gl_utils.h')
-rw-r--r-- | video/out/gl_utils.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/video/out/gl_utils.h b/video/out/gl_utils.h index 482c88a0fa..514b873dbe 100644 --- a/video/out/gl_utils.h +++ b/video/out/gl_utils.h @@ -66,4 +66,18 @@ void gl_vao_bind(struct gl_vao *vao); void gl_vao_unbind(struct gl_vao *vao); void gl_vao_bind_attribs(struct gl_vao *vao, GLuint program); +struct fbotex { + GL *gl; + GLuint fbo; + GLuint texture; + int tex_w, tex_h; // size of .texture + int vp_x, vp_y, vp_w, vp_h; // viewport of fbo / used part of the texture +}; + +bool fbotex_init(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h, + GLenum gl_target, GLenum gl_filter, GLenum iformat); +void fbotex_uninit(struct fbotex *fbo); + +void gl_matrix_ortho2d(float m[3][3], float x0, float x1, float y0, float y1); + #endif |