changeset 32533:c41773445d3b

gl/win32: select a stereo pixel format for window when Quadbuffer OpenGL was selected as 3D mode.
author reimar
date Wed, 10 Nov 2010 22:48:41 +0000
parents d3e318fd8899
children 899d7464d246
files libvo/video_out.h libvo/vo_gl.c libvo/w32_common.c
diffstat 3 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/video_out.h	Wed Nov 10 22:10:30 2010 +0000
+++ b/libvo/video_out.h	Wed Nov 10 22:48:41 2010 +0000
@@ -106,6 +106,7 @@
 #define VOFLAG_SWSCALE		0x04
 #define VOFLAG_FLIPPING		0x08
 #define VOFLAG_HIDDEN		0x10  //< Use to create a hidden window
+#define VOFLAG_STEREO		0x20  //< Use to create a stereo-capable window
 #define VOFLAG_XOVERLAY_SUB_VO  0x10000
 
 typedef struct vo_info_s
--- a/libvo/vo_gl.c	Wed Nov 10 22:10:30 2010 +0000
+++ b/libvo/vo_gl.c	Wed Nov 10 22:48:41 2010 +0000
@@ -595,6 +595,8 @@
 
 static int create_window(uint32_t d_width, uint32_t d_height, uint32_t flags, const char *title)
 {
+  if (stereo_mode == GL_3D_QUADBUFFER)
+    flags |= VOFLAG_STEREO;
 #ifdef CONFIG_GL_WIN32
   if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
     return -1;
--- a/libvo/w32_common.c	Wed Nov 10 22:10:30 2010 +0000
+++ b/libvo/w32_common.c	Wed Nov 10 22:48:41 2010 +0000
@@ -397,6 +397,8 @@
     pfd.nSize = sizeof pfd;
     pfd.nVersion = 1;
     pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
+    if (flags & VOFLAG_STEREO)
+        pfd.dwFlags |= PFD_STEREO;
     pfd.iPixelType = PFD_TYPE_RGBA;
     pfd.cColorBits = 24;
     pfd.iLayerType = PFD_MAIN_PLANE;