aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-08-29 04:20:27 +0200
committerSven Gothel <[email protected]>2015-08-29 04:20:27 +0200
commit390ccc3e549e4cc13b7dab91387e72c1f10b77a9 (patch)
tree402920f2c9671abef2ca25935b792a10a0685ffe /src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
parentc835cdddfb37c5e8df424f984b821163b5645198 (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/ExtensionAvailabilityCache.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
index 331414869..b28b79418 100644
--- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
@@ -45,7 +45,6 @@ import java.util.StringTokenizer;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES3;
-import com.jogamp.opengl.GL2GL3;
import com.jogamp.opengl.GLContext;
import com.jogamp.common.util.VersionNumber;
@@ -138,9 +137,9 @@ final class ExtensionAvailabilityCache {
boolean useGetStringi = false;
- // Use 'glGetStringi' only for ARB GL3 context,
+ // Use 'glGetStringi' only for ARB GL3 and ES3 context,
// on GL2 platforms the function might be available, but not working.
- if ( context.isGL3() ) {
+ if ( context.isGL3() || context.isGLES3() ) {
if ( ! context.isFunctionAvailable("glGetStringi") ) {
if(DEBUG) {
System.err.println("GLContext: GL >= 3.1 usage, but no glGetStringi");
@@ -156,16 +155,16 @@ final class ExtensionAvailabilityCache {
}
if(useGetStringi) {
- final GL2GL3 gl2gl3 = gl.getGL2GL3();
+ final GL2ES3 gl2es3 = (GL2ES3)gl; // validated via context - OK!
final int count;
{
final int[] val = { 0 } ;
- gl2gl3.glGetIntegerv(GL2ES3.GL_NUM_EXTENSIONS, val, 0);
+ gl2es3.glGetIntegerv(GL2ES3.GL_NUM_EXTENSIONS, val, 0);
count = val[0];
}
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < count; i++) {
- final String ext = gl2gl3.glGetStringi(GL.GL_EXTENSIONS, i);
+ final String ext = gl2es3.glGetStringi(GL.GL_EXTENSIONS, i);
if( null == availableExtensionCache.put(ext, ext) ) {
// new one
if( 0 < i ) {