Commit 251eae00 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* More greenline prevention (opengl sucks ! :D )

parent 11493d77
...@@ -69,10 +69,6 @@ ...@@ -69,10 +69,6 @@
#define VLCGL_TYPE VLCGL_RGB_TYPE #define VLCGL_TYPE VLCGL_RGB_TYPE
#endif #endif
#ifndef GL_CLAMP_TO_EDGE
# define GL_CLAMP_TO_EDGE 0x812F
#endif
/* OpenGL effects */ /* OpenGL effects */
#define OPENGL_EFFECT_NONE 1 #define OPENGL_EFFECT_NONE 1
#define OPENGL_EFFECT_CUBE 2 #define OPENGL_EFFECT_CUBE 2
...@@ -96,6 +92,10 @@ static int InitTextures( vout_thread_t * ); ...@@ -96,6 +92,10 @@ static int InitTextures( vout_thread_t * );
static int SendEvents( vlc_object_t *, char const *, static int SendEvents( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define SPEED_TEXT N_( "OpenGL cube rotation speed" )
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
...@@ -589,10 +589,10 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -589,10 +589,10 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
{ {
glEnable( VLCGL_TARGET ); glEnable( VLCGL_TARGET );
glBegin( GL_POLYGON ); glBegin( GL_POLYGON );
glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, 1.0 ); glTexCoord2f( 0.5, 0.5 ); glVertex2f( -1.0, 1.0 );
glTexCoord2f( f_width, 0.0 ); glVertex2f( 1.0, 1.0 ); glTexCoord2f( f_width - 0.5, 0.5 ); glVertex2f( 1.0, 1.0 );
glTexCoord2f( f_width, f_height ); glVertex2f( 1.0, -1.0 ); glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex2f( 1.0, -1.0 );
glTexCoord2f( 0.0, f_height ); glVertex2f( -1.0, -1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex2f( -1.0, -1.0 );
glEnd(); glEnd();
} }
else else
...@@ -603,40 +603,36 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -603,40 +603,36 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
glBegin( GL_QUADS ); glBegin( GL_QUADS );
/* Front */ /* Front */
glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, 1.0 ); glTexCoord2f( 0.5, 0.5 ); glVertex3f( - 1.0, 1.0, 1.0 );
glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, 1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex3f( - 1.0, - 1.0, 1.0 );
glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, 1.0 ); glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex3f( 1.0, - 1.0, 1.0 );
glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, 1.0 ); glTexCoord2f( f_width - 0.5, 0.5 ); glVertex3f( 1.0, 1.0, 1.0 );
/* Left */ /* Left */
glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 ); glTexCoord2f( 0.5, 0.5 ); glVertex3f( - 1.0, 1.0, - 1.0 );
glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex3f( - 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width, f_height ); glVertex3f( - 1.0, - 1.0, 1.0 ); glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex3f( - 1.0, - 1.0, 1.0 );
glTexCoord2f( f_width, 0 ); glVertex3f( - 1.0, 1.0, 1.0 ); glTexCoord2f( f_width - 0.5, 0.5 ); glVertex3f( - 1.0, 1.0, 1.0 );
/* Back */ /* Back */
glTexCoord2f( 0, 0 ); glVertex3f( 1.0, 1.0, - 1.0 ); glTexCoord2f( 0.5, 0.5 ); glVertex3f( 1.0, 1.0, - 1.0 );
glTexCoord2f( 0, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex3f( 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 ); glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex3f( - 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 ); glTexCoord2f( f_width - 0.5, 0.5 ); glVertex3f( - 1.0, 1.0, - 1.0 );
/* Right */ /* Right */
glTexCoord2f( 0, 0 ); glVertex3f( 1.0, 1.0, 1.0 ); glTexCoord2f( 0.5, 0.5 ); glVertex3f( 1.0, 1.0, 1.0 );
glTexCoord2f( 0, f_height ); glVertex3f( 1.0, - 1.0, 1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex3f( 1.0, - 1.0, 1.0 );
glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 ); glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex3f( 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, - 1.0 ); glTexCoord2f( f_width - 0.5, 0.5 ); glVertex3f( 1.0, 1.0, - 1.0 );
/* Top */ /* Top */
glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 ); glTexCoord2f( 0.5, 0.5 ); glVertex3f( - 1.0, 1.0, - 1.0 );
glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, 1.0, 1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex3f( - 1.0, 1.0, 1.0 );
glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, 1.0, 1.0 ); glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex3f( 1.0, 1.0, 1.0 );
glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, - 1.0 ); glTexCoord2f( 0.5, f_height - 0.5 ); glVertex3f( - 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width - 0.5, f_height - 0.5 ); glVertex3f( 1.0, - 1.0, - 1.0 );
/* Bottom */ glTexCoord2f( f_width - 0.5, 0.5 ); glVertex3f( 1.0, - 1.0, 1.0 );
glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, - 1.0, 1.0 );
glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 );
glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, - 1.0, 1.0 );
glEnd(); glEnd();
} }
...@@ -696,12 +692,12 @@ static int InitTextures( vout_thread_t *p_vout ) ...@@ -696,12 +692,12 @@ static int InitTextures( vout_thread_t *p_vout )
/* Set the texture parameters */ /* Set the texture parameters */
glTexParameterf( VLCGL_TARGET, GL_TEXTURE_PRIORITY, 1.0 ); glTexParameterf( VLCGL_TARGET, GL_TEXTURE_PRIORITY, 1.0 );
glTexParameteri( VLCGL_TARGET, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( VLCGL_TARGET, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( VLCGL_TARGET, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameteri( VLCGL_TARGET, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri( VLCGL_TARGET, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glTexParameteri( VLCGL_TARGET, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
glTexParameteri( VLCGL_TARGET, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( VLCGL_TARGET, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
#ifdef SYS_DARWIN #ifdef SYS_DARWIN
......
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