Browse Source

correctly test for fbconfig before trying to create a buffer

David Rose 21 years ago
parent
commit
c5d3a6f7d8

+ 6 - 0
panda/src/glxdisplay/glxGraphicsBuffer.cxx

@@ -125,6 +125,12 @@ open_buffer() {
   glxGraphicsStateGuardian *glxgsg;
   DCAST_INTO_R(glxgsg, _gsg, false);
 
+  if (glxgsg->_fbconfig == None) {
+    // If we didn't use an fbconfig to create the GSG, we can't create
+    // a PBuffer.
+    return false;
+  }
+
   static const int max_attrib_list = 32;
   int attrib_list[max_attrib_list];
   int n=0;

+ 4 - 2
panda/src/glxdisplay/glxGraphicsPipe.cxx

@@ -398,7 +398,9 @@ choose_fbconfig(FrameBufferProperties &properties) const {
       }
 
       if (fbconfig == None) {
-        glxdisplay_cat.error()
+        // This is only an info message, because we can still fall
+        // back to the XVisual interface.
+        glxdisplay_cat.info()
           << "Could not get any GLX fbconfig.\n";
         return None;
       }
@@ -571,7 +573,7 @@ try_for_fbconfig(int framebuffer_mode,
   attrib_list[n] = (int)None;
 
   int num_configs = 0;
-  GLXFBConfig *configs = 
+  GLXFBConfig *configs =
     glXChooseFBConfig(_display, _screen, attrib_list, &num_configs);
 
   if (glxdisplay_cat.is_debug()) {