[MPlayer-cvslog] r31638 - trunk/libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Mon Jul 5 21:40:21 CEST 2010


Author: reimar
Date: Mon Jul  5 21:40:21 2010
New Revision: 31638

Log:
Try to get a quadbuffered visual if the corresponding 3D mode was selected.

Modified:
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Mon Jul  5 21:34:08 2010	(r31637)
+++ trunk/libvo/vo_gl.c	Mon Jul  5 21:40:21 2010	(r31638)
@@ -590,7 +590,19 @@ static int create_window(uint32_t d_widt
 #ifdef CONFIG_GL_X11
   if (glctx.type == GLTYPE_X11) {
     static int default_glx_attribs[] = {GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None};
-    XVisualInfo *vinfo=glXChooseVisual(mDisplay, mScreen, default_glx_attribs);
+    static int stereo_glx_attribs[]  = {
+      GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,GLX_BLUE_SIZE, 1,
+      GLX_DOUBLEBUFFER, GLX_STEREO, None
+    };
+    XVisualInfo *vinfo = NULL;
+    if (stereo_mode == GL_3D_QUADBUFFER) {
+      vinfo = glXChooseVisual(mDisplay, mScreen, stereo_glx_attribs);
+      if (!vinfo)
+        mp_msg(MSGT_VO, MSGL_ERR, "[gl] Could not find a stereo visual, "
+                                  "3D will probably not work!\n");
+    }
+    if (!vinfo)
+      vinfo = glXChooseVisual(mDisplay, mScreen, default_glx_attribs);
     if (vinfo == NULL)
     {
       mp_msg(MSGT_VO, MSGL_ERR, "[gl] no GLX support present\n");


More information about the MPlayer-cvslog mailing list