diff options
author | Sven Gothel <[email protected]> | 2013-07-16 20:46:42 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-16 20:46:42 +0200 |
commit | 1a20ef3aa1dc9acedd7da0475ee19d4c40b18498 (patch) | |
tree | 491271ad5d447b8978c7d82494606653acf7afbd /src/newt | |
parent | dba2faf8520a43a809eb756869c6c97a0a2ef2cd (diff) |
Redefine: isGLES3Compatible() and isGL4ES3(), i.e. allow GL4ES3 usage in case proper ES3_compat is given.
isGLES3Compatible() and isGL4ES3() of GLBase _and_ GLContext
includes [ GL >= 4.3, GL >= 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ].
Tested GL 'aliasing' w/ TestGLProfile01NEWT, i.e. isGL*() and getGL*().
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 70 |
1 files changed, 54 insertions, 16 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 537b32355..e85d67dea 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -49,6 +49,8 @@ import javax.media.nativewindow.util.InsetsImmutable; import javax.media.nativewindow.util.Point; import javax.media.opengl.FPSCounter; import javax.media.opengl.GL; +import javax.media.opengl.GL3; +import javax.media.opengl.GL4ES3; import javax.media.opengl.GLAnimatorControl; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; @@ -56,6 +58,8 @@ import javax.media.opengl.GLCapabilitiesImmutable; import javax.media.opengl.GLContext; import javax.media.opengl.GLDrawable; import javax.media.opengl.GLDrawableFactory; +import javax.media.opengl.GLES2; +import javax.media.opengl.GLES3; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; @@ -830,23 +834,38 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind * A most simple JOGL AWT test entry */ public static void main(String args[]) { - boolean forceES2 = false; - boolean forceES3 = false; - boolean forceGL3 = false; - if( null != args ) { - for(int i=0; i<args.length; i++) { - if(args[i].equals("-es2")) { - forceES2 = true; - } else if(args[i].equals("-es3")) { - forceES3 = true; - } else if(args[i].equals("-gl3")) { - forceGL3 = true; - } + final boolean forceES2; + final boolean forceES3; + final boolean forceGL3; + final boolean forceGL4ES3; + { + boolean _forceES2 = false; + boolean _forceES3 = false; + boolean _forceGL3 = false; + boolean _forceGL4ES3 = false; + if( null != args ) { + for(int i=0; i<args.length; i++) { + if(args[i].equals("-es2")) { + _forceES2 = true; + } else if(args[i].equals("-es3")) { + _forceES3 = true; + } else if(args[i].equals("-gl3")) { + _forceGL3 = true; + } else if(args[i].equals("-gl4es3")) { + _forceGL4ES3 = true; + } + } } + forceES2 = _forceES2; + forceES3 = _forceES3; + forceGL3 = _forceGL3; + forceGL4ES3 = _forceGL4ES3; } - System.err.println("forceES2 "+forceES2); - System.err.println("forceES3 "+forceES3); - System.err.println("forceGL3 "+forceGL3); + System.err.println("forceES2 "+forceES2); + System.err.println("forceES3 "+forceES3); + System.err.println("forceGL3 "+forceGL3); + System.err.println("forceGL4ES3 "+forceGL4ES3); + System.err.println(VersionUtil.getPlatformInfo()); System.err.println(GlueGenVersion.getInstance()); System.err.println(JoglVersion.getInstance()); @@ -854,7 +873,9 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind System.err.println(JoglVersion.getDefaultOpenGLInfo(null, null, true).toString()); final GLProfile glp; - if(forceGL3) { + if(forceGL4ES3) { + glp = GLProfile.get(GLProfile.GL4ES3); + } else if(forceGL3) { glp = GLProfile.get(GLProfile.GL3); } else if(forceES3) { glp = GLProfile.get(GLProfile.GLES3); @@ -876,6 +897,23 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind System.err.println(JoglVersion.getGLInfo(gl, null)); System.err.println("Requested: "+drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()); System.err.println("Chosen : "+drawable.getChosenGLCapabilities()); + System.err.println("GL impl. class "+gl.getClass().getName()); + if( gl.isGL4ES3() ) { + GL4ES3 _gl = gl.getGL4ES3(); + System.err.println("GL4ES3 retrieved, impl. class "+_gl.getClass().getName()); + } + if( gl.isGL3() ) { + GL3 _gl = gl.getGL3(); + System.err.println("GL3 retrieved, impl. class "+_gl.getClass().getName()); + } + if( gl.isGLES3() ) { + GLES3 _gl = gl.getGLES3(); + System.err.println("GLES3 retrieved, impl. class "+_gl.getClass().getName()); + } + if( gl.isGLES2() ) { + GLES2 _gl = gl.getGLES2(); + System.err.println("GLES2 retrieved, impl. class "+_gl.getClass().getName()); + } } @Override |