diff options
author | Michael Bien <[email protected]> | 2010-09-09 21:36:56 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-09-09 21:36:56 +0200 |
commit | 82a88278a0360e0e5896c5c0f009c47f9ff2a83c (patch) | |
tree | 2fe0d18683e8029eed26e1192da7f8fead514558 /src/jogl/classes/com/jogamp/opengl | |
parent | f98fb0cb1b9c8e3dc903711690fb410652cc8bcf (diff) |
trivial code cleanup in glx package.
- locks are final
- debug prints use System.err exclusively (to prevent message corruption)
- removed unused imports, unused variables
- code cleanup in some places
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
16 files changed, 70 insertions, 117 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java index 61705439e..e63f5a225 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java @@ -119,8 +119,8 @@ public abstract class GLContextImpl extends GLContext { public GL setGL(GL gl) { if(DEBUG) { - String sgl1 = (null!=this.gl)?this.gl.getClass().toString()+", "+this.gl.toString():new String("<null>"); - String sgl2 = (null!=gl)?gl.getClass().toString()+", "+gl.toString():new String("<null>"); + String sgl1 = (null!=this.gl)?this.gl.getClass().toString()+", "+this.gl.toString():"<null>"; + String sgl2 = (null!=gl)?gl.getClass().toString()+", "+gl.toString():"<null>"; Exception e = new Exception("setGL (OpenGL "+getGLVersion()+"): "+Thread.currentThread()+", "+sgl1+" -> "+sgl2); e.printStackTrace(); } @@ -455,26 +455,12 @@ public abstract class GLContextImpl extends GLContext { AbstractGraphicsConfiguration config = drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities(); GLProfile glp = glCaps.getGLProfile(); - long _context = 0; if (DEBUG) { System.err.println(getThreadName() + ": !!! createContextARB: mappedVersionsAvailableSet "+ mappedVersionsAvailableSet); } - if( !mappedVersionsAvailableSet ) { - synchronized(mappedVersionsAvailableLock) { - if( !mappedVersionsAvailableSet ) { - createContextARBMapVersionsAvailable(4, false /* compat */); // GL4 - createContextARBMapVersionsAvailable(4, true /* compat */); // GL4bc - createContextARBMapVersionsAvailable(3, false /* compat */); // GL3 - createContextARBMapVersionsAvailable(3, true /* compat */); // GL3bc - createContextARBMapVersionsAvailable(2, true /* compat */); // GL2 - mappedVersionsAvailableSet=true; - if (DEBUG) { - System.err.println(getThreadName() + ": !!! createContextARB: SET mappedVersionsAvailableSet "+ mappedVersionsAvailableSet); - } - } - } - } + + mapGLVersions(); int reqMajor; if(glp.isGL4()) { @@ -502,6 +488,24 @@ public abstract class GLContextImpl extends GLContext { return _ctx; } + private void mapGLVersions() { + if (!mappedVersionsAvailableSet) { + synchronized (mappedVersionsAvailableLock) { + if (!mappedVersionsAvailableSet) { + createContextARBMapVersionsAvailable(4, false); // GL4 + createContextARBMapVersionsAvailable(4, true); // GL4bc + createContextARBMapVersionsAvailable(3, false); // GL3 + createContextARBMapVersionsAvailable(3, true); // GL3bc + createContextARBMapVersionsAvailable(2, true); // GL2 + mappedVersionsAvailableSet = true; + if (DEBUG) { + System.err.println(getThreadName() + ": !!! createContextARB: SET mappedVersionsAvailableSet " + mappedVersionsAvailableSet); + } + } + } + } + } + private final void createContextARBMapVersionsAvailable(int reqMajor, boolean compat) { long _context; diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java index b13cb44ee..cd1422652 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java @@ -42,9 +42,6 @@ package com.jogamp.opengl.impl; import java.nio.*; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.jogamp.common.util.*; -import com.jogamp.gluegen.runtime.*; -import java.lang.reflect.*; import java.security.*; /** Extends GLDrawableFactory with a few methods for handling @@ -70,11 +67,11 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { throw new IllegalArgumentException("Null target"); } AbstractGraphicsConfiguration config = target.getGraphicsConfiguration().getNativeGraphicsConfiguration(); - GLCapabilities caps = (GLCapabilities) target.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); + GLCapabilities caps = (GLCapabilities) config.getChosenCapabilities(); GLDrawable result = null; if(caps.isOnscreen()) { if(DEBUG) { - System.out.println("GLDrawableFactoryImpl.createGLDrawable -> OnscreenDrawable: "+target); + System.err.println("GLDrawableFactoryImpl.createGLDrawable -> OnscreenDrawable: "+target); } result = createOnscreenDrawable(target); } else { @@ -83,19 +80,19 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { } if(caps.isPBuffer()) { if(DEBUG) { - System.out.println("GLDrawableFactoryImpl.createGLDrawable -> PbufferDrawable: "+target); + System.err.println("GLDrawableFactoryImpl.createGLDrawable -> PbufferDrawable: "+target); } result = createGLPbufferDrawable(target); } if(null==result) { if(DEBUG) { - System.out.println("GLDrawableFactoryImpl.createGLDrawable -> OffScreenDrawable: "+target); + System.err.println("GLDrawableFactoryImpl.createGLDrawable -> OffScreenDrawable: "+target); } result = createOffscreenDrawable(target); } } if(DEBUG) { - System.out.println("GLDrawableFactoryImpl.createGLDrawable: "+result); + System.err.println("GLDrawableFactoryImpl.createGLDrawable: "+result); } return result; } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java index ddcac9628..46bc9460d 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/GLXUtil.java @@ -34,7 +34,6 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.jogamp.nativewindow.impl.x11.*; public class GLXUtil { public static String getExtension(long display) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java index afd005bb4..dafad21d2 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java @@ -33,9 +33,7 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.jogamp.opengl.impl.*; -import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import com.jogamp.nativewindow.impl.*; import com.jogamp.nativewindow.impl.x11.*; @@ -57,7 +55,6 @@ public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable { NullWindow nw = (NullWindow) getNativeWindow(); X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)nw.getGraphicsConfiguration().getNativeGraphicsConfiguration(); - GLCapabilities caps = (GLCapabilities) config.getChosenCapabilities(); X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice(); long dpy = device.getHandle(); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java index a1e4585f7..550bde761 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXContext.java @@ -44,7 +44,6 @@ import javax.media.nativewindow.x11.*; import javax.media.opengl.*; import com.jogamp.opengl.impl.*; import com.jogamp.nativewindow.impl.NullWindow; -import com.jogamp.nativewindow.impl.x11.*; public class X11ExternalGLXContext extends X11GLXContext { private boolean firstMakeCurrent = true; diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java index 8a8702a3e..006a55e20 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11ExternalGLXDrawable.java @@ -42,23 +42,24 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; -import com.jogamp.opengl.impl.*; import com.jogamp.nativewindow.impl.NullWindow; public class X11ExternalGLXDrawable extends X11GLXDrawable { - private int fbConfigID; - private int renderType; + + //TODO? those are not used +// private int fbConfigID; +// private int renderType; private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeWindow component, int renderType) { super(factory, component, true); - this.renderType = renderType; +// this.renderType = renderType; // Need GLXFBConfig ID in order to properly create new contexts // on this drawable - X11GLXGraphicsConfiguration cfg = (X11GLXGraphicsConfiguration) component.getGraphicsConfiguration(); - fbConfigID = cfg.getFBConfigID(); +// X11GLXGraphicsConfiguration cfg = (X11GLXGraphicsConfiguration) component.getGraphicsConfiguration(); +// fbConfigID = cfg.getFBConfigID(); } protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java index baa6ce1aa..90650bde9 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java @@ -43,10 +43,7 @@ import java.nio.*; import java.util.*; import javax.media.opengl.*; import javax.media.nativewindow.*; -import javax.media.nativewindow.x11.*; import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.impl.x11.glx.*; -import com.jogamp.nativewindow.impl.x11.*; import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver; @@ -402,9 +399,8 @@ public abstract class X11GLXContext extends GLContextImpl { glXQueryExtensionsStringInitialized = true; } if (glXQueryExtensionsStringAvailable) { - long display = drawable.getNativeWindow().getDisplayHandle(); - String ret = GLX.glXQueryExtensionsString(drawable.getNativeWindow().getDisplayHandle(), - drawable.getNativeWindow().getScreenIndex()); + NativeWindow nw = drawable.getNativeWindow(); + String ret = GLX.glXQueryExtensionsString(nw.getDisplayHandle(), nw.getScreenIndex()); if (DEBUG) { System.err.println("!!! GLX extensions: " + ret); } @@ -431,7 +427,6 @@ public abstract class X11GLXContext extends GLContextImpl { GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities(); if(!glCaps.isOnscreen()) return; - long display = drawable.getNativeWindow().getDisplayHandle(); GLXExt glXExt = getGLXExt(); if(0==hasSwapIntervalSGI) { try { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java index 25cfcc723..8547471fb 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawable.java @@ -42,7 +42,6 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.opengl.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.x11.*; public abstract class X11GLXDrawable extends GLDrawableImpl { protected X11GLXDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java index d958996a8..c808441ed 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDynamicLibraryBundleInfo.java @@ -28,12 +28,7 @@ package com.jogamp.opengl.impl.x11.glx; import com.jogamp.opengl.impl.*; -import com.jogamp.common.os.DynamicLookupHelper; -import com.jogamp.common.os.NativeLibrary; -import com.jogamp.common.os.Platform; import java.util.*; -import java.security.*; -import javax.media.opengl.GLException; public class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo { protected X11GLXDynamicLibraryBundleInfo() { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 5c04a29fe..8fcc7994b 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -41,7 +41,7 @@ import javax.media.opengl.*; import com.jogamp.opengl.impl.*; -/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits +/** Subclass of GraphicsConfigurationFactory used when non-AWT toolkits are used on X11 platforms. Toolkits will likely need to delegate to this one to change the accepted and returned types of the GraphicsDevice and GraphicsConfiguration abstractions. */ @@ -56,7 +56,18 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen) { - return chooseGraphicsConfigurationStatic(capabilities, chooser, absScreen); + if (!(absScreen instanceof X11GraphicsScreen)) { + throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here"); + } + + if (capabilities != null && !(capabilities instanceof GLCapabilities)) { + throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects"); + } + + if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) { + throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects"); + } + return chooseGraphicsConfigurationStatic((GLCapabilities)capabilities, (GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen); } /** @@ -109,52 +120,33 @@ public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFac return new X11GLXGraphicsConfiguration(x11Screen, (null!=capsFB)?capsFB:caps, caps, null, xvis, fbcfg, fbid); } */ - protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(Capabilities capabilities, - CapabilitiesChooser chooser, - AbstractGraphicsScreen absScreen) { - if (absScreen == null) { + protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilities capabilities, + GLCapabilitiesChooser chooser, + X11GraphicsScreen x11Screen) { + if (x11Screen == null) { throw new IllegalArgumentException("AbstractGraphicsScreen is null"); } - if (!(absScreen instanceof X11GraphicsScreen)) { - throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here"); - } - X11GraphicsScreen x11Screen = (X11GraphicsScreen)absScreen; - - - if (capabilities != null && - !(capabilities instanceof GLCapabilities)) { - throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects"); - } - - if (chooser != null && - !(chooser instanceof GLCapabilitiesChooser)) { - throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects"); - } if (capabilities == null) { capabilities = new GLCapabilities(null); } - boolean onscreen = capabilities.isOnscreen(); - boolean usePBuffer = ((GLCapabilities)capabilities).isPBuffer(); - GLCapabilities caps2 = (GLCapabilities) capabilities.clone(); + GLCapabilitiesChooser glChooser = chooser; + + boolean usePBuffer = caps2.isPBuffer(); + if(!caps2.isOnscreen()) { // OFFSCREEN !DOUBLE_BUFFER // FIXME DBLBUFOFFSCRN caps2.setDoubleBuffered(false); } - X11GLXGraphicsConfiguration res; - res = chooseGraphicsConfigurationFBConfig((GLCapabilities) caps2, - (GLCapabilitiesChooser) chooser, - x11Screen); + X11GLXGraphicsConfiguration res = chooseGraphicsConfigurationFBConfig(caps2, glChooser, x11Screen); if(null==res) { if(usePBuffer) { throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig for "+caps2); } - res = chooseGraphicsConfigurationXVisual((GLCapabilities) caps2, - (GLCapabilitiesChooser) chooser, - x11Screen); + res = chooseGraphicsConfigurationXVisual(caps2, glChooser, x11Screen); } if(null==res) { throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig and XVisual for "+caps2); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java index 5482d5566..f3674c108 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXContext.java @@ -40,8 +40,6 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.impl.x11.*; public class X11OffscreenGLXContext extends X11GLXContext { private X11OffscreenGLXDrawable drawable; diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java index bb1e2fd4c..e231aba4b 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXContext.java @@ -36,23 +36,17 @@ * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ - package com.jogamp.opengl.impl.x11.glx; -import java.util.*; - -import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.impl.x11.*; public class X11OnscreenGLXContext extends X11GLXContext { - public X11OnscreenGLXContext(X11OnscreenGLXDrawable drawable, - GLContext shareWith) { - super(drawable, shareWith); - } - - protected boolean createImpl() { - return createContext(true); - } + + public X11OnscreenGLXContext(X11OnscreenGLXDrawable drawable, GLContext shareWith) { + super(drawable, shareWith); + } + + protected boolean createImpl() { + return createContext(true); + } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java index a9aafa5af..3a8bbfecc 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java @@ -41,9 +41,6 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.nativewindow.*; import javax.media.opengl.*; -import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.impl.x11.*; -import com.jogamp.nativewindow.impl.x11.*; public class X11OnscreenGLXDrawable extends X11GLXDrawable { /** GLXWindow can't be made current on AWT with NVidia driver, hence disabled for now */ diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java index debf28127..8d118f2df 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXContext.java @@ -40,14 +40,11 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; -import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.impl.x11.*; public class X11PbufferGLXContext extends X11GLXContext { private X11PbufferGLXDrawable drawable; - public X11PbufferGLXContext(X11PbufferGLXDrawable drawable, - GLContext shareWith) { + public X11PbufferGLXContext(X11PbufferGLXDrawable drawable, GLContext shareWith) { super(drawable, shareWith); this.drawable = drawable; } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java index 009fa147f..c00f9909e 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java @@ -41,9 +41,6 @@ package com.jogamp.opengl.impl.x11.glx; import javax.media.opengl.*; import javax.media.nativewindow.*; -import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.impl.x11.glx.*; -import com.jogamp.nativewindow.impl.x11.*; public class X11PbufferGLXDrawable extends X11GLXDrawable { protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeWindow target) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java index 9e52040cf..de55a3148 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java @@ -34,19 +34,14 @@ package com.jogamp.opengl.impl.x11.glx.awt; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; -import java.awt.GraphicsEnvironment; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.nativewindow.awt.*; import javax.media.opengl.*; -import javax.media.opengl.awt.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.jawt.*; import com.jogamp.nativewindow.impl.jawt.x11.*; import com.jogamp.nativewindow.impl.x11.*; -import com.jogamp.opengl.impl.x11.*; -import com.jogamp.opengl.impl.x11.glx.*; public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfigurationFactory { protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration"); @@ -111,11 +106,8 @@ public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfiguration if(DEBUG) { System.err.println("AWT Colormodel compatible: "+capabilities); } - - x11Config = (X11GraphicsConfiguration) - GraphicsConfigurationFactory.getFactory(x11Device).chooseGraphicsConfiguration(capabilities, - chooser, - x11Screen); + GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(x11Device); + x11Config = (X11GraphicsConfiguration)factory.chooseGraphicsConfiguration(capabilities, chooser, x11Screen); if (x11Config == null) { throw new GLException("Unable to choose a GraphicsConfiguration: "+capabilities+",\n\t"+chooser+"\n\t"+x11Screen); } |