diff options
35 files changed, 341 insertions, 593 deletions
diff --git a/etc/profile.jogl b/etc/profile.jogl index 42162457e..025b74dd8 100755 --- a/etc/profile.jogl +++ b/etc/profile.jogl @@ -2,7 +2,7 @@ function print_usage() { - echo "Usage: $0 {JOGL_ALL|JOGL_ALL_NOAWT|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GL2_MIN|JOGL_GL2_MAX} [jogl-build-dir]" + echo "Usage: $0 {JOGL_ALL|JOGL_ALL_NOAWT|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GLDESKTOP_MIN|JOGL_GLDESKTOP_MAX} [jogl-build-dir]" } function concat_jogl_list() @@ -32,7 +32,7 @@ JOGL_CORE="nativewindow.core.jar nativewindow.os.$OSS.jar jogl.core.jar jogl.os. JOGL_TEST="jogl.test.jar" -JOGL_JAR_ALL_NOAWT="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.gles2.jar jogl.gles2.dbg.jar jogl.egl.jar jogl.os.$OSS.jar jogl.gl2es12.jar jogl.gl2.jar jogl.gl2.dbg.jar jogl.util.gl2.jar jogl.gl3.jar jogl.gl3.dbg.jar jogl.gl4.jar jogl.gl4.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gl2.jar jogl.util.gl2.jar jogl.util.fixedfuncemu.jar jogl.cg.jar" +JOGL_JAR_ALL_NOAWT="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.gles2.jar jogl.gles2.dbg.jar jogl.egl.jar jogl.os.$OSS.jar jogl.gl2es12.jar jogl.gldesktop.jar jogl.gldesktop.dbg.jar jogl.util.gldesktop.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gldesktop.jar jogl.util.gldesktop.jar jogl.util.fixedfuncemu.jar jogl.cg.jar" JOGL_JAR_ALL="$JOGL_JAR_ALL_NOAWT $JOGL_AWT" JOGL_LIB_ALL="libjogl_desktop.so libjogl_es1.so libjogl_es2.so libnewt.so libjogl_awt.so" @@ -51,13 +51,13 @@ JOGL_JAR_GL2ES12_MAX="$JOGL_CORE jogl.os.$OSS.jar jogl.gl2es12.jar jogl.gles1.db JOGL_LIB_GL2ES12_MIN="libjogl_gl2es12.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" JOGL_LIB_GL2ES12_MAX="libjogl_gl2es12.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" -JOGL_JAR_GL2_MIN="$JOGL_CORE jogl.os.$OSS.jar jogl.gl2.jar jogl.gl2.dbg.jar" -JOGL_JAR_GL2_MAX="$JOGL_CORE jogl.os.$OSS.jar jogl.gl2.jar jogl.gl2.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gl2.jar jogl.util.gl2.jar $JOGL_AWT jogl.cg.jar" -JOGL_LIB_GL2_MIN="libjogl_desktop.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" -JOGL_LIB_GL2_MAX="libjogl_desktop.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" +JOGL_JAR_GLDESKTOP_MIN="$JOGL_CORE jogl.os.$OSS.jar jogl.gldesktop.jar jogl.gldesktop.dbg.jar" +JOGL_JAR_GLDESKTOP_MAX="$JOGL_CORE jogl.os.$OSS.jar jogl.gldesktop.jar jogl.gldesktop.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gldesktop.jar jogl.util.gldesktop.jar $JOGL_AWT jogl.cg.jar" +JOGL_LIB_GLDESKTOP_MIN="libjogl_desktop.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" +JOGL_LIB_GLDESKTOP_MAX="libjogl_desktop.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so" -export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ES1_MIN JOGL_JAR_ES1_MAX JOGL_JAR_ES2_MIN JOGL_JAR_ES2_MAX JOGL_JAR_GL2ES12_MIN JOGL_JAR_GL2ES12_MAX JOGL_JAR_GL2_MIN JOGL_JAR_GL2_MAX -export JOGL_LIB_ALL JOGL_LIB_ES1_MIN JOGL_LIB_ES1_MAX JOGL_LIB_ES2_MIN JOGL_LIB_ES2_MAX JOGL_LIB_GL2ES12_MIN JOGL_LIB_GL2ES12_MAX JOGL_LIB_GL2_MIN JOGL_LIB_GL2_MAX +export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ES1_MIN JOGL_JAR_ES1_MAX JOGL_JAR_ES2_MIN JOGL_JAR_ES2_MAX JOGL_JAR_GL2ES12_MIN JOGL_JAR_GL2ES12_MAX JOGL_JAR_GLDESKTOP_MIN JOGL_JAR_GLDESKTOP_MAX +export JOGL_LIB_ALL JOGL_LIB_ES1_MIN JOGL_LIB_ES1_MAX JOGL_LIB_ES2_MIN JOGL_LIB_ES2_MAX JOGL_LIB_GL2ES12_MIN JOGL_LIB_GL2ES12_MAX JOGL_LIB_GLDESKTOP_MIN JOGL_LIB_GLDESKTOP_MAX THISDIR=`dirname $0` @@ -125,11 +125,11 @@ if [ ! -z "$JOGL_PROFILE" ] ; then JOGL_GL2ES12_MAX) JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GL2ES12_MAX) ;; - JOGL_GL2_MIN) - JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GL2_MIN) + JOGL_GLDESKTOP_MIN) + JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GLDESKTOP_MIN) ;; - JOGL_GL2_MAX) - JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GL2_MAX) + JOGL_GLDESKTOP_MAX) + JOGL_CLASSPATH=$(concat_jogl_list $JOGL_BUILD_DIR $JOGL_JAR_GLDESKTOP_MAX) ;; esac diff --git a/jnlp-files/jogl-all-awt.jnlp b/jnlp-files/jogl-all-awt.jnlp index 125980882..718d09da7 100644 --- a/jnlp-files/jogl-all-awt.jnlp +++ b/jnlp-files/jogl-all-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - ALL.AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-all-noawt.jnlp b/jnlp-files/jogl-all-noawt.jnlp index 7159ba8e7..3e4536dc5 100644 --- a/jnlp-files/jogl-all-noawt.jnlp +++ b/jnlp-files/jogl-all-noawt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - ALL.NO_AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-awt.jnlp b/jnlp-files/jogl-awt.jnlp index 03c61b37a..3e823ce50 100644 --- a/jnlp-files/jogl-awt.jnlp +++ b/jnlp-files/jogl-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - AWT.</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-core.jnlp b/jnlp-files/jogl-core.jnlp index c1dbcfc1d..05ea506e4 100644 --- a/jnlp-files/jogl-core.jnlp +++ b/jnlp-files/jogl-core.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - CORE.</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/jogl-gl2es12.jnlp b/jnlp-files/jogl-gl2es12.jnlp index 25402adcb..4a2c8502d 100644 --- a/jnlp-files/jogl-gl2es12.jnlp +++ b/jnlp-files/jogl-gl2es12.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java programming language binding for the OpenGL 3D graphics API - GL2ES12.</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/nativewindow-all-awt.jnlp b/jnlp-files/nativewindow-all-awt.jnlp index f22166ecb..34edf4a1f 100644 --- a/jnlp-files/nativewindow-all-awt.jnlp +++ b/jnlp-files/nativewindow-all-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java API for a binding to a native windowing system - 2.0 - ALL.AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/nativewindow-awt.jnlp b/jnlp-files/nativewindow-awt.jnlp index aa07c3a24..1cc1a62be 100644 --- a/jnlp-files/nativewindow-awt.jnlp +++ b/jnlp-files/nativewindow-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java API for a binding to a native windowing system - 2.0 - AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/nativewindow.jnlp b/jnlp-files/nativewindow.jnlp index 60a07aede..b8ed6f36f 100644 --- a/jnlp-files/nativewindow.jnlp +++ b/jnlp-files/nativewindow.jnlp @@ -9,6 +9,7 @@ <description kind="short">Java API for a binding to a native windowing system - 2.0 - CORE</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-all-awt.jnlp b/jnlp-files/newt-all-awt.jnlp index 7378e8ca2..24183b9e2 100644 --- a/jnlp-files/newt-all-awt.jnlp +++ b/jnlp-files/newt-all-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - ALL.AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-all-noawt.jnlp b/jnlp-files/newt-all-noawt.jnlp index 752d96add..36f437296 100644 --- a/jnlp-files/newt-all-noawt.jnlp +++ b/jnlp-files/newt-all-noawt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - ALL.NO_AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-awt.jnlp b/jnlp-files/newt-awt.jnlp index 28bb8e706..f4cd0799e 100644 --- a/jnlp-files/newt-awt.jnlp +++ b/jnlp-files/newt-awt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - AWT</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt-jogl.jnlp b/jnlp-files/newt-jogl.jnlp index 1ac69781a..bd8d8a675 100644 --- a/jnlp-files/newt-jogl.jnlp +++ b/jnlp-files/newt-jogl.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - JOGL</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/jnlp-files/newt.jnlp b/jnlp-files/newt.jnlp index cb6899256..71eb9952d 100644 --- a/jnlp-files/newt.jnlp +++ b/jnlp-files/newt.jnlp @@ -9,6 +9,7 @@ <description kind="short">NEWT - A NativeWindow Interface implementation - CORE</description> <offline-allowed/> </information> + <update check="background" policy="always"/> <security> <all-permissions/> </security> diff --git a/make/build-common.xml b/make/build-common.xml index ccbf56fd6..cc40a5cd4 100644 --- a/make/build-common.xml +++ b/make/build-common.xml @@ -4,6 +4,14 @@ <description>Common JOGL Stuff</description> + <fail message="Please build using Ant 1.8.0 or higher."> + <condition> + <not> + <antversion atleast="1.8.0"/> + </not> + </condition> + </fail> + <!-- Pull in GlueGen cpptasks build file --> <property name="gluegen.root" value="../../gluegen" /> <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> @@ -254,7 +262,7 @@ <property name="jogl.egl.jar" value="${build.jogl}/jogl.egl.jar" /> <property name="jogl.glutess.jar" value="${build.jogl}/jogl.glu.tess.jar" /> <property name="jogl.glumipmap.jar" value="${build.jogl}/jogl.glu.mipmap.jar" /> - <property name="jogl.glugl2.jar" value="${build.jogl}/jogl.glu.gl2.jar" /> + <property name="jogl.glugldesktop.jar" value="${build.jogl}/jogl.glu.gldesktop.jar" /> <property name="jogl.os.x11.jar" value="${build.jogl}/jogl.os.x11.jar" /> <property name="jogl.os.win.jar" value="${build.jogl}/jogl.os.win.jar" /> @@ -262,20 +270,14 @@ <property name="jogl.gl2es12.jar" value="${build.jogl}/jogl.gl2es12.jar" /> - <property name="jogl.gl2.jar" value="${build.jogl}/jogl.gl2.jar" /> - <property name="jogl.gl2.dbg.jar" value="${build.jogl}/jogl.gl2.dbg.jar" /> - - <property name="jogl.gl3.jar" value="${build.jogl}/jogl.gl3.jar" /> - <property name="jogl.gl3.dbg.jar" value="${build.jogl}/jogl.gl3.dbg.jar" /> - - <property name="jogl.gl4.jar" value="${build.jogl}/jogl.gl4.jar" /> - <property name="jogl.gl4.dbg.jar" value="${build.jogl}/jogl.gl4.dbg.jar" /> + <property name="jogl.gldesktop.jar" value="${build.jogl}/jogl.gldesktop.jar" /> + <property name="jogl.gldesktop.dbg.jar" value="${build.jogl}/jogl.gldesktop.dbg.jar" /> <property name="jogl.omx.jar" value="${build.jogl}/jogl.omx.jar" /> <property name="jogl.awt.jar" value="${build.jogl}/jogl.awt.jar" /> <property name="jogl.util.jar" value="${build.jogl}/jogl.util.jar" /> - <property name="jogl.util.gl2.jar" value="${build.jogl}/jogl.util.gl2.jar" /> + <property name="jogl.util.gldesktop.jar" value="${build.jogl}/jogl.util.gldesktop.jar" /> <property name="jogl.util.awt.jar" value="${build.jogl}/jogl.util.awt.jar" /> <property name="jogl.util.fixedfuncemu.jar" value="${build.jogl}/jogl.util.fixedfuncemu.jar" /> <property name="jogl.sdk.jar" value="${build.jogl}/jogl.sdk.jar" /> diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 6d95ebea8..760200398 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -86,7 +86,7 @@ <property name="java.part.glumipmap" value="com/jogamp/opengl/impl/glu/mipmap/**"/> - <property name="java.part.glugl2" + <property name="java.part.glugldesktop" value="com/jogamp/opengl/impl/glu/gl2/** com/jogamp/opengl/impl/glu/nurbs/** com/jogamp/opengl/impl/glu/registry/** javax/media/opengl/glu/gl2/**"/> <property name="java.part.openmax" @@ -104,23 +104,14 @@ <property name="java.part.cgl" value="com/jogamp/opengl/impl/macosx/cgl/*"/> - <property name="java.part.gl4" - value="com/jogamp/opengl/impl/**/gl4/**"/> + <property name="java.part.gl2es12" + value="com/jogamp/opengl/impl/gl2es12/**"/> - <property name="java.part.gl4.dbg" - value="javax/media/opengl/TraceGL4.* javax/media/opengl/DebugGL4.* javax/media/opengl/TraceGL4bc.* javax/media/opengl/DebugGL4bc.*"/> + <property name="java.part.gldesktop" + value="com/jogamp/opengl/impl/**/gl2/** com/jogamp/opengl/impl/**/gl3/** com/jogamp/opengl/impl/**/gl4/**"/> - <property name="java.part.gl3" - value="com/jogamp/opengl/impl/**/gl3/**"/> - - <property name="java.part.gl3.dbg" - value="javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.* javax/media/opengl/TraceGL3bc.* javax/media/opengl/DebugGL3bc.*"/> - - <property name="java.part.gl2" - value="com/jogamp/opengl/impl/**/gl2/**"/> - - <property name="java.part.gl2.dbg" - value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.*"/> + <property name="java.part.gldesktop.dbg" + value="javax/media/opengl/TraceGL2.* javax/media/opengl/DebugGL2.* javax/media/opengl/TraceGL2GL3.* javax/media/opengl/DebugGL2GL3.* javax/media/opengl/TraceGL3.* javax/media/opengl/DebugGL3.* javax/media/opengl/TraceGL3bc.* javax/media/opengl/DebugGL3bc.* javax/media/opengl/TraceGL4.* javax/media/opengl/DebugGL4.* javax/media/opengl/TraceGL4bc.* javax/media/opengl/DebugGL4bc.*"/> <property name="java.part.es1" value="javax/media/opengl/**/es1/** com/jogamp/opengl/**/es1/**"/> @@ -143,7 +134,7 @@ <property name="java.part.util.awt" value="com/jogamp/opengl/util/**/awt/** com/jogamp/opengl/util/AWTAnimatorImpl*"/> - <property name="java.part.util.gl2" + <property name="java.part.util.gldesktop" value="com/jogamp/opengl/util/**/gl2/**"/> <property name="java.part.util.glsl" @@ -176,7 +167,7 @@ value="com/jogamp/opengl/impl/gl2/fixme/** com/jogamp/audio/windows/waveout/TestSpatialization.java" /> <property name="java.excludes.cdcfp" - value="${java.excludes.fixme} ${java.part.nv-cg} ${java.part.gl2} ${java.part.gl2.dbg} ${java.part.gl3} ${java.part.gl3.dbg} ${java.part.awt} ${java.part.glugl2} ${java.part.util.awt} ${java.part.util.gl2} com/jogamp/opengl/util/TGAWriter.java"/> + value="${java.excludes.fixme} ${java.part.nv-cg} ${java.part.gldesktop} ${java.part.gldesktop.dbg} ${java.part.awt} ${java.part.glugldesktop} ${java.part.util.awt} ${java.part.util.gldesktop} com/jogamp/opengl/util/TGAWriter.java"/> <condition property="java.excludes.desktop" value="${java.part.glx} ${java.excludes.cdcfp}"> @@ -225,7 +216,7 @@ <!-- The GL headers from which Java files are generated --> <property name="stub.includes.opengl" value="${stub.includes}/opengl" /> - <dirset id="stub.includes.fileset.all.gl2" dir="."> + <dirset id="stub.includes.fileset.all.gldesktop" dir="."> <include name="${stub.includes}/opengl/**" /> <include name="${stub.includes}/macosx/**" /> <include name="${stub.includes}/win32/**" /> @@ -420,7 +411,7 @@ <gluegen src="${stub.includes.opengl}/gles2.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-if-gl.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -432,7 +423,7 @@ <gluegen src="${stub.includes.opengl}/gles1.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-if-gl2_es1.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -444,7 +435,7 @@ <gluegen src="${stub.includes.opengl}/gles2.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-if-gl2_es2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -456,14 +447,14 @@ <gluegen src="${stub.includes.opengl}/gl3.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-gl3-set.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> <gluegen src="${stub.includes.opengl}/gl2.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-if-gl2_gl3.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -475,7 +466,7 @@ <gluegen src="${stub.includes.opengl}/gl2.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-gl2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -487,7 +478,7 @@ <gluegen src="${stub.includes.opengl}/gl3.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-gl3.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -499,7 +490,7 @@ <gluegen src="${stub.includes.opengl}/gl3bc.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-gl3bc.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -511,7 +502,7 @@ <gluegen src="${stub.includes.opengl}/gl4.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-gl4.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -523,19 +514,31 @@ <gluegen src="${stub.includes.opengl}/gl4bc.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-gl4bc.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> </target> + <target name="java.generate.gl2es12"> + <echo message="Generating GL2ES12 implementation" /> + <antcall target="java.generate.copy2temp" inheritRefs="true" /> + <gluegen src="${stub.includes.opengl}/gl2es12.c" + outputRootDir="${build.jogl}" + config="${config.jogl}/gl-gl2es12.cfg" + includeRefid="stub.includes.fileset.all.gldesktop" + emitter="com.sun.gluegen.opengl.GLEmitter"> + <classpath refid="gluegen.classpath" /> + </gluegen> + </target> + <target name="java.generate.gles1"> <echo message="Generating GLES1 interface and implementation" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${stub.includes.opengl}/gles1.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-es1.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -547,19 +550,19 @@ <gluegen src="${stub.includes.opengl}/gles2.c" outputRootDir="${build.jogl}" config="${config.jogl}/gl-es2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> </target> - <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl4, java.generate.gl4bc, java.generate.gles1, java.generate.gles2"/> + <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl4, java.generate.gl4bc, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/> <!-- target name="java.generate.gl.nsig" if="gluegen.nsig"> <echo message="Generating GL interface and implementation" /> <gluegen src="${gl.c}" config="${gl.cfg.nsig}" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.nativesig.NativeSignatureEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -571,7 +574,7 @@ <gluegen src="${stub.includes.opengl}/glu.c" outputRootDir="${build.jogl}" config="${config.jogl}/glu-base.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -583,7 +586,7 @@ <gluegen src="${stub.includes.opengl}/glu.c" outputRootDir="${build.jogl}" config="${config.jogl}/glu-gl2es1.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -595,7 +598,7 @@ <gluegen src="${stub.includes.opengl}/glu.c" outputRootDir="${build.jogl}" config="${config.jogl}/glu-gl2.cfg" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -607,7 +610,7 @@ <gluegen src="${glext.platform.header}" outputRootDir="${build.jogl}" config="${glext.platform.cfg}" - includeRefid="stub.includes.fileset.all.gl2" + includeRefid="stub.includes.fileset.all.gldesktop" emitter="com.sun.gluegen.opengl.GLEmitter"> <classpath refid="gluegen.classpath" /> </gluegen> @@ -790,6 +793,21 @@ </target> + <target name="java.generate.composable.pipeline.check.gl2es12"> + <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed + (the uptodate element doesn't support arbitrary source and destination files) --> + <dependset> + <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES12.class" /> + <targetfileset dir="${src.generated.java}/javax/media/opengl" + includes="DebugGL2ES12.java,TraceGL2ES12.java" /> + </dependset> + + <!-- Now choose one of the two to test to see if we have to regenerate --> + <uptodate property="java.generate.composable.pipeline.skip.gl2es12" + srcfile="${classes}/javax/media/opengl/GL2ES12.class" + targetfile="${src.generated.java}/javax/media/opengl/DebugGL2ES12.java" /> + </target> + <target name="java.generate.composable.pipeline.check.gl2"> <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed (the uptodate element doesn't support arbitrary source and destination files) --> @@ -990,7 +1008,7 @@ <copy todir="${src.generated.java-cdc}"> <fileset dir="${src.generated.java}" includes="**" - excludes="com/jogamp/opengl/cg/** com/jogamp/opengl/impl/gl2/** com/jogamp/opengl/impl/gl3/** com/jogamp/opengl/impl/glu/gl2/** javax/media/opengl/glu/gl2/**"/> + excludes="com/jogamp/opengl/cg/** com/jogamp/opengl/impl/gl2/** com/jogamp/opengl/impl/gl3/** com/jogamp/opengl/impl/gl4/** com/jogamp/opengl/impl/glu/gl2/** javax/media/opengl/glu/gl2/**"/> </copy> <copy todir="${classes-cdc}"> <fileset dir="${classes}" @@ -1298,6 +1316,22 @@ <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/> </patternset> + <patternset id="c.src.files.jogl.gl2es12"> + <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c" if="isOSX"/> + <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/> + <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/> + <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> + <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> + <include name="${rootrel.src.c.openmax}/com_jogamp_openmax_OMXInstance.c" if="useOpenMAX"/> + + <include name="${rootrel.generated.c.jogl}/gl2es12/GL2ES12Impl_JNI.c"/> + <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY --> + <!--include name="${rootrel.generated.c.jogl}/gl2es12/GLUgl2es12_JNI.c"/ SKIPPED --> + <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/> + <include name="${rootrel.generated.c.jogl}/MacOSX/CGL*.c" if="isOSX"/> + <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/> + </patternset> + <patternset id="c.src.files.jogl.es2"> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> @@ -1404,6 +1438,13 @@ linker.cfg.id="${linker.cfg.id.gl2}"/> </target> + <target name="c.build.jogl.gl2es12" unless="setup.nodesktop"> + <c.build c.compiler.src.files="c.src.files.jogl.gl2es12" + output.lib.name="jogl_gl2es12" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="${linker.cfg.id.gl2}"/> + </target> + <target name="c.build.jogl.es2"> <c.build c.compiler.src.files="c.src.files.jogl.es2" output.lib.name="jogl_es2" @@ -1433,11 +1474,12 @@ <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> <msvc.manifest objdir="${obj.jogl}" dllname="jogl_es1" /> <msvc.manifest objdir="${obj.jogl}" dllname="jogl_es2" /> - <msvc.manifest objdir="${obj.jogl}" dllname="jogl_gl2" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_gl2es12" /> + <msvc.manifest objdir="${obj.jogl}" dllname="jogl_desktop" /> <antcall target="c.manifest.cg" inheritRefs="true" /> </target> - <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.desktop,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg"> + <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.gl2es12,c.build.jogl.desktop,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg"> <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true"> <param name="libdir" value="${obj.jogl}"/> </antcall> @@ -1453,6 +1495,7 @@ <fileset dir="${obj.jogl}"> <include name="*_es1.${native.library.suffix-cdc}" /> <include name="*_es2.${native.library.suffix-cdc}" /> + <include name="*_gl2es12.${native.library.suffix-cdc}" /> </fileset> </jar> </target> @@ -1568,7 +1611,15 @@ </jar> </target> - <target name="build-jars-es-cdc" depends="setup-manifestfile-cdc" unless="setup.noCDC"> + <target name="build-jars-es-desktop-cdc" depends="setup-manifestfile-cdc,build-jars-os-desktop-cdc" unless="setup.nodesktop"> + <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.gl2es12.cdc.jar}" filesonly="true"> + <fileset dir="${classes-cdc}" + includes="${java.part.gl2es12}, ${java.part.openmax}" + excludes="${java.part.glugldesktop}"/> + </jar> + </target> + + <target name="build-jars-es-cdc" depends="setup-manifestfile-cdc, build-jars-es-desktop-cdc" unless="setup.noCDC"> <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.egl.cdc.jar}" filesonly="true"> <fileset dir="${classes-cdc}" includes="${java.part.egl}" @@ -1614,6 +1665,7 @@ <include name="${java.part.openmax}" /> <!-- FIXME: this is temporary until we move these classes to another workspace --> <include name="com/jogamp/**" /> + <exclude name="${java.part.gl2es12}"/> </fileset> <fileset dir="${src.java}" includes="${java.part.util.fixedfuncemu.shadercode}"/> @@ -1623,7 +1675,7 @@ <jar manifest="${build.jogl}/tempversion" destfile="${jogl.all-noawt.jar}" filesonly="true"> <fileset dir="${classes}" includes="javax/media/opengl/** com/jogamp/gluegen/runtime/** com/jogamp/opengl/** ${java.part.openmax} com/jogamp/**" - excludes="${java.part.awt} ${java.part.util.awt}"> + excludes="${java.part.awt} ${java.part.util.awt} ${java.part.gl2es12}"> </fileset> <fileset dir="${src.java}" includes="${java.part.util.fixedfuncemu.shadercode}"/> @@ -1632,7 +1684,7 @@ <target name="build-jars-all-cdc" depends="setup-manifestfile"> <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.all.cdc.jar}" filesonly="true"> <fileset dir="${classes-cdc}" - includes="${java.part.core} ${java.part.egl} ${java.part.glutess} ${java.part.glumipmap} ${java.part.openmax} ${java.part.sdk} ${java.part.glx} ${java.part.cgl} ${java.part.wgl} ${java.part.es1} ${java.part.es1.dbg} ${java.part.es2} ${java.part.es2.dbg} ${java.part.util} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}" + includes="${java.part.core} ${java.part.egl} ${java.part.glutess} ${java.part.glumipmap} ${java.part.openmax} ${java.part.sdk} ${java.part.glx} ${java.part.cgl} ${java.part.wgl} ${java.part.es1} ${java.part.es1.dbg} ${java.part.es2} ${java.part.es2.dbg} ${java.part.gl2es12} ${java.part.util} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}" excludes="${java.excludes.cdcfp}"/> <fileset dir="${src.java}" includes="${java.part.util.fixedfuncemu.shadercode}"/> @@ -1657,7 +1709,7 @@ <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.util.cdc.jar}" filesonly="true"> <fileset dir="${classes-cdc}" includes="${java.part.util} ${java.part.util.glsl}" - excludes="${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.fixedfuncemu}"/> + excludes="${java.part.util.awt} ${java.part.util.gldesktop} ${java.part.util.fixedfuncemu}"/> </jar> <jar manifest="${build.jogl}/tempversion-cdc" destfile="${jogl.util.fixedfuncemu.cdc.jar}" filesonly="true"> <fileset dir="${classes-cdc}" @@ -1668,47 +1720,29 @@ </target> <target name="build-jars-desktop-javase" depends="setup-manifestfile,build-jars-os-desktop-javase" unless="setup.nodesktop"> - <!--os specific gl2--> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl2.jar}" filesonly="true"> + <!--os specific gldesktop--> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gldesktop.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.gl2}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.gl4.dbg}, ${java.part.glugl2}"/> + includes="${java.part.gldesktop}, ${java.part.openmax}" + excludes="${java.part.gldesktop.dbg}, ${java.part.glugldesktop}, ${java.part.gl2es12}"/> </jar> - - <!--os specific gl3--> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl3.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.gl3}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.gl4.dbg}, ${java.part.glugl2}"/> - </jar> - - <!--os specific gl4--> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl4.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.gl4}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.gl3.dbg}, ${java.part.gl4.dbg}, ${java.part.glugl2}"/> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl2es12.jar}" filesonly="true"> + <fileset dir="${classes}" includes="${java.part.gl2es12}, ${java.part.openmax}" + excludes="${java.part.glugldesktop}"/> </jar> <!-- misc --> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl2.dbg.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.gl2.dbg}"/> - </jar> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl3.dbg.jar}" filesonly="true"> - <fileset dir="${classes}" - includes="${java.part.gl3.dbg}"/> - </jar> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gl4.dbg.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.gldesktop.dbg.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.gl4.dbg}"/> + includes="${java.part.gldesktop.dbg}"/> </jar> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.glugl2.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.glugldesktop.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.glugl2}"/> + includes="${java.part.glugldesktop}"/> </jar> - <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.gl2.jar}" filesonly="true"> + <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.gldesktop.jar}" filesonly="true"> <fileset dir="${classes}" - includes="${java.part.util.gl2}" + includes="${java.part.util.gldesktop}" excludes="com/jogamp/opengl/**/awt/**"/> </jar> </target> @@ -1734,7 +1768,7 @@ <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.util} ${java.part.util.glsl}" - excludes="${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.fixedfuncemu}"/> + excludes="${java.part.util.awt} ${java.part.util.gldesktop} ${java.part.util.fixedfuncemu}"/> </jar> <jar manifest="${build.jogl}/tempversion" destfile="${jogl.util.fixedfuncemu.jar}" filesonly="true"> <fileset dir="${classes}" diff --git a/make/config/jogl/obsolete/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg index 3942b1419..3942b1419 100644 --- a/make/config/jogl/obsolete/gl-gl2es12.cfg +++ b/make/config/jogl/gl-gl2es12.cfg diff --git a/make/config/jogl/obsolete/gl-impl-CustomCCode-gl2es12.c b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c index 07b821802..07b821802 100644 --- a/make/config/jogl/obsolete/gl-impl-CustomCCode-gl2es12.c +++ b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c diff --git a/make/config/jogl/obsolete/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index aed442da3..4bc39b076 100644 --- a/make/config/jogl/obsolete/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -26,37 +26,98 @@ public GL2ES12Impl(GLProfile glp, GLContextImpl context) { private boolean isGL2ES2; -public boolean isFunctionAvailable(String glFunctionName) { - return _context.isFunctionAvailable(glFunctionName); +public final boolean isGL4bc() { + return false; +} + +public final boolean isGL4() { + return false; +} + +public final boolean isGL3bc() { + return false; +} + +public final boolean isGL3() { + return false; +} + +public final boolean isGL2() { + return false; +} + +public final boolean isGLES1() { + return false; +} + +public final boolean isGLES2() { + return false; +} + +public final boolean isGLES() { + return false; +} + +public final boolean isGL2ES1() { + return !isGL2ES2; +} + +public final boolean isGL2ES2() { + return isGL2ES2; +} + +public final boolean isGL2GL3() { + return false; +} + +public final boolean hasGLSL() { + return isGL2ES2; +} + +public final GL4bc getGL4bc() throws GLException { + throw new GLException("Not a GL4bc implementation"); +} + +public final GL4 getGL4() throws GLException { + throw new GLException("Not a GL4 implementation"); } -public boolean isExtensionAvailable(String glExtensionName) { - return _context.isExtensionAvailable(glExtensionName); +public final GL3bc getGL3bc() throws GLException { + throw new GLException("Not a GL3bc implementation"); } -public Object getExtension(String extensionName) { - // At this point we don't expose any extensions using this mechanism - return null; +public final GL3 getGL3() throws GLException { + throw new GLException("Not a GL3 implementation"); } -/** Returns the context this GL object is associated with for better - error checking by DebugGL. */ -public GLContext getContext() { - return _context; +public final GL2 getGL2() throws GLException { + throw new GLException("Not a GL2 implementation"); } -private GLContextImpl _context; +public final GLES1 getGLES1() throws GLException { + throw new GLException("Not a GLES1 implementation"); +} -public void setSwapInterval(int interval) { - _context.setSwapInterval(interval); +public final GLES2 getGLES2() throws GLException { + throw new GLException("Not a GLES2 implementation"); } -public int getSwapInterval() { - return _context.getSwapInterval(); +public final GL2ES1 getGL2ES1() throws GLException { + if (isGL2ES1()) { + return this; + } + throw new GLException("Not a GL2ES1 implementation"); +} + +public final GL2ES2 getGL2ES2() throws GLException { + if (isGL2ES2()) { + return this; + } + throw new GLException("Not a GL2ES2 implementation"); } -public Object getPlatformGLExtensions() { - return _context.getPlatformGLExtensions(); +public final GL2GL3 getGL2GL3() throws GLException { + throw new GLException("Not a GL2GL3 implementation"); } // diff --git a/make/config/jogl/obsolete/gl-impl-CustomCCode-gl2.c b/make/config/jogl/obsolete/gl-impl-CustomCCode-gl2.c deleted file mode 100644 index 91fd0078b..000000000 --- a/make/config/jogl/obsolete/gl-impl-CustomCCode-gl2.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Java->C glue code: - * Java package: com.jogamp.opengl.impl.gl2.GL2Impl - * Java method: long dispatch_glMapBuffer(int target, int access) - * C function: void * glMapBuffer(GLenum target, GLenum access); - */ -JNIEXPORT jlong JNICALL -Java_com_jogamp_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { - PFNGLMAPBUFFERPROC ptr_glMapBuffer; - void * _res; - ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; - assert(ptr_glMapBuffer != NULL); - _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); - return (jlong) (intptr_t) _res; -} - -/* Java->C glue code: - * Java package: com.jogamp.opengl.impl.gl2.GL2Impl - * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); - * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); - */ -JNIEXPORT jobject JNICALL -Java_com_jogamp_opengl_impl_gl2_GL2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { - return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); -} diff --git a/make/config/jogl/obsolete/gl-impl-CustomCCode-gl3.c b/make/config/jogl/obsolete/gl-impl-CustomCCode-gl3.c deleted file mode 100644 index f540a7d4a..000000000 --- a/make/config/jogl/obsolete/gl-impl-CustomCCode-gl3.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Java->C glue code: - * Java package: com.jogamp.opengl.impl.gl3.GL3Impl - * Java method: long dispatch_glMapBuffer(int target, int access) - * C function: void * glMapBuffer(GLenum target, GLenum access); - */ -JNIEXPORT jlong JNICALL -Java_com_jogamp_opengl_impl_gl3_GL3Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) { - PFNGLMAPBUFFERPROC ptr_glMapBuffer; - void * _res; - ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress; - assert(ptr_glMapBuffer != NULL); - _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access); - return (jlong) (intptr_t) _res; -} - -/* Java->C glue code: - * Java package: com.jogamp.opengl.impl.gl3.GL3Impl - * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); - * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); - */ -JNIEXPORT jobject JNICALL -Java_com_jogamp_opengl_impl_gl3_GL3Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { - return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); -} diff --git a/make/config/jogl/obsolete/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/obsolete/gl-impl-CustomJavaCode-gl2.java deleted file mode 100644 index a1a6917df..000000000 --- a/make/config/jogl/obsolete/gl-impl-CustomJavaCode-gl2.java +++ /dev/null @@ -1,385 +0,0 @@ -// Tracks glBegin/glEnd calls to determine whether it is legal to -// query Vertex Buffer Object state -private boolean inBeginEndPair; - -/* FIXME: refactor dependence on Java 2D / JOGL bridge - -// Tracks creation and destruction of server-side OpenGL objects when -// the Java2D/OpenGL pipeline is enabled and it is using frame buffer -// objects (FBOs) to do its rendering -private GLObjectTracker tracker; - -public void setObjectTracker(GLObjectTracker tracker) { - this.tracker = tracker; -} - -*/ - - -public GL2Impl(GLProfile glp, GLContextImpl context) { - this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); - this.bufferStateTracker = context.getBufferStateTracker(); - this.glStateTracker = context.getGLStateTracker(); - this.glProfile = glp; -} - -/** - * Provides platform-independent access to the wglAllocateMemoryNV / - * glXAllocateMemoryNV extension. - */ -public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) { - return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3); -} - -// -// Helpers for ensuring the correct amount of texture data -// - -/** Returns the number of bytes required to fill in the appropriate - texture. This is computed as closely as possible based on the - pixel pack or unpack parameters. The logic in this routine is - based on code in the SGI OpenGL sample implementation. */ - -private int imageSizeInBytes(int format, int type, int w, int h, int d, - boolean pack) { - int elements = 0; - int esize = 0; - - if (w < 0) return 0; - if (h < 0) return 0; - if (d < 0) return 0; - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - elements = 1; - break; - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - case GL_DEPTH_COMPONENT: - elements = 1; - break; - case GL_LUMINANCE_ALPHA: - elements = 2; - break; - case GL_RGB: - case GL_BGR: - elements = 3; - break; - case GL_RGBA: - case GL_BGRA: - case GL_ABGR_EXT: - elements = 4; - break; - /* FIXME ?? - case GL_HILO_NV: - elements = 2; - break; */ - default: - return 0; - } - switch (type) { - case GL_BITMAP: - if (format == GL_COLOR_INDEX) { - return (d * (h * ((w+7)/8))); - } else { - return 0; - } - case GL_BYTE: - case GL_UNSIGNED_BYTE: - esize = 1; - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - esize = 1; - elements = 1; - break; - case GL_SHORT: - case GL_UNSIGNED_SHORT: - esize = 2; - break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - esize = 2; - elements = 1; - break; - case GL_INT: - case GL_UNSIGNED_INT: - case GL_FLOAT: - esize = 4; - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - esize = 4; - elements = 1; - break; - default: - return 0; - } - return imageSizeInBytes(elements * esize, w, h, d, pack); -} - -private GLBufferSizeTracker bufferSizeTracker; -private GLBufferStateTracker bufferStateTracker; -private GLStateTracker glStateTracker; - -private boolean bufferObjectExtensionsInitialized = false; -private boolean haveARBPixelBufferObject; -private boolean haveEXTPixelBufferObject; -private boolean haveGL15; -private boolean haveGL21; -private boolean haveARBVertexBufferObject; - -private void initBufferObjectExtensionChecks() { - if (bufferObjectExtensionsInitialized) - return; - bufferObjectExtensionsInitialized = true; - haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object"); - haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object"); - haveGL15 = isExtensionAvailable("GL_VERSION_1_5"); - haveGL21 = isExtensionAvailable("GL_VERSION_2_1"); - haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object"); -} - -private boolean checkBufferObject(boolean extension1, - boolean extension2, - boolean extension3, - boolean enabled, - int state, - String kind, boolean throwException) { - if (inBeginEndPair) { - throw new GLException("May not call this between glBegin and glEnd"); - } - boolean avail = (extension1 || extension2 || extension3); - if (!avail) { - if (!enabled) - return true; - if(throwException) { - throw new GLException("Required extensions not available to call this function"); - } - return false; - } - int buffer = bufferStateTracker.getBoundBufferObject(state, this); - if (enabled) { - if (buffer == 0) { - if(throwException) { - throw new GLException(kind + " must be enabled to call this method"); - } - return false; - } - } else { - if (buffer != 0) { - if(throwException) { - throw new GLException(kind + " must be disabled to call this method"); - } - return false; - } - } - return true; -} - -private boolean checkArrayVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - false, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); -} - -private boolean checkArrayVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - true, - GL.GL_ARRAY_BUFFER, - "array vertex_buffer_object", throwException); -} - -private boolean checkElementVBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - false, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); -} - -private boolean checkElementVBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveGL15, - haveARBVertexBufferObject, - false, - true, - GL.GL_ELEMENT_ARRAY_BUFFER, - "element vertex_buffer_object", throwException); -} - -private boolean checkUnpackPBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - false, - GL2.GL_PIXEL_UNPACK_BUFFER, - "unpack pixel_buffer_object", throwException); -} - -private boolean checkUnpackPBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - true, - GL2.GL_PIXEL_UNPACK_BUFFER, - "unpack pixel_buffer_object", throwException); -} - -private boolean checkPackPBODisabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - false, - GL2.GL_PIXEL_PACK_BUFFER, - "pack pixel_buffer_object", throwException); -} - -private boolean checkPackPBOEnabled(boolean throwException) { - initBufferObjectExtensionChecks(); - return checkBufferObject(haveARBPixelBufferObject, - haveEXTPixelBufferObject, - haveGL21, - true, - GL2.GL_PIXEL_PACK_BUFFER, - "pack pixel_buffer_object", throwException); -} - -public boolean glIsPBOPackEnabled() { - return checkPackPBOEnabled(false); -} - -public boolean glIsPBOUnpackEnabled() { - return checkUnpackPBOEnabled(false); -} - -// Attempt to return the same ByteBuffer object from glMapBuffer if -// the vertex buffer object's base address and size haven't changed -private static class ARBVBOKey { - private long addr; - private int capacity; - - ARBVBOKey(long addr, int capacity) { - this.addr = addr; - this.capacity = capacity; - } - - public int hashCode() { - return (int) addr; - } - - public boolean equals(Object o) { - if ((o == null) || (!(o instanceof ARBVBOKey))) { - return false; - } - - ARBVBOKey other = (ARBVBOKey) o; - return ((addr == other.addr) && (capacity == other.capacity)); - } -} - -private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap(); - -/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -public java.nio.ByteBuffer glMapBuffer(int target, int access) { - final long __addr_ = ((GL2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer; - if (__addr_ == 0) { - throw new GLException("Method \"glMapBuffer\" not available"); - } - int sz = bufferSizeTracker.getBufferSize(bufferStateTracker, - target, - this); - long addr; - addr = dispatch_glMapBuffer(target, access, __addr_); - if (addr == 0 || sz == 0) { - return null; - } - ARBVBOKey key = new ARBVBOKey(addr, sz); - ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key); - if (_res == null) { - _res = newDirectByteBuffer(addr, sz); - InternalBufferUtil.nativeOrder(_res); - arbVBOCache.put(key, _res); - } - _res.position(0); - return _res; -} - -/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */ -native private long dispatch_glMapBuffer(int target, int access, long glProcAddress); - -native private ByteBuffer newDirectByteBuffer(long addr, int capacity); - - /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */ - public void glShaderBinary(int n, java.nio.IntBuffer shaders, int binaryformat, java.nio.Buffer binary, int length) { - throw new GLException("Method \"glShaderBinary\" not available"); - } - - /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */ - public void glShaderBinary(int n, int[] shaders, int shaders_offset, int binaryformat, java.nio.Buffer binary, int length) { - throw new GLException("Method \"glShaderBinary\" not available"); - } - - public void glReleaseShaderCompiler() { - // nothing to do - } - - public void glVertexPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.isVBO()) { - glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); - } - } - public void glColorPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.isVBO()) { - glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); - } - - } - public void glNormalPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.getComponentNumber()!=3) { - throw new GLException("Only 3 components per normal allowed"); - } - if(array.isVBO()) { - glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer()); - } - } - public void glTexCoordPointer(GLArrayData array) { - if(array.getComponentNumber()==0) return; - if(array.isVBO()) { - glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset()); - } else { - glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer()); - } - } - diff --git a/make/java-run-newt.sh b/make/java-run-newt.sh index cb256e273..384cf24c8 100755 --- a/make/java-run-newt.sh +++ b/make/java-run-newt.sh @@ -7,7 +7,7 @@ function print_usage() { if [ -z "$1" ] ; then echo JOGL BUILD DIR missing print_usage - return + exit fi . ./setenv-jogl.sh $1 @@ -21,7 +21,7 @@ if [ $MOSX -eq 1 ] ; then fi # D_ARGS="-Dgluegen.debug.ProcAddressHelper=true -Dgluegen.debug.NativeLibrary=true -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" -# D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all -Djogl.debug.GLSLState" +D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all -Djogl.debug.GLSLState" # D_ARGS="-Dnativewindow.debug.X11Util=true -Djogl.debug.GLDrawableFactory=true" # D_ARGS="-Dnativewindow.debug.X11Util=true" diff --git a/make/java-run.sh b/make/java-run.sh index 63fb6d3e9..5e48cef3a 100755 --- a/make/java-run.sh +++ b/make/java-run.sh @@ -7,7 +7,7 @@ function print_usage() { if [ -z "$1" ] ; then echo JOGL BUILD DIR missing print_usage - return + exit fi . ./setenv-jogl.sh $1 diff --git a/make/lstjars.sh b/make/lstjars.sh index 80fbe2566..3837be5e3 100644 --- a/make/lstjars.sh +++ b/make/lstjars.sh @@ -47,15 +47,15 @@ function listdeployment() { echo echo JOGL GL2ES12 NEWT - report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gl2es12.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_gl2es12.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz echo echo JOGL GL2 NEWT - report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gl2.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz + report gluegen-rt.$JAR_SUFFIX nativewindow.all-noawt.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gldesktop.$JAR_SUFFIX newt.all-noawt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnewt.so.gz libnativewindow_$OSS.so.gz echo echo JOGL GL2 AWT - report gluegen-rt.$JAR_SUFFIX nativewindow.all.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gl2.$JAR_SUFFIX jogl.awt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz + report gluegen-rt.$JAR_SUFFIX nativewindow.all.$JAR_SUFFIX jogl.core.$JAR_SUFFIX jogl.util.$JAR_SUFFIX jogl.os.$OSS.$JAR_SUFFIX jogl.gldesktop.$JAR_SUFFIX jogl.awt.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_desktop.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz echo echo JOGL ALL AWT @@ -125,8 +125,8 @@ mkdir -p nope mv *.cdc.lst *.all*.lst nope/ -mv jogl.gl2.*.lst nope/ -echo duplicates - w/o gl2.* +mv jogl.gl2es12.*.lst jogl.gldesktop.*.lst nope/ +echo duplicates - w/o gl2es12.* gldesktop.* echo sort jogl*.lst | uniq -d mv nope/* . diff --git a/make/make.jogl.all.linux-x86_64.sh b/make/make.jogl.all.linux-x86_64.sh index 8ebcc8744..b6c5e9d63 100644 --- a/make/make.jogl.all.linux-x86_64.sh +++ b/make/make.jogl.all.linux-x86_64.sh @@ -16,6 +16,7 @@ fi # -Dbuild.noarchives=true \ ant \ + -Dbuild.noarchives=true \ -Djogl.cg=1 -Dx11.cg.lib=../../lib-linux-x86_64 \ -Drootrel.build=build-x86_64 \ -DuseKD=true \ diff --git a/make/make.jogl.all.win64.bat b/make/make.jogl.all.win64.bat new file mode 100644 index 000000000..508067d57 --- /dev/null +++ b/make/make.jogl.all.win64.bat @@ -0,0 +1,17 @@ +set THISDIR="C:\JOGL"
+
+set J2RE_HOME=c:\jre1.6.0_19
+set JAVA_HOME=c:\jdk1.6.0_19
+set ANT_PATH=C:\apache-ant-1.8.0
+
+set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw-w64\bin;c:\mingw\bin;%PATH%
+
+set LIB_GEN=%THISDIR%\lib
+set CLASSPATH=.;%THISDIR%\build-win64\classes
+REM -Dc.compiler.debug=true
+REM -DuseOpenMAX=true
+REM -DuseKD=true
+REM -Djogl.cg=1 -D-Dwindows.cg.lib=C:\Cg-2.2
+REM -Dbuild.noarchives=true
+
+ant -Drootrel.build=build-win64 -Djogl.cg=1 -Dwindows.cg.lib=C:\Cg-2.2\lib %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1
diff --git a/make/scripts/all-deploy-webstarttest.sh b/make/scripts/all-deploy-webstarttest.sh index 0904ac233..e3ee24a6d 100755 --- a/make/scripts/all-deploy-webstarttest.sh +++ b/make/scripts/all-deploy-webstarttest.sh @@ -17,8 +17,8 @@ shift if [ -z "$url" -o -z "$joglbuilddir" -o -z "$wsdir" ] ; then echo Usage $0 codebase-url jogl-builddir webstartdir echo Examples - echo sh scripts/all-deploy-webstarttest.sh file:////usr/local/projects/JOGL/webstart ../build-x86_64 ../../webstart - echo sh scripts/all-deploy-webstarttest.sh http://domain.org/jogl/webstart ../build-win32 ../../webstart + echo sh $0 file:////usr/local/projects/JOGL/webstart ../build-x86_64 ../../webstart + echo sh $0 http://domain.org/jogl/webstart ../build-win32 ../../webstart exit 1 fi diff --git a/make/scripts/deploy-jnlp-webstarttest.sh b/make/scripts/deploy-jnlp-webstarttest.sh index 26a0f8b35..8f3b0d216 100755 --- a/make/scripts/deploy-jnlp-webstarttest.sh +++ b/make/scripts/deploy-jnlp-webstarttest.sh @@ -11,6 +11,9 @@ shift if [ -z "$url" -o -z "$joglbuilddir" -o -z "$wsdir" ] ; then echo usage $0 codebase-url jogl-builddir webstartdir + echo Examples + echo sh $0 file:////usr/local/projects/JOGL/webstart ../build-x86_64 ../../webstart + echo sh $0 http://domain.org/jogl/webstart ../build-win32 ../../webstart exit 1 fi diff --git a/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java index 1ed0396a9..9d1235e13 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/ExtensionAvailabilityCache.java @@ -113,9 +113,7 @@ public final class ExtensionAvailabilityCache { boolean useGetStringi = false; - if ( context.getGLVersionMajor() > 3 || - ( context.getGLVersionMajor() == 3 && context.getGLVersionMinor() >= 0 ) || - gl.isGL3() ) { + if ( gl.isGL2GL3() ) { if ( ! gl.isFunctionAvailable("glGetStringi") ) { if(DEBUG) { System.err.println("GLContext: GL >= 3.1 usage, but no glGetStringi"); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java index 3abb69a7f..7143344bf 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java @@ -602,10 +602,7 @@ public abstract class GLContextImpl extends GLContext { // private Object createInstance(GLProfile glp, String suffix, Class[] cstrArgTypes, Object[] cstrArgs) { - try { - return ReflectionUtil.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs); - } catch (JogampRuntimeException jre) { /* n/a .. */ } - return null; + return ReflectionUtil.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs); } /** Create the GL for this context. */ diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java b/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java index 7747b014b..c3958eedf 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLJNILibLoader.java @@ -67,6 +67,15 @@ public class GLJNILibLoader extends JNILibLoaderBase { }); } + public static void loadGLDesktopES12() { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + loadLibrary("jogl_gl2es12", nativeOSPreload, true); + return null; + } + }); + } + public static void loadES2() { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java index 7d907bf28..dce25978c 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java @@ -308,7 +308,7 @@ public abstract class X11GLXContext extends GLContextImpl { } } } else { - if(!glp.isGL2()) { + if(glp.isGL3()) { glXMakeContextCurrent(display, 0, 0, 0); GLX.glXDestroyContext(display, temp_context); throw new GLException("X11GLXContext.createContext failed, but context > GL2 requested "+getGLVersion(null, major[0], minor[0], ctp[0], "@creation")+", "); diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 9e3a532e6..0e10b32b3 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -63,29 +63,36 @@ public class GLProfile implements Cloneable { // Query platform available OpenGL implementation // - public static final boolean isGL4bcAvailable() { return hasGL4bcImpl; } - public static final boolean isGL4Available() { return hasGL4Impl; } - public static final boolean isGL3bcAvailable() { return hasGL3bcImpl; } - public static final boolean isGL3Available() { return hasGL3Impl; } - public static final boolean isGL2Available() { return hasGL2Impl; } - public static final boolean isGLES2Available() { return hasGLES2Impl; } - public static final boolean isGLES1Available() { return hasGLES1Impl; } + public static final boolean isGL4bcAvailable() { return null != mappedProfiles.get(GL4bc); } + public static final boolean isGL4Available() { return null != mappedProfiles.get(GL4); } + public static final boolean isGL3bcAvailable() { return null != mappedProfiles.get(GL3bc); } + public static final boolean isGL3Available() { return null != mappedProfiles.get(GL3); } + public static final boolean isGL2Available() { return null != mappedProfiles.get(GL2); } + public static final boolean isGLES2Available() { return null != mappedProfiles.get(GLES2); } + public static final boolean isGLES1Available() { return null != mappedProfiles.get(GLES1); } + public static final boolean isGL2ES1Available() { return null != mappedProfiles.get(GL2ES1); } + public static final boolean isGL2ES2Available() { return null != mappedProfiles.get(GL2ES2); } + public static final String glAvailabilityToString() { StringBuffer sb = new StringBuffer(); sb.append("GLAvailability[Native[GL4bc "); - sb.append(hasGL4bcImpl); + sb.append(isGL4bcAvailable()); sb.append(", GL4 "); - sb.append(hasGL4Impl); + sb.append(isGL4Available()); sb.append(", GL3bc "); - sb.append(hasGL3bcImpl); + sb.append(isGL3bcAvailable()); sb.append(", GL3 "); - sb.append(hasGL3Impl); + sb.append(isGL3Available()); sb.append(", GL2 "); - sb.append(hasGL2Impl); + sb.append(isGL2Available()); + sb.append(", GL2ES1 "); + sb.append(isGL2ES1Available()); sb.append(", GLES1 "); - sb.append(hasGLES1Impl); + sb.append(isGLES1Available()); + sb.append(", GL2ES2 "); + sb.append(isGL2ES2Available()); sb.append(", GLES2 "); - sb.append(hasGLES2Impl); + sb.append(isGLES2Available()); sb.append("], Profiles["); for(Iterator i=mappedProfiles.values().iterator(); i.hasNext(); ) { sb.append(((GLProfile)i.next()).toString()); @@ -344,6 +351,8 @@ public class GLProfile implements Cloneable { GL3.equals(profileImpl) || GL2.equals(profileImpl) ) { return "com.jogamp.opengl.impl.gl4.GL4bc"; + } else if(GL2ES12.equals(profileImpl)) { + return "com.jogamp.opengl.impl.gl2es12.GL2ES12"; } else if(GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl)) { return "com.jogamp.opengl.impl.es1.GLES1"; } else if(GLES2.equals(profileImpl) || GL2ES2.equals(profileImpl)) { @@ -767,6 +776,10 @@ public class GLProfile implements Cloneable { return "GLProfile[" + profile + "/" + profileImpl + "]"; } + // The intersection between desktop OpenGL and the union of the OpenGL ES profiles + // This is here only to avoid having separate GL2ES1Impl and GL2ES2Impl classes + private static final String GL2ES12 = "GL2ES12"; + private static final boolean isAWTAvailable; private static final boolean isAWTJOGLAvailable; @@ -776,6 +789,7 @@ public class GLProfile implements Cloneable { private static /*final*/ boolean hasGL3bcImpl; private static /*final*/ boolean hasGL3Impl; private static /*final*/ boolean hasGL2Impl; + private static /*final*/ boolean hasGL2ES12Impl; private static /*final*/ boolean hasGLES2Impl; private static /*final*/ boolean hasGLES1Impl; @@ -802,6 +816,7 @@ public class GLProfile implements Cloneable { ReflectionUtil.isClassAvailable("javax.media.opengl.awt.GLCanvas") ; // JOGL boolean hasDesktopGL = false; + boolean hasDesktopGLES12 = false; boolean hasNativeOSFactory = false; Throwable t; @@ -833,12 +848,37 @@ public class GLProfile implements Cloneable { } } + t=null; + try { + // See DRIHack.java for an explanation of why this is necessary + DRIHack.begin(); + GLJNILibLoader.loadGLDesktopES12(); + DRIHack.end(); + hasDesktopGLES12 = true; + } catch (UnsatisfiedLinkError ule) { + t=ule; + } catch (SecurityException se) { + t=se; + } catch (NullPointerException npe) { + t=npe; + } catch (RuntimeException re) { + t=re; + } + if(null!=t) { + if (DEBUG) { + System.err.println("GLProfile.static Desktop GLES12 Library not available"); + t.printStackTrace(); + } + } + + hasGL234Impl = hasDesktopGL && ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.gl4.GL4bcImpl"); hasGL4bcImpl = hasGL234Impl; hasGL4Impl = hasGL234Impl; hasGL3bcImpl = hasGL234Impl; hasGL3Impl = hasGL234Impl; hasGL2Impl = hasGL234Impl; + hasGL2ES12Impl = hasDesktopGLES12 && ReflectionUtil.isClassAvailable("com.jogamp.opengl.impl.gl2es12.GL2ES12Impl"); mappedProfiles = computeProfileMap(); // @@ -849,7 +889,7 @@ public class GLProfile implements Cloneable { // which will register at GLContext .. // - if(hasDesktopGL) { + if(hasDesktopGL||hasDesktopGLES12) { // if successfull it has a shared dummy drawable and context created try { hasNativeOSFactory = null != GLDrawableFactory.getFactoryImpl(GL2); @@ -872,13 +912,15 @@ public class GLProfile implements Cloneable { hasGL4Impl = false; hasGL3bcImpl = false; hasGL3Impl = false; + hasGL2ES12Impl = false; hasGL2Impl = false; } else { - hasGL4bcImpl = GLContext.isGL4bcAvailable(); - hasGL4Impl = GLContext.isGL4Available(); - hasGL3bcImpl = GLContext.isGL3bcAvailable(); - hasGL3Impl = GLContext.isGL3Available(); - hasGL2Impl = GLContext.isGL2Available(); + hasGL4bcImpl = hasGL4bcImpl && GLContext.isGL4bcAvailable(); + hasGL4Impl = hasGL4Impl && GLContext.isGL4Available(); + hasGL3bcImpl = hasGL3bcImpl && GLContext.isGL3bcAvailable(); + hasGL3Impl = hasGL3Impl && GLContext.isGL3Available(); + hasGL2Impl = hasGL2Impl && GLContext.isGL2Available(); + hasGL2ES12Impl = hasGL2ES12Impl && GLContext.isGL2Available(); } boolean btest = false; @@ -934,7 +976,7 @@ public class GLProfile implements Cloneable { mappedProfiles = computeProfileMap(); if(null==defaultGLProfile) { - throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL)); + throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL)+", "+glAvailabilityToString()); } if (DEBUG) { @@ -942,6 +984,7 @@ public class GLProfile implements Cloneable { System.err.println("GLProfile.static isAWTJOGLAvailable "+isAWTJOGLAvailable); System.err.println("GLProfile.static hasNativeOSFactory "+hasNativeOSFactory); System.err.println("GLProfile.static hasDesktopGL "+hasDesktopGL); + System.err.println("GLProfile.static hasDesktopGLES12 "+hasDesktopGLES12); System.err.println("GLProfile.static hasEGLDynLookup "+hasEGLDynLookup); System.err.println("GLProfile.static hasEGLDrawableFactory "+hasEGLDrawableFactory); System.err.println("GLProfile.static hasGL234Impl "+hasGL234Impl); @@ -993,7 +1036,9 @@ public class GLProfile implements Cloneable { */ private static String computeProfileImpl(String profile) { if (GL2ES1.equals(profile)) { - if(hasGL2Impl) { + if(hasGL2ES12Impl) { + return GL2ES12; + } else if(hasGL2Impl) { return GL2; } else if(hasGL3bcImpl) { return GL3bc; @@ -1003,7 +1048,9 @@ public class GLProfile implements Cloneable { return GLES1; } } else if (GL2ES2.equals(profile)) { - if(hasGL2Impl) { + if(hasGL2ES12Impl) { + return GL2ES12; + } else if(hasGL2Impl) { return GL2; } else if(hasGL3Impl) { return GL3; diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index 9b5c420c9..75237a210 100755 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -367,14 +367,13 @@ static uintptr_t getPtrOut32Long(unsigned long * src) { } static void setJavaWindowProperty(JNIEnv *env, Display *dpy, Window window, jlong javaObjectAtom, jobject jwindow) { - unsigned long jogl_java_object_data[2]; // FIXME uint32_t ? + unsigned long jogl_java_object_data[2]; // X11 is based on 'unsigned long' int nitems_32 = putPtrIn32Long( jogl_java_object_data, (uintptr_t) jwindow); { jobject test = (jobject) getPtrOut32Long(jogl_java_object_data); if( ! (jwindow==test) ) { - _throwNewRuntimeException(dpy, env, "Internal Error .. Encoded Window ref not the same %p != %p !", jwindow, test); - return; + _FatalError(env, "Internal Error .. Encoded Window ref not the same %p != %p !", jwindow, test); } } |