From 98eef52c41bba9a4c521acd76596ab3cedcf9003 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 26 Jul 2004 14:42:13 +0000 Subject: [PATCH] Linux part of letting Pbuffer fallback to double buffered formats --- src/native/linux/org_lwjgl_opengl_Pbuffer.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp b/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp index f36d2965..051e9dc5 100644 --- a/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp +++ b/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp @@ -101,8 +101,11 @@ static bool checkPbufferCaps(JNIEnv *env, GLXFBConfig config, int width, int hei static bool createPbufferUsingUniqueContext(JNIEnv *env, PbufferInfo *pbuffer_info, jobject pixel_format, int width, int height, const int *buffer_attribs) { GLXFBConfig *configs = chooseVisualGLX13(env, pixel_format, false, GLX_PBUFFER_BIT, false); if (configs == NULL) { - throwException(env, "No matching pixel format"); - return false; + GLXFBConfig *configs = chooseVisualGLX13(env, pixel_format, false, GLX_PBUFFER_BIT, true); + if (configs == NULL) { + throwException(env, "No matching pixel format"); + return false; + } } if (!checkPbufferCaps(env, configs[0], width, height)) { XFree(configs); @@ -186,10 +189,8 @@ static bool createPbufferUsingDisplayContext(JNIEnv *env, PbufferInfo *buffer_in return false; } GLXFBConfig config = chooseSingleBufferedConfigFromConfig(getCurrentGLXFBConfig()); - if (config == NULL) { - throwException(env, "Could not find a suitable GLXFBConfig"); - return false; - } + if (config == NULL) + config = getCurrentGLXFBConfig(); GLXPbuffer buffer = glXCreatePbuffer(getDisplay(), config, buffer_attribs); buffer_info->buffer = buffer; buffer_info->context = getCurrentGLXContext();