Commit a06e4da7 authored by Cyril Deguet's avatar Cyril Deguet

* opengl.c: use glTexSubImage2D instead of glTexImage2D

parent 2b8ade38
......@@ -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 )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment