diff options
author | Sven Gothel <[email protected]> | 2015-01-23 15:10:20 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-01-23 15:10:20 +0100 |
commit | ec138f2f5c38a677d840e8719292031d91befaa8 (patch) | |
tree | 176ab71efb8fac231bf625f5deb3d7f38129a2fd /src/jogl/classes/jogamp/opengl/egl | |
parent | 3471ee732ab1b642a37066c70acbb749eb696d21 (diff) |
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()
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java | 14 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 17 |
2 files changed, 11 insertions, 20 deletions
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; @@ -117,19 +116,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()+ ",\n\tfactory "+getFactory()+ 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 |