Bläddra i källkod

glx-support-pbuffer, glx-support-pixmap

David Rose 17 år sedan
förälder
incheckning
b0470a17be

+ 15 - 0
panda/src/glxdisplay/config_glxdisplay.cxx

@@ -78,6 +78,21 @@ ConfigVariableInt x_wheel_right_button
           "mouse button number does the system report when one scrolls "
           "to the right?"));
 
+ConfigVariableBool glx_support_pbuffer
+("glx-support-pbuffer", false,
+ PRC_DESC("Set this true to enable the use of X pbuffer-based offscreen "
+          "buffers, if available.  This is usually preferred over "
+          "pixmap-based buffers, but not all drivers support them."));
+
+ConfigVariableBool glx_support_pixmap
+("glx-support-pixmap", false,
+ PRC_DESC("Set this true to enable the use of X pixmap-based offscreen "
+          "buffers.  This is false by default because pixmap-based buffers "
+          "are usually slower than pbuffer-based buffers, and because at "
+          "least one driver is known to crash (crash!) when it attempts "
+          "to create a pixmap-based buffer."));
+
+
 ////////////////////////////////////////////////////////////////////
 //     Function: init_libglxdisplay
 //  Description: Initializes the library.  This must be called at

+ 3 - 0
panda/src/glxdisplay/config_glxdisplay.h

@@ -35,4 +35,7 @@ extern ConfigVariableInt x_wheel_down_button;
 extern ConfigVariableInt x_wheel_left_button;
 extern ConfigVariableInt x_wheel_right_button;
 
+extern ConfigVariableBool glx_support_pbuffer;
+extern ConfigVariableBool glx_support_pixmap;
+
 #endif /* __CONFIG_GLXDISPLAY_H__ */

+ 8 - 0
panda/src/glxdisplay/glxGraphicsPipe.cxx

@@ -278,6 +278,10 @@ make_output(const string &name,
   // Third thing to try: a glxGraphicsBuffer
   
   if (retry == 2) {
+    if (!glx_support_pbuffer) {
+      return NULL;
+    }
+
     if (((flags&BF_require_parasite)!=0)||
         ((flags&BF_require_window)!=0)||
         ((flags&BF_resizeable)!=0)||
@@ -301,6 +305,10 @@ make_output(const string &name,
 
   // Third thing to try: a glxGraphicsPixmap.
   if (retry == 3) {
+    if (!glx_support_pixmap) {
+      return NULL;
+    }
+
     if (((flags&BF_require_parasite)!=0)||
         ((flags&BF_require_window)!=0)||
         ((flags&BF_resizeable)!=0)||