From c5d3a6f7d8e28adb21d1dcaf6f6dda79df849170 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 26 Apr 2004 18:54:37 +0000 Subject: [PATCH] correctly test for fbconfig before trying to create a buffer --- panda/src/glxdisplay/glxGraphicsBuffer.cxx | 6 ++++++ panda/src/glxdisplay/glxGraphicsPipe.cxx | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/panda/src/glxdisplay/glxGraphicsBuffer.cxx b/panda/src/glxdisplay/glxGraphicsBuffer.cxx index 4c06ff2c33..93ae72a2ed 100644 --- a/panda/src/glxdisplay/glxGraphicsBuffer.cxx +++ b/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; diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index ae9a50a2af..6bc4160712 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/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()) {