diff --git a/panda/src/glxdisplay/config_glxdisplay.cxx b/panda/src/glxdisplay/config_glxdisplay.cxx index ae1c8f0c38..321c740397 100644 --- a/panda/src/glxdisplay/config_glxdisplay.cxx +++ b/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 diff --git a/panda/src/glxdisplay/config_glxdisplay.h b/panda/src/glxdisplay/config_glxdisplay.h index 3912618492..94749acd98 100644 --- a/panda/src/glxdisplay/config_glxdisplay.h +++ b/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__ */ diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index 378249ed60..6baf25e41a 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/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)||