]> git.sesse.net Git - vlc/commitdiff
macosx/* : macosx-opengl-effect now accept cube and transparent-cube
authorEric Petit <titer@videolan.org>
Mon, 9 Feb 2004 17:42:12 +0000 (17:42 +0000)
committerEric Petit <titer@videolan.org>
Mon, 9 Feb 2004 17:42:12 +0000 (17:42 +0000)
modules/gui/macosx/macosx.m
modules/gui/macosx/vout.m

index 68ededb12dbf435e5ce9a238ce0e24fda7f9fc31..fd0dc3ba22e550fc4ea49e0509c78c78a154c459 100644 (file)
@@ -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") );
index 402aa3db44905b04172d6a0f1a08b424a921627c..51eb40b48d2af1c1cd0371f6ccd769b9067de307 100644 (file)
@@ -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