From bafd9b99816f55c105230a59211caf13f0315910 Mon Sep 17 00:00:00 2001 From: Sven Gothel <sgothel@jausoft.com> Date: Wed, 23 Nov 2011 07:44:42 +0100 Subject: NativeSurface's getGraphicsConfiguration() returns the native (delegated) AbstractGraphicsConfiguration, if delegation is used. This change restricts the usage of AbstractGraphicsConfiguration's getNativeGraphicsConfiguration() to NativeSurface implementations and hence reduces complexity. NativeSurface implementations are adapted and access to it's AbstractGraphicsConfiguration is controlled via get/set method avoiding flawed usage (read/write), since read access shall return the delegated AbstractGraphicsConfiguration, if used. --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 58f1bf1cd..a79ef32a3 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -454,7 +454,7 @@ public abstract class GLContextImpl extends GLContext { boolean newCreated = false; if (!isCreated()) { GLProfile.initProfiles( - getGLDrawable().getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice()); + getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice()); newCreated = createImpl(); // may throws exception if fails! if (DEBUG) { if(newCreated) { @@ -548,7 +548,7 @@ public abstract class GLContextImpl extends GLContext { */ protected final long createContextARB(long share, boolean direct) { - AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration(); AbstractGraphicsDevice device = config.getScreen().getDevice(); GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities(); GLProfile glp = glCaps.getGLProfile(); @@ -654,7 +654,7 @@ public abstract class GLContextImpl extends GLContext { } } if(0!=_context) { - AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice(); + AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(); if( isExtensionAvailable("GL_ARB_ES2_compatibility") ) { ctp |= CTX_PROFILE_ES2_COMPAT; } @@ -873,7 +873,7 @@ public abstract class GLContextImpl extends GLContext { updateGLXProcAddressTable(); - AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration(); AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); final int ctxImplBits = drawable.getChosenGLCapabilities().getHardwareAccelerated() ? GLContext.CTX_IMPL_ACCEL_HARD : GLContext.CTX_IMPL_ACCEL_SOFT; contextFQN = getContextFQN(adevice, major, minor, ctxProfileBits, ctxImplBits); -- cgit v1.2.3