Commit 7bc4719a authored by Eric Petit's avatar Eric Petit

macosx/* : macosx-opengl-effect now accept cube and transparent-cube

parent 88366257
......@@ -2,7 +2,7 @@
* macosx.m: MacOS X module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.20 2004/02/09 13:28:31 titer Exp $
* $Id: macosx.m,v 1.21 2004/02/09 17:42:12 titer Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......@@ -61,10 +61,12 @@ void E_(CloseVideo) ( vlc_object_t * );
#define OPENGL_EFFECT_TEXT N_("OpenGL effect")
#define OPENGL_EFFECT_LONGTEXT N_("Use 'None' to display the video " \
"without any fantasy, 'Cube' to let the video play on " \
"transparent faces of a rotating cube")
"the faces of a rotating cube, 'Transparent cube' do make this " \
"cube transparent" )
static char * effect_list[] = { "none", "cube" };
static char * effect_list_text[] = { N_("None"), N_("Cube") };
static char * effect_list[] = { "none", "cube", "transparent-cube" };
static char * effect_list_text[] = { N_("None"), N_("Cube"),
N_("Transparent cube") };
vlc_module_begin();
set_description( _("MacOS X interface, sound and video") );
......
......@@ -2,7 +2,7 @@
* vout.m: MacOS X video output module
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.79 2004/02/09 14:02:25 titer Exp $
* $Id: vout.m,v 1.80 2004/02/09 17:42:12 titer Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -1305,7 +1305,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
[[self openGLContext] update];
/* Black bacjground */
/* Black background */
glClearColor( 0.0, 0.0, 0.0, 0.0 );
/* Check if the user asked for useless visual effects */
......@@ -1317,16 +1317,33 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
else if( !strcmp( psz_effect, "cube" ) )
{
i_effect = OPENGL_EFFECT_CUBE;
glEnable( GL_DEPTH_TEST );
glPolygonMode( GL_FRONT, GL_FILL );
glPolygonMode( GL_BACK, GL_POINT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -1.0, 1.0, -1.0, 1.0, 3.0, 20.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, - 5.0 );
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
}
else if( !strcmp( psz_effect, "transparent-cube" ) )
{
i_effect = OPENGL_EFFECT_CUBE;
glEnable( GL_BLEND );
glEnable( GL_POLYGON_SMOOTH );
glDisable( GL_DEPTH_TEST );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -1.0, 1.0, -1.0, 1.0, 3.0, 20.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, - 5.0 );
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
}
else
{
......@@ -1535,7 +1552,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i_texture );
if( i_effect == OPENGL_EFFECT_CUBE )
{
glRotatef( 1.0, 0.5, 0.5, 1.0 );
glRotatef( 1.0, 0.3, 0.5, 0.7 );
[self drawCube];
}
else
......
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