From a06e4da7c357f69ed162f425360504e046fed07d Mon Sep 17 00:00:00 2001 From: Cyril Deguet Date: Sat, 14 Aug 2004 14:23:40 +0000 Subject: [PATCH] * opengl.c: use glTexSubImage2D instead of glTexImage2D --- modules/video_output/opengl.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c index 42090a658a..6aa17b3c68 100644 --- a/modules/video_output/opengl.c +++ b/modules/video_output/opengl.c @@ -237,7 +237,7 @@ static int Init( vout_thread_t *p_vout ) p_vout->p_picture[0].p->p_pixels = p_sys->p_buffer; p_vout->p_picture[0].p->i_lines = p_vout->output.i_height; p_vout->p_picture[0].p->i_pixel_pitch = i_pixel_pitch; - p_vout->p_picture[0].p->i_pitch = p_sys->i_tex_width * + p_vout->p_picture[0].p->i_pitch = p_vout->output.i_width * p_vout->p_picture[0].p->i_pixel_pitch; p_vout->p_picture[0].p->i_visible_pitch = p_vout->output.i_width * p_vout->p_picture[0].p->i_pixel_pitch; @@ -259,6 +259,11 @@ static int Init( vout_thread_t *p_vout ) glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); + /* Allocate the OpenGL texture */ + glTexImage2D( GL_TEXTURE_2D, 0, 3, + p_sys->i_tex_width, p_sys->i_tex_height , 0, + VLCGL_RGB_FORMAT, VLCGL_RGB_TYPE, NULL ); + glDisable(GL_BLEND); glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE); @@ -362,9 +367,10 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic ) glClear( GL_COLOR_BUFFER_BIT ); - glTexImage2D( GL_TEXTURE_2D, 0, 3, - p_sys->i_tex_width, p_sys->i_tex_height , 0, - VLCGL_RGB_FORMAT, VLCGL_RGB_TYPE, p_sys->p_buffer ); + /* Update the texture */ + glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, + p_vout->render.i_width, p_vout->render.i_height, + VLCGL_RGB_FORMAT, VLCGL_RGB_TYPE, p_sys->p_buffer ); if( p_sys->i_effect == OPENGL_EFFECT_NONE ) { -- 2.39.2