summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_out/video_out_opengl2.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/video_out/video_out_opengl2.c b/src/video_out/video_out_opengl2.c
index c6ece1aec..145a039bc 100644
--- a/src/video_out/video_out_opengl2.c
+++ b/src/video_out/video_out_opengl2.c
@@ -1140,8 +1140,6 @@ static int opengl2_draw_video_bicubic( opengl2_driver_t *that, int guiw, int gui
glEnd();
glActiveTexture( GL_TEXTURE0 );
- glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
- glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
glViewport( 0, 0, guiw, guih );
@@ -1198,6 +1196,8 @@ static int opengl2_draw_video_cubic_x( opengl2_driver_t *that, int guiw, int gui
glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_RECTANGLE_ARB, video_texture );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glActiveTexture( GL_TEXTURE1 );
glBindTexture( GL_TEXTURE_RECTANGLE_ARB, that->bicubic_lut_texture );
glUseProgram( that->bicubic_pass1_program.program );
@@ -1241,6 +1241,8 @@ static int opengl2_draw_video_cubic_y( opengl2_driver_t *that, int guiw, int gui
glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_RECTANGLE_ARB, video_texture );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glActiveTexture( GL_TEXTURE1 );
glBindTexture( GL_TEXTURE_RECTANGLE_ARB, that->bicubic_lut_texture );
glUseProgram( that->bicubic_pass2_program.program );
@@ -1262,6 +1264,35 @@ static int opengl2_draw_video_cubic_y( opengl2_driver_t *that, int guiw, int gui
+static int opengl2_draw_video_simple( opengl2_driver_t *that, int guiw, int guih, GLfloat u, GLfloat v, GLfloat u1, GLfloat v1,
+ GLfloat x, GLfloat y, GLfloat x1, GLfloat y1, GLuint video_texture )
+{
+ glViewport( 0, 0, guiw, guih );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho( 0.0, guiw, guih, 0.0, -1.0, 1.0 );
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glActiveTexture( GL_TEXTURE0 );
+ glBindTexture( GL_TEXTURE_RECTANGLE_ARB, video_texture );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+
+ glBegin( GL_QUADS );
+ glTexCoord2f( u, v ); glVertex3f( x, y, 0.);
+ glTexCoord2f( u, v1 ); glVertex3f( x, y1, 0.);
+ glTexCoord2f( u1, v1 ); glVertex3f( x1, y1, 0.);
+ glTexCoord2f( u1, v ); glVertex3f( x1, y, 0.);
+ glEnd();
+
+ return 1;
+}
+
+
+
static void opengl2_draw_video_bilinear( opengl2_driver_t *that, int guiw, int guih, GLfloat u, GLfloat v, GLfloat u1, GLfloat v1,
GLfloat x, GLfloat y, GLfloat x1, GLfloat y1, GLuint video_texture )
{
@@ -1276,6 +1307,8 @@ static void opengl2_draw_video_bilinear( opengl2_driver_t *that, int guiw, int g
glActiveTexture( GL_TEXTURE0 );
glBindTexture( GL_TEXTURE_RECTANGLE_ARB, video_texture );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glBegin( GL_QUADS );
glTexCoord2f( u, v ); glVertex3f( x, y, 0.);
@@ -1399,8 +1432,12 @@ static void opengl2_draw( opengl2_driver_t *that, opengl2_frame_t *frame )
res = opengl2_draw_video_bicubic( that, that->sc.gui_width, that->sc.gui_height, u, v, u1, v1, x, y, x1, y1, video_texture );
else
res = opengl2_draw_video_cubic_x( that, that->sc.gui_width, that->sc.gui_height, u, v, u1, v1, x, y, x1, y1, video_texture );
- } else if ( that->sc.displayed_height != that->sc.output_height )
- res = opengl2_draw_video_cubic_y( that, that->sc.gui_width, that->sc.gui_height, u, v, u1, v1, x, y, x1, y1, video_texture );
+ } else {
+ if ( that->sc.displayed_height != that->sc.output_height )
+ res = opengl2_draw_video_cubic_y( that, that->sc.gui_width, that->sc.gui_height, u, v, u1, v1, x, y, x1, y1, video_texture );
+ else
+ res = opengl2_draw_video_simple( that, that->sc.gui_width, that->sc.gui_height, u, v, u1, v1, x, y, x1, y1, video_texture );
+ }
}
if (!res)
opengl2_draw_video_bilinear( that, that->sc.gui_width, that->sc.gui_height, u, v, u1, v1, x, y, x1, y1, video_texture );