From 3fbcf164be214f3c36bfc062e3ef63ddcc2e1687 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 6 Mar 2012 09:59:34 +0100 Subject: NativeWindow public* reorg 3/3 ; NativeVisualID -> VisualIDHolder incl. proper utilization. - VisualIDHolder: Update documentation (Exception case, etc) - NativeVisualID -> VisualIDHolder (public) - incl. generic Comparator - better doc and enum values - VID_UNDEFINED == 0 - methods shall not throw exception, but return UNDEFINED - CapabilitiesImmutable extends VisualIDHolder - All Capabilties impl. - use VID_UNDEFINED for undef. value - use final private (immutable) fields - AbstractGraphicsConfiguration extends VisualIDHolder - X11 CreateDummyWindow takes (int) visualID --- src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java index 32055c5e0..b54089d13 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java @@ -36,15 +36,15 @@ package jogamp.opengl.egl; -import jogamp.nativewindow.NativeVisualID; -import jogamp.nativewindow.NativeVisualID.NVIDType; import jogamp.opengl.GLDynamicLookupHelper; import jogamp.opengl.GLDrawableImpl; import javax.media.nativewindow.*; -import javax.media.nativewindow.egl.*; +import javax.media.nativewindow.VisualIDHolder.VIDType; import javax.media.opengl.*; +import com.jogamp.nativewindow.egl.*; + public abstract class EGLDrawable extends GLDrawableImpl { protected boolean ownEGLDisplay = false; // for destruction protected boolean ownEGLSurface = false; // for destruction @@ -181,17 +181,8 @@ public abstract class EGLDrawable extends GLDrawableImpl { System.err.println(getThreadName() + ": Reusing chosenCaps: "+eglConfig); } } else { - final int nativeVisualID; - { - final GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) aConfig.getChosenCapabilities(); - if(capsChosen instanceof NativeVisualID) { - nativeVisualID = ((NativeVisualID)capsChosen).getVisualID(NVIDType.NATIVE_ID); - } else { - nativeVisualID = -1; - } - } eglConfig = EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( - capsRequested, capsRequested, null, s, nativeVisualID); + capsRequested, capsRequested, null, s, aConfig.getVisualID(VIDType.NATIVE)); if (null == eglConfig) { throw new GLException("Couldn't create EGLGraphicsConfiguration from "+s); -- cgit v1.2.3