From 14d00a65e9641c44721879c62a3a992fdd746c69 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 5 Jul 2010 19:40:21 +0000 Subject: [PATCH] vo_gl: Try to get a quadbuffered visual for corresponding 3D mode git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31638 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 0708769553..b8d35088ca 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -609,7 +609,19 @@ static int create_window(uint32_t d_width, uint32_t d_height, uint32_t flags, co #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");