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) {
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();