Linux part of letting Pbuffer fallback to double buffered formats

This commit is contained in:
Elias Naur 2004-07-26 14:42:13 +00:00
parent 0d1e84752a
commit 98eef52c41
1 changed files with 7 additions and 6 deletions

View File

@ -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) { 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); GLXFBConfig *configs = chooseVisualGLX13(env, pixel_format, false, GLX_PBUFFER_BIT, false);
if (configs == NULL) { if (configs == NULL) {
throwException(env, "No matching pixel format"); GLXFBConfig *configs = chooseVisualGLX13(env, pixel_format, false, GLX_PBUFFER_BIT, true);
return false; if (configs == NULL) {
throwException(env, "No matching pixel format");
return false;
}
} }
if (!checkPbufferCaps(env, configs[0], width, height)) { if (!checkPbufferCaps(env, configs[0], width, height)) {
XFree(configs); XFree(configs);
@ -186,10 +189,8 @@ static bool createPbufferUsingDisplayContext(JNIEnv *env, PbufferInfo *buffer_in
return false; return false;
} }
GLXFBConfig config = chooseSingleBufferedConfigFromConfig(getCurrentGLXFBConfig()); GLXFBConfig config = chooseSingleBufferedConfigFromConfig(getCurrentGLXFBConfig());
if (config == NULL) { if (config == NULL)
throwException(env, "Could not find a suitable GLXFBConfig"); config = getCurrentGLXFBConfig();
return false;
}
GLXPbuffer buffer = glXCreatePbuffer(getDisplay(), config, buffer_attribs); GLXPbuffer buffer = glXCreatePbuffer(getDisplay(), config, buffer_attribs);
buffer_info->buffer = buffer; buffer_info->buffer = buffer;
buffer_info->context = getCurrentGLXContext(); buffer_info->context = getCurrentGLXContext();