aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-25 02:59:37 +0100
committerSven Gothel <[email protected]>2011-11-25 02:59:37 +0100
commit6b8f6e8d7c548cb6bfed14d8a04c9cf252ca7c4d (patch)
tree99d9dfc3711353307020373ad908387f974591ff /src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
parent603f6eab78a0e8f7a22f0e51af1afa426d9d80a2 (diff)
GLX Information usage cleanup
- GLXUtil: Distinguish between client and server GLX information, cache client information. - GLXDrawableFactory: Utilize GLXUtil client data, as well as cache (SharedResource) GLX server data, avoiding 'uncontrolled' GLX queries, ie. w/o locking. - isMultisampleAvailable = isClientMultisampleAvailable && isServerMultisampleAvailable
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index 68b8135d0..c7c28e2d9 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -35,13 +35,27 @@ package jogamp.opengl.x11.glx;
import java.util.ArrayList;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import javax.media.opengl.*;
+import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.x11.X11GraphicsConfiguration;
+import javax.media.nativewindow.x11.X11GraphicsScreen;
+import javax.media.opengl.DefaultGLCapabilitiesChooser;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesChooser;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import jogamp.nativewindow.x11.X11Lib;
+import jogamp.nativewindow.x11.X11Util;
+import jogamp.nativewindow.x11.XRenderDirectFormat;
+import jogamp.nativewindow.x11.XRenderPictFormat;
+import jogamp.nativewindow.x11.XVisualInfo;
+import jogamp.opengl.Debug;
+import jogamp.opengl.GLGraphicsConfigurationUtil;
import com.jogamp.common.nio.PointerBuffer;
-import jogamp.opengl.*;
-import jogamp.nativewindow.x11.*;
public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implements Cloneable {
protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
@@ -56,19 +70,20 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
static X11GLXGraphicsConfiguration create(GLProfile glp, X11GraphicsScreen x11Screen, int fbcfgID) {
- long display = x11Screen.getDevice().getHandle();
+ final long display = x11Screen.getDevice().getHandle();
if(0==display) {
throw new GLException("Display null of "+x11Screen);
}
- int screen = x11Screen.getIndex();
- long fbcfg = glXFBConfigID2FBConfig(display, screen, fbcfgID);
+ final int screen = x11Screen.getIndex();
+ final long fbcfg = glXFBConfigID2FBConfig(display, screen, fbcfgID);
if(0==fbcfg) {
throw new GLException("FBConfig null of "+toHexString(fbcfgID));
}
if(null==glp) {
glp = GLProfile.getDefault(x11Screen.getDevice());
}
- X11GLCapabilities caps = GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, GLXUtil.isMultisampleAvailable(display));
+ final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
+ final X11GLCapabilities caps = GLXFBConfig2GLCapabilities(glp, display, fbcfg, true, true, true, factory.isGLXMultisampleAvailable(x11Screen.getDevice()));
if(null==caps) {
throw new GLException("GLCapabilities null of "+toHexString(fbcfg));
}
@@ -100,10 +115,6 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- private static int nonZeroOrDontCare(int value) {
- return value != 0 ? value : (int)GLX.GLX_DONT_CARE ;
- }
-
static int[] GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
boolean forFBAttr,
boolean isMultisampleAvailable,