[vlc-commits] opengl: use default draw framebuffer

Romain Vimont git at videolan.org
Thu Sep 10 15:41:47 CEST 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Jul  7 12:33:54 2020 +0200| [1f203efd998c1f0ef05e7e26258e481355d2a348] | committer: Alexandre Janniaux

opengl: use default draw framebuffer

The default draw framebuffer might be != 0 on some platforms. Read the
bound draw framebuffer on initialization, and use it for drawing to the
display.

Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>
Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f203efd998c1f0ef05e7e26258e481355d2a348
---

 modules/video_output/opengl/filters.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/filters.c b/modules/video_output/opengl/filters.c
index d6762b0b56..2f4f7af64a 100644
--- a/modules/video_output/opengl/filters.c
+++ b/modules/video_output/opengl/filters.c
@@ -201,6 +201,10 @@ vlc_gl_filters_Draw(struct vlc_gl_filters *filters)
 {
     const opengl_vtable_t *vt = &filters->api->vt;
 
+    GLint value;
+    vt->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &value);
+    GLuint draw_framebuffer = value; /* as GLuint */
+
     struct vlc_gl_filter_priv *priv;
     vlc_list_foreach(priv, &filters->list, node)
     {
@@ -221,7 +225,8 @@ vlc_gl_filters_Draw(struct vlc_gl_filters *filters)
             }
         }
 
-        GLuint draw_fb = priv->has_framebuffer_out ? priv->framebuffer_out : 0;
+        GLuint draw_fb = priv->has_framebuffer_out ? priv->framebuffer_out
+                                                   : draw_framebuffer;
 
         vt->BindFramebuffer(GL_DRAW_FRAMEBUFFER, draw_fb);
 



More information about the vlc-commits mailing list