diff options
author | Sven Gothel <sgothel@jausoft.com> | 2015-08-29 04:20:27 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2015-08-29 04:20:27 +0200 |
commit | 390ccc3e549e4cc13b7dab91387e72c1f10b77a9 (patch) | |
tree | 402920f2c9671abef2ca25935b792a10a0685ffe /src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | |
parent | c835cdddfb37c5e8df424f984b821163b5645198 (diff) |
Bug 1203: GLDrawable-Stateless operations in GLContextImpl, using ctxVersion and ctxOptions
- State-less operation during profile probing (mapGLVersions).
While probing the GLDrawable/GLProfile and GL instance
may not reflect the currently probed OpenGL profile.
Hence stateless operation by passing required information
is required for:
- GLDynamicLookupHelper must be fetched via
'major-version and contextOptions'.
- GLContextImpl.resetProcAddress(..)
- GLContextImpl.updateGLXProcAddressTable()
- GLContextImpl.setGLFunctionAvailability(..)
- ExtensionAvailabilityCache
TODO: Add replacement for GLProfile validation,
which is disabled right now.:
drawable.getGLProfile().verifyEquality(gl.getGLProfile())
The GLDrawable.GLProfile maybe less than GL's GLProfile
due to current context-version and options.
Hence we would need a 'GLProfile.bwCompatibleWith(GLProfile)'.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index a45a7efe0..937334513 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -867,17 +867,21 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - public GLDynamicLookupHelper getGLDynamicLookupHelper(final String esProfile) { + public final GLDynamicLookupHelper getGLDynamicLookupHelper(final int majorVersion, final int contextOptions) { final GLDynamicLookupHelper res; - if ( GLProfile.GLES2 == esProfile || GLProfile.GLES3 == esProfile ) { + if ( EGLContext.isGLES2ES3(majorVersion, contextOptions) ) { res = eglES2DynamicLookupHelper; - } else if ( GLProfile.GLES1 == esProfile ) { + } else if ( EGLContext.isGLES1(majorVersion, contextOptions) ) { res = eglES1DynamicLookupHelper; - } else { + } else if( EGLContext.isGLDesktop(contextOptions) ) { res = eglGLnDynamicLookupHelper; + } else { + throw new IllegalArgumentException("neither GLES1, GLES2, GLES3 nor desktop GL has been specified: "+majorVersion+" ("+EGLContext.getGLProfile(new StringBuilder(), contextOptions).toString()); } - if( null == res ) { - throw new GLException("No lookup for esProfile "+esProfile); + if( DEBUG_SHAREDCTX ) { + if( null == res ) { + System.err.println("EGLDrawableFactory.getGLDynamicLookupHelper: NULL for profile "+majorVersion+" ("+EGLContext.getGLProfile(new StringBuilder(), contextOptions).toString()); + } } return res; } |