aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-28 00:59:02 +0200
committerSven Gothel <[email protected]>2011-04-28 00:59:02 +0200
commit25944aa4dbb86f5087718e8c9b798018d403b222 (patch)
treeab523e0d49a0024dd62f12a278bf1805860f4419 /src/jogl/classes/jogamp/opengl
parent371e42bbdef18a492587bbf07b02e72372362f75 (diff)
Utilize general validation of fbcfg (further validation w/ query), refines f50f40e0fb2789537ecc19f8eaff439b24294a65
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java5
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java5
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java2
3 files changed, 8 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
index 39032117c..1b31ce16e 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
@@ -80,14 +80,13 @@ public class X11ExternalGLXContext extends X11GLXContext {
// of 0, which doesn't work in a subsequent call to glXChooseFBConfig; if this happens,
// create and use a default config (this has been observed when running on CentOS 5.5 inside
// of VMWare Server 2.0 with the Mesa 6.5.1 drivers)
- if( 0 == X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, x11Screen.getIndex(), val[0]) ) {
+ if( X11GLXGraphicsConfiguration.GLXFBConfigIDValid(display, x11Screen.getIndex(), val[0]) ) {
GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(glcapsDefault, glcapsDefault, null, x11Screen);
if(DEBUG) {
System.err.println("X11ExternalGLXContext invalid FBCONFIG_ID "+val[0]+", using default cfg: " + cfg);
}
- }
- else {
+ } else {
cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val[0]);
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index 109311123..575106555 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -207,6 +207,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
// FBConfig
+
+ static boolean GLXFBConfigIDValid(long display, int screen, int fbcfgid) {
+ long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
+ return (0 != fbcfg) ? X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) : false ;
+ }
static boolean GLXFBConfigValid(long display, long fbcfg) {
int[] tmp = new int[1];
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index b984f1633..e167c1467 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -218,7 +218,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
int screen = x11Screen.getIndex();
long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbID);
- if( !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) ) {
+ if( 0 == fbcfg || !X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) ) {
if(DEBUG) {
System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: Failed - GLX FBConfig invalid: ("+x11Screen+","+toHexString(fbID)+"): fbcfg: "+toHexString(fbcfg));
}