From ec138f2f5c38a677d840e8719292031d91befaa8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 23 Jan 2015 15:10:20 +0100 Subject: Simplify GLDrawable[Impl|Factory].getGLDynamicLookupHelper(..) - Using GLDrawableFactory.getGLDynamicLookupHelper(String profileName) - Based on String GLProfile name - throws GLException if no lookup handler installed (EGL) - final implementation of GLDrawableImpl.getGLDynamicLookupHelper() using getGLProfile().getImplName() --- src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java | 14 -------------- .../classes/jogamp/opengl/egl/EGLDrawableFactory.java | 17 +++++++++++------ 2 files changed, 11 insertions(+), 20 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java index 5b080a183..4f141fbb1 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java @@ -42,7 +42,6 @@ import javax.media.opengl.GLException; import jogamp.nativewindow.ProxySurfaceImpl; import jogamp.opengl.GLDrawableImpl; -import jogamp.opengl.GLDynamicLookupHelper; import com.jogamp.nativewindow.egl.EGLGraphicsDevice; import com.jogamp.opengl.egl.EGL; @@ -116,19 +115,6 @@ public class EGLDrawable extends GLDrawableImpl { } } - @Override - public GLDynamicLookupHelper getGLDynamicLookupHelper() { - if (getGLProfile().usesNativeGLES3()) { - return getFactoryImpl().getGLDynamicLookupHelper(3); - } else if (getGLProfile().usesNativeGLES2()) { - return getFactoryImpl().getGLDynamicLookupHelper(2); - } else if (getGLProfile().usesNativeGLES1()) { - return getFactoryImpl().getGLDynamicLookupHelper(1); - } else { - throw new GLException("Unsupported: "+getGLProfile()); - } - } - @Override public String toString() { return getClass().getName()+"[realized "+isRealized()+ diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index 967bcb6da..55f6248c8 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -885,14 +885,19 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - public GLDynamicLookupHelper getGLDynamicLookupHelper(final int esProfile) { - if ( 2==esProfile || 3==esProfile ) { - return eglES2DynamicLookupHelper; - } else if (1==esProfile) { - return eglES1DynamicLookupHelper; + public GLDynamicLookupHelper getGLDynamicLookupHelper(final String esProfile) { + final GLDynamicLookupHelper res; + if ( GLProfile.GLES2 == esProfile || GLProfile.GLES3 == esProfile ) { + res = eglES2DynamicLookupHelper; + } else if ( GLProfile.GLES1 == esProfile ) { + res = eglES1DynamicLookupHelper; } else { - return eglGLnDynamicLookupHelper; + res = eglGLnDynamicLookupHelper; } + if( null == res ) { + throw new GLException("No lookup for esProfile "+esProfile); + } + return res; } @Override -- cgit v1.2.3