diff options
92 files changed, 1007 insertions, 638 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 79fdb06e2..70b9cda82 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -156,19 +156,12 @@ <property name="java.part.glugl2" value="com/sun/opengl/impl/glu/gl2/**, com/sun/opengl/impl/glu/nurbs/**, com/sun/opengl/impl/glu/registry/**, javax/media/opengl/glu/gl2/**"/> - - <property name="java.part.glsl" - value="javax/media/opengl/glsl/**, com/sun/opengl/impl/glsl/**"/> - <property name="java.part.openmax" value="com/sun/openmax/**"/> <property name="java.part.sdk" value="javax/media/opengl/sdk/**"/> - <property name="java.part.glsl.fixed" - value="com/sun/opengl/impl/glsl/fixed/**"/> - <property name="java.part.gl2es12.x11" value="com/sun/opengl/impl/gl2es12/**, com/sun/opengl/impl/x11/glx/*"/> @@ -200,7 +193,7 @@ value="javax/media/opengl/TraceGLES1.*, javax/media/opengl/DebugGLES1.*"/> <property name="java.part.es2" - value="javax/media/opengl/**/es2/**, com/sun/opengl/**/es2/**, ${java.part.glsl}"/> + value="javax/media/opengl/**/es2/**, com/sun/opengl/**/es2/**"/> <property name="java.part.es2.dbg" value="javax/media/opengl/TraceGLES2.*, javax/media/opengl/DebugGLES2.*"/> @@ -209,14 +202,17 @@ value="javax/media/opengl/awt/**, com/sun/opengl/impl/**/awt/**"/> <property name="java.part.util" - value="com/sun/opengl/util/io/**, com/sun/opengl/util/texture/**, com/sun/opengl/impl/packrect/*"/> + value="com/sun/opengl/util/*, com/sun/opengl/util/glsl/**, com/sun/opengl/util/texture/**, com/sun/opengl/util/packrect/**"/> <property name="java.part.util.awt" - value="javax/media/opengl/util/awt/**, com/sun/opengl/util/**/awt/**"/> + value="com/sun/opengl/util/**/awt/**"/> <property name="java.part.util.gl2" value="com/sun/opengl/util/**/gl2/**"/> + <property name="java.part.util.fixedfunc.shaders" + value="com/sun/opengl/util/glsl/fixedfunc/impl/shaders/*, com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/**"/> + <!-- condition excludes --> <condition property="java.excludes.egl" @@ -361,7 +357,7 @@ <property name="src.java" value="${project.root}/${rootrel.src.java}" /> <property name="src.c" value="${project.root}/${rootrel.src.c}" /> <property name="build" value="${project.root}/${rootrel.build.jogl}" /> - <property name="tempdir" value="${build}/temp" /> + <property name="tempdir" value="${project.root}/build-temp" /> <!-- The generated source directories. --> <property name="src.generated" value="${build}/gensrc" /> @@ -459,7 +455,6 @@ <property name="jogl.gl2.win.jar" value="${build}/jogl.gl2.win.jar" /> <property name="jogl.gl2.osx.jar" value="${build}/jogl.gl2.osx.jar" /> <property name="jogl.gl2.dbg.jar" value="${build}/jogl.gl2.dbg.jar" /> - <property name="jogl.fixed.jar" value="${build}/jogl.fixed.jar" /> <property name="jogl.awt.jar" value="${build}/jogl.awt.jar" /> <property name="jogl.util.jar" value="${build}/jogl.util.jar" /> <property name="jogl.util.gl2.jar" value="${build}/jogl.util.gl2.jar" /> @@ -809,14 +804,16 @@ <target name="java.generate.SystemUtil" depends="java.generate.SystemUtil.javase, java.generate.SystemUtil.javame_cdc_fp" /> <target name="java.generate.BufferUtil.javame_cdc_fp" if="setup.cdcfp"> - <copy file="../src/jogl/classes/javax/media/opengl/util/BufferUtil.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl/util/BufferUtil.java" /> + <copy file="../src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/BufferUtil.java" /> + <copy file="../src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/impl/InternalBufferUtil.java" /> </target> <target name="java.generate.BufferUtil.javase" unless="setup.cdcfp"> - <copy file="../src/jogl/classes/javax/media/opengl/util/BufferUtil.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl/util/BufferUtil.java" /> + <copy file="../src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/BufferUtil.java" /> + <copy file="../src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/impl/InternalBufferUtil.java" /> </target> - <!-- Generate the BufferUtil class for this particular profile --> + <!-- Generate the BufferUtil classes for this particular profile --> <target name="java.generate.BufferUtil" depends="java.generate.BufferUtil.javase, java.generate.BufferUtil.javame_cdc_fp" /> <target name="java.generate.TextureIO.javame_cdc_fp" if="setup.cdcfp"> @@ -1064,24 +1061,24 @@ <!-- 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}/com/sun/opengl/util/glsl/fixed" files="FixedFuncHook.class" /> + <srcfilelist dir="${classes}/com/sun/opengl/util/glsl/fixedfunc" files="FixedFuncHook.class" /> <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES1.class" /> <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES2.class" /> - <targetfileset dir="${src.generated.java}/com/sun/opengl/impl/fixed" - includes="GLFixedFuncImpl.java" /> + <targetfileset dir="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl" + includes="FixedFuncImpl.java" /> </dependset> <!-- Now choose one of the two to test to see if we have to regenerate --> <uptodate property="java.generate.composable.pipeline.custom.skip.glfixfunc" srcfile="${classes}/javax/media/opengl/GL2ES1.class" - targetfile="${src.generated.java}/com/sun/opengl/util/glsl/fixed/FixedFuncImpl.java" /> + targetfile="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" /> </target> <target name="java.generate.composable.pipeline.custom.glfixfunc" depends="java.generate.composable.pipeline.custom.check.glfixfunc" unless="java.generate.composable.pipeline.custom.skip.glfixfunc"> <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true"> <arg value="javax.media.opengl.GL2ES1" /> - <arg value="${src.generated.java}/com/sun/opengl/util/glsl/fixed" /> - <arg value="com.sun.opengl.util.glsl.fixed.FixedFuncImpl" /> - <arg value="com.sun.opengl.util.glsl.fixed.FixedFuncHook" /> + <arg value="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl" /> + <arg value="com.sun.opengl.util.glsl.fixedfunc.impl.FixedFuncImpl" /> + <arg value="com.sun.opengl.util.glsl.fixedfunc.impl.FixedFuncHook" /> <arg value="javax.media.opengl.GL2ES2" /> <arg value="prolog_xor_downstream" /> <classpath refid="pipeline.classpath" /> @@ -1100,7 +1097,7 @@ <!-- Perform the first pass Java compile. --> <javac destdir="${classes}" - includes="javax/media/opengl/sub/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java" + includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java" fork="yes" memoryMaximumSize="128m" source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> @@ -1111,9 +1108,9 @@ </target> <target name="java.compile.secondpass.1" if="javac.bootclasspath.jar"> - <!-- Perform the second pass Java compile; everything. --> + <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. --> <javac destdir="${classes}" - excludes="${java.excludes.all}" + excludes="com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}" source="${jogl.sourcelevel}" bootclasspath="${javac.bootclasspath.jar}" fork="yes" @@ -1126,9 +1123,9 @@ </target> <target name="java.compile.secondpass.2" unless="javac.bootclasspath.jar"> - <!-- Perform the second pass Java compile; everything. --> + <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. --> <javac destdir="${classes}" - excludes="${java.excludes.all}" + excludes="com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}" source="${jogl.sourcelevel}" fork="yes" memoryMaximumSize="128m" @@ -1142,7 +1139,7 @@ <target name="java.compile.secondpass" depends="java.generate.composable.pipeline,java.compile.secondpass.1,java.compile.secondpass.2" /> <target name="java.compile.thirdpass.1" if="javac.bootclasspath.jar"> - <!-- Perform the thirdpass pass Java compile; custom generated sources. --> + <!-- Perform the third pass Java compile; everything including fixed function emulation. --> <javac destdir="${classes}" excludes="${java.excludes.all}" source="${jogl.sourcelevel}" @@ -1151,12 +1148,13 @@ memoryMaximumSize="128m" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <classpath refid="nativewindow_gluegen.classpath"/> + <src path="${src.java}" /> <src path="${src.generated.java}" /> </javac> </target> <target name="java.compile.thirdpass.2" unless="javac.bootclasspath.jar"> - <!-- Perform the thirdpass pass Java compile; custom generated sources. --> + <!-- Perform the third pass Java compile; everything including fixed function emulation. --> <javac destdir="${classes}" excludes="${java.excludes.all}" source="${jogl.sourcelevel}" @@ -1164,6 +1162,7 @@ memoryMaximumSize="128m" debug="${javacdebug}" debuglevel="${javacdebuglevel}"> <classpath refid="nativewindow_gluegen.classpath"/> + <src path="${src.java}" /> <src path="${src.generated.java}" /> </javac> </target> @@ -1384,7 +1383,7 @@ <patternset id="c.src.files.jogl.gl2"> <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}/InternalBufferUtils.c"/> + <include name="${rootrel.src.c}/GLXGetProcAddressARB.c"/> <!-- FIXME: the Mixer should be moved to another library --> <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/--> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> @@ -1401,7 +1400,7 @@ <patternset id="c.src.files.jogl.gl2es12"> <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}/InternalBufferUtils.c"/> + <include name="${rootrel.src.c}/GLXGetProcAddressARB.c"/> <!-- FIXME: the Mixer should be moved to another library --> <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/--> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> @@ -1416,7 +1415,7 @@ </patternset> <patternset id="c.src.files.jogl.es2"> - <include name="${rootrel.src.c}/InternalBufferUtils.c"/> + <include name="${rootrel.src.c}/GLXGetProcAddressARB.c"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/> @@ -1426,7 +1425,7 @@ </patternset> <patternset id="c.src.files.jogl.es1"> - <include name="${rootrel.src.c}/InternalBufferUtils.c"/> + <include name="${rootrel.src.c}/GLXGetProcAddressARB.c"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/> <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/> @@ -1594,15 +1593,10 @@ </filterset> </copy> - <copy todir="${classes}"> - <fileset dir="${src.java}" - includes="com/sun/opengl/impl/glsl/fixed/shader/**" /> - </copy> - <jar manifest="tempversion" destfile="${jogl.core.jar}"> <fileset dir="${classes}" includes="javax/media/opengl/**, com/sun/gluegen/runtime/**, com/sun/opengl/**" - excludes="${java.excludes.fixme} ${java.part.egl}, ${java.part.sdk}, ${java.part.glsl}, ${java.part.openmax}, ${java.part.glsl.fixed}, ${java.part.gl2es12.x11}, ${java.part.gl2es12.win}, ${java.part.gl2es12.osx}, ${java.part.gl2es12.dbg}, ${java.part.gl2.x11}, ${java.part.gl2.win}, ${java.part.gl2.osx}, ${java.part.gl2.dbg}, ${java.part.es1}, ${java.part.es1.dbg}, ${java.part.es2}, ${java.part.es2.dbg}, ${java.part.awt}, ${java.part.glutess}, ${java.part.glumipmap}, ${java.part.glugl2}, ${java.part.util} ${java.part.util.awt} ${java.part.util.gl2}"/> + excludes="${java.excludes.fixme} ${java.part.egl}, ${java.part.sdk}, ${java.part.openmax}, ${java.part.gl2es12.x11}, ${java.part.gl2es12.win}, ${java.part.gl2es12.osx}, ${java.part.gl2es12.dbg}, ${java.part.gl2.x11}, ${java.part.gl2.win}, ${java.part.gl2.osx}, ${java.part.gl2.dbg}, ${java.part.es1}, ${java.part.es1.dbg}, ${java.part.es2}, ${java.part.es2.dbg}, ${java.part.awt}, ${java.part.glutess}, ${java.part.glumipmap}, ${java.part.glugl2}, ${java.part.util} ${java.part.util.awt} ${java.part.util.gl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gles1.jar}"> <fileset dir="${classes}" @@ -1615,8 +1609,8 @@ </jar> <jar manifest="tempversion" destfile="${jogl.gles2.jar}"> <fileset dir="${classes}" - includes="${java.part.es2}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.es2.dbg}, ${java.part.glsl.fixed}"/> + includes="${java.part.es2}, ${java.part.openmax}" + excludes="${java.part.es2.dbg}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gles2.dbg.jar}"> <fileset dir="${classes}" @@ -1629,18 +1623,18 @@ </jar> <jar manifest="tempversion" destfile="${jogl.gl2es12.x11.jar}"> <fileset dir="${classes}" - includes="${java.part.gl2es12.x11}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}, ${java.part.glsl.fixed}"/> + includes="${java.part.gl2es12.x11}, ${java.part.openmax}" + excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gl2es12.win.jar}"> <fileset dir="${classes}" - includes="${java.part.gl2es12.win}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}, ${java.part.glsl.fixed}"/> + includes="${java.part.gl2es12.win}, ${java.part.openmax}" + excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gl2es12.osx.jar}"> <fileset dir="${classes}" - includes="${java.part.gl2es12.osx}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}, ${java.part.glsl.fixed}"/> + includes="${java.part.gl2es12.osx}, ${java.part.openmax}" + excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gl2es12.dbg.jar}"> <fileset dir="${classes}" @@ -1648,28 +1642,23 @@ </jar> <jar manifest="tempversion" destfile="${jogl.gl2.x11.jar}"> <fileset dir="${classes}" - includes="${java.part.gl2.x11}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.glugl2}, ${java.part.glsl.fixed}"/> + includes="${java.part.gl2.x11}, ${java.part.openmax}" + excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gl2.win.jar}"> <fileset dir="${classes}" - includes="${java.part.gl2.win}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.glugl2}, ${java.part.glsl.fixed}"/> + includes="${java.part.gl2.win}, ${java.part.openmax}" + excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gl2.osx.jar}"> <fileset dir="${classes}" - includes="${java.part.gl2.osx}, ${java.part.glsl}, ${java.part.openmax}" - excludes="${java.part.gl2.dbg}, ${java.part.glugl2}, ${java.part.glsl.fixed}"/> + includes="${java.part.gl2.osx}, ${java.part.openmax}" + excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/> </jar> <jar manifest="tempversion" destfile="${jogl.gl2.dbg.jar}"> <fileset dir="${classes}" includes="${java.part.gl2.dbg}"/> </jar> - <jar manifest="tempversion" destfile="${jogl.fixed.jar}"> - <fileset dir="${classes}" - includes="${java.part.glsl.fixed}" - excludes="com/sun/opengl/impl/glsl/fixed/shader/scripts/**"/> - </jar> <jar manifest="tempversion" destfile="${jogl.sdk.jar}"> <fileset dir="${classes}" includes="${java.part.sdk}"/> @@ -1693,7 +1682,9 @@ <jar manifest="tempversion" destfile="${jogl.util.jar}"> <fileset dir="${classes}" includes="${java.part.util}" - excludes="com/sun/opengl/**/awt/**, com/sun/opengl/**/gl2/**, ${java.part.glsl}"/> + excludes="com/sun/opengl/**/awt/**, com/sun/opengl/**/gl2/**"/> + <fileset dir="${src.java}" + includes="${java.part.util.fixedfunc.shaders}"/> </jar> <jar manifest="tempversion" destfile="${jogl.util.gl2.jar}"> <fileset dir="${classes}" @@ -1713,6 +1704,8 @@ <!-- FIXME: this is temporary until we move these classes to another workspace --> <include name="com/sun/javafx/**" /> </fileset> + <fileset dir="${src.java}" + includes="${java.part.util.fixedfunc.shaders}"/> </jar> <delete file="tempversion"/> </target> diff --git a/make/build.xml b/make/build.xml index 2f141d216..82e761862 100644 --- a/make/build.xml +++ b/make/build.xml @@ -35,9 +35,9 @@ <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="http://jcp.org/en/jsr/detail?id=231">license terms</a>." /> <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" /> - <property name="nativewindow.all.jar" value="../${rootrel.build}-nativewindow/nativewindow.all.jar" /> - <property name="jogl.all.jar" value="../${rootrel.build}-jogl/jogl.all.jar" /> - <property name="newt.all.jar" value="../${rootrel.build}-newt/newt.all.jar" /> + <property name="nativewindow.all.jar" value="../${rootrel.build}/nativewindow/nativewindow.all.jar" /> + <property name="jogl.all.jar" value="../${rootrel.build}/jogl/jogl.all.jar" /> + <property name="newt.all.jar" value="../${rootrel.build}/newt/newt.all.jar" /> <path id="all.classpath"> <pathelement location="${nativewindow.all.jar}" /> diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg index e0280c056..bdd9a3655 100755 --- a/make/config/jogl/eglext.cfg +++ b/make/config/jogl/eglext.cfg @@ -10,7 +10,7 @@ ImplPackage com.sun.opengl.impl.egl ImplJavaClass EGLExtImpl # Shouldn't matter which one of these we pick up -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java HierarchicalNativeOutput false Include gl-common.cfg diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 608aafad3..1ee882e40 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -9,8 +9,7 @@ UnsupportedExceptionType GLException Import java.nio.* Import java.util.* Import javax.media.opengl.* -Import javax.media.opengl.sub.* -Import javax.media.opengl.sub.fixed.* +Import javax.media.opengl.fixedfunc.* Import com.sun.opengl.impl.* ##################################################################### diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg index a90c47874..a840aedb5 100755 --- a/make/config/jogl/gl-es1.cfg +++ b/make/config/jogl/gl-es1.cfg @@ -2,32 +2,32 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/es1 -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL2ES1.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/GLObject.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLMatrixIf.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLPointerIf.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLLightingIf.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java # There are a few routines we don't handle yet Ignore glGetBufferPointervOES Package javax.media.opengl Style InterfaceAndImpl JavaClass GLES1 -Extends GLES1 GLObject +Extends GLES1 GLBase Extends GLES1 GL Extends GLES1 GL2ES1 -Extends GLES1 GLMatrixIf -Extends GLES1 GLPointerIf -Extends GLES1 GLLightingIf +Extends GLES1 GLMatrixFunc +Extends GLES1 GLPointerFunc +Extends GLES1 GLLightingFunc ImplPackage com.sun.opengl.impl.es1 ImplJavaClass GLES1Impl -Implements GLES1Impl GLObject +Implements GLES1Impl GLBase Implements GLES1Impl GL Implements GLES1Impl GL2ES1 -Implements GLES1Impl GLMatrixIf -Implements GLES1Impl GLPointerIf -Implements GLES1Impl GLLightingIf +Implements GLES1Impl GLMatrixFunc +Implements GLES1Impl GLPointerFunc +Implements GLES1Impl GLLightingFunc HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg @@ -83,5 +83,4 @@ IncludeAs CustomCCode gl-impl-CustomCCode-gles1.c Import javax.media.opengl.GLES1 Import javax.media.opengl.GLES2 Import javax.media.opengl.GL2 -Import javax.media.opengl.util.BufferUtil - +Import com.sun.opengl.impl.InternalBufferUtil diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg index b9f2f2de4..af0867a6f 100755 --- a/make/config/jogl/gl-es2.cfg +++ b/make/config/jogl/gl-es2.cfg @@ -2,19 +2,19 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/es2 -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL2ES2.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/GLObject.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java Package javax.media.opengl Style InterfaceAndImpl JavaClass GLES2 -Extends GLES2 GLObject +Extends GLES2 GLBase Extends GLES2 GL Extends GLES2 GL2ES2 ImplPackage com.sun.opengl.impl.es2 ImplJavaClass GLES2Impl -Implements GLES2Impl GLObject +Implements GLES2Impl GLBase Implements GLES2Impl GL Implements GLES2Impl GL2ES2 HierarchicalNativeOutput false @@ -64,6 +64,6 @@ Import javax.media.opengl.GLES2 Import javax.media.opengl.GL2 Import javax.media.opengl.GLArrayData Import javax.media.opengl.GLUniformData -Import javax.media.opengl.util.BufferUtil +Import com.sun.opengl.impl.InternalBufferUtil Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg index 5d3df7574..f0aafd932 100644 --- a/make/config/jogl/gl-gl2.cfg +++ b/make/config/jogl/gl-gl2.cfg @@ -2,33 +2,33 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/gl2 -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL2ES1.java -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL2ES2.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/GLObject.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLMatrixIf.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLPointerIf.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLLightingIf.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java Package javax.media.opengl Style InterfaceAndImpl JavaClass GL2 -Extends GL2 GLObject +Extends GL2 GLBase Extends GL2 GL Extends GL2 GL2ES1 Extends GL2 GL2ES2 -Extends GL2 GLMatrixIf -Extends GL2 GLPointerIf -Extends GL2 GLLightingIf +Extends GL2 GLMatrixFunc +Extends GL2 GLPointerFunc +Extends GL2 GLLightingFunc ImplPackage com.sun.opengl.impl.gl2 ImplJavaClass GL2Impl -Implements GL2Impl GLObject +Implements GL2Impl GLBase Implements GL2Impl GL Implements GL2Impl GL2ES1 Implements GL2Impl GL2ES2 -Implements GL2Impl GLMatrixIf -Implements GL2Impl GLPointerIf -Implements GL2Impl GLLightingIf +Implements GL2Impl GLMatrixFunc +Implements GL2Impl GLPointerFunc +Implements GL2Impl GLLightingFunc Include gl-common-gl2.cfg Include gl-common-extensions.cfg Include gl-desktop.cfg @@ -76,5 +76,5 @@ Import javax.media.opengl.GLES2 Import javax.media.opengl.GL2 Import javax.media.opengl.GLArrayData Import javax.media.opengl.GLUniformData -Import javax.media.opengl.util.BufferUtil +Import com.sun.opengl.impl.InternalBufferUtil Import java.io.PrintStream diff --git a/make/config/jogl/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg index 98c2fd3f1..6d1b34bcf 100644 --- a/make/config/jogl/gl-gl2es12.cfg +++ b/make/config/jogl/gl-gl2es12.cfg @@ -2,13 +2,13 @@ JavaOutputDir gensrc/classes NativeOutputDir gensrc/native/jogl/gl2es12 -ExtendedInterfaceSymbolsOnly ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbolsOnly ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL2ES1.java -ExtendedInterfaceSymbolsOnly ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL2ES2.java -ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/sub/GLObject.java -ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/sub/fixed/GLMatrixIf.java -ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/sub/fixed/GLPointerIf.java -ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/sub/fixed/GLLightingIf.java +ExtendedInterfaceSymbolsOnly ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbolsOnly ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java +ExtendedInterfaceSymbolsOnly ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java +ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbolsOnly ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java Package javax.media.opengl Style InterfaceAndImpl @@ -16,19 +16,19 @@ JavaClass GL2ES12 Extends GL2ES12 GL Extends GL2ES12 GL2ES1 Extends GL2ES12 GL2ES2 -Extends GL2ES12 GLObject -Extends GL2ES12 GLMatrixIf -Extends GL2ES12 GLPointerIf -Extends GL2ES12 GLLightingIf +Extends GL2ES12 GLBase +Extends GL2ES12 GLMatrixFunc +Extends GL2ES12 GLPointerFunc +Extends GL2ES12 GLLightingFunc ImplPackage com.sun.opengl.impl.gl2es12 ImplJavaClass GL2ES12Impl Implements GL2ES12Impl GL Implements GL2ES12Impl GL2ES1 Implements GL2ES12Impl GL2ES2 -Implements GL2ES12Impl GLObject -Implements GL2ES12Impl GLMatrixIf -Implements GL2ES12Impl GLPointerIf -Implements GL2ES12Impl GLLightingIf +Implements GL2ES12Impl GLBase +Implements GL2ES12Impl GLMatrixFunc +Implements GL2ES12Impl GLPointerFunc +Implements GL2ES12Impl GLLightingFunc Include gl-common-gl2.cfg Include gl-common-extensions.cfg @@ -68,5 +68,5 @@ IncludeAs CustomCCode gl-impl-CustomCCode-gl2es12.c Import javax.media.opengl.GLES1 Import javax.media.opengl.GLES2 Import javax.media.opengl.GL2ES12 -Import javax.media.opengl.util.BufferUtil +Import com.sun.opengl.impl.InternalBufferUtil Import java.io.PrintStream diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg index 110a6ee43..d24b7f8fa 100755 --- a/make/config/jogl/gl-if-gl.cfg +++ b/make/config/jogl/gl-if-gl.cfg @@ -2,9 +2,9 @@ Package javax.media.opengl Style InterfaceOnly JavaClass GL -Extends GL GLObject +Extends GL GLBase -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/GLObject.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java HierarchicalNativeOutput false Include gl-common.cfg diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg index 654659343..ecd9bc525 100755 --- a/make/config/jogl/gl-if-gl2_es1.cfg +++ b/make/config/jogl/gl-if-gl2_es1.cfg @@ -2,17 +2,17 @@ Package javax.media.opengl Style InterfaceOnly JavaClass GL2ES1 -Extends GL2ES1 GLObject +Extends GL2ES1 GLBase Extends GL2ES1 GL -Extends GL2ES1 GLMatrixIf -Extends GL2ES1 GLPointerIf -Extends GL2ES1 GLLightingIf +Extends GL2ES1 GLMatrixFunc +Extends GL2ES1 GLPointerFunc +Extends GL2ES1 GLLightingFunc -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/GLObject.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLMatrixIf.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLPointerIf.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/fixed/GLLightingIf.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java HierarchicalNativeOutput false Include gl-common.cfg diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg index 493dc2242..716351c3f 100755 --- a/make/config/jogl/gl-if-gl2_es2.cfg +++ b/make/config/jogl/gl-if-gl2_es2.cfg @@ -2,11 +2,11 @@ Package javax.media.opengl Style InterfaceOnly JavaClass GL2ES2 -Extends GL2ES2 GLObject +Extends GL2ES2 GLBase Extends GL2ES2 GL -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/javax/media/opengl/GL.java -ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/sub/GLObject.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java +ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java HierarchicalNativeOutput false Include gl-common.cfg Include gl-common-extensions.cfg diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2.c b/make/config/jogl/gl-impl-CustomCCode-gl2.c index d6a051b36..f97b8eaff 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gl2.c +++ b/make/config/jogl/gl-impl-CustomCCode-gl2.c @@ -13,3 +13,12 @@ Java_com_sun_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject return (jlong) (intptr_t) _res; } +/* Java->C glue code: + * Java package: com.sun.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_sun_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/gl-impl-CustomCCode-gl2es12.c b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c index e056672d3..e2d5cb58d 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gl2es12.c +++ b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c @@ -13,3 +13,12 @@ Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, return (jlong) (intptr_t) _res; } +/* Java->C glue code: + * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl + * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); + * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); + */ +JNIEXPORT jobject JNICALL +Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { + return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); +} diff --git a/make/config/jogl/gl-impl-CustomCCode-gles1.c b/make/config/jogl/gl-impl-CustomCCode-gles1.c index ca5e0374c..efc614e64 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gles1.c +++ b/make/config/jogl/gl-impl-CustomCCode-gles1.c @@ -14,3 +14,12 @@ Java_com_sun_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobjec return (jlong) (intptr_t) _res; } +/* Java->C glue code: + * Java package: com.sun.opengl.impl.es1.GLES1Impl + * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); + * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); + */ +JNIEXPORT jobject JNICALL +Java_com_sun_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { + return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); +} diff --git a/make/config/jogl/gl-impl-CustomCCode-gles2.c b/make/config/jogl/gl-impl-CustomCCode-gles2.c index a138d88cc..27be04749 100644 --- a/make/config/jogl/gl-impl-CustomCCode-gles2.c +++ b/make/config/jogl/gl-impl-CustomCCode-gles2.c @@ -14,3 +14,12 @@ Java_com_sun_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobjec return (jlong) (intptr_t) _res; } +/* Java->C glue code: + * Java package: com.sun.opengl.impl.es2.GLES2Impl + * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity); + * C function: jobject newDirectByteBuffer(jlong addr, jint capacity); + */ +JNIEXPORT jobject JNICALL +Java_com_sun_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) { + return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity); +} diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java index 79df64d9f..b2d61e596 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java @@ -396,8 +396,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { ARBVBOKey key = new ARBVBOKey(addr, sz); ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key); if (_res == null) { - _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); - _res.order(ByteOrder.nativeOrder()); + _res = newDirectByteBuffer(addr, sz); + InternalBufferUtil.nativeOrder(_res); arbVBOCache.put(key, _res); } _res.position(0); @@ -407,6 +407,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { /** 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"); diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java index 9ddbf06fb..0575eb1a2 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java @@ -155,7 +155,7 @@ if(count<=0) { throw new GLException("Method \"glShaderSource\" called with invalid length of source: "+count); } - IntBuffer length = BufferUtil.newIntBuffer(count); + IntBuffer length = InternalBufferUtil.newIntBuffer(count); for(int i=0; i<count; i++) { length.put(source[i].length()); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index 7edd95aea..4668bd7ff 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -336,8 +336,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { ARBVBOKey key = new ARBVBOKey(addr, sz); ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key); if (_res == null) { - _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); - _res.order(ByteOrder.nativeOrder()); + _res = newDirectByteBuffer(addr, sz); + InternalBufferUtil.nativeOrder(_res); arbVBOCache.put(key, _res); } _res.position(0); @@ -347,6 +347,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { /** 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"); diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index a10f8c5e0..3af0864cd 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -291,8 +291,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { ARBVBOKey key = new ARBVBOKey(addr, sz); java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key); if (_res == null) { - _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); - BufferUtil.nativeOrder(_res); + _res = newDirectByteBuffer(addr, sz); + InternalBufferUtil.nativeOrder(_res); arbVBOCache.put(key, _res); } _res.position(0); @@ -302,6 +302,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { /** 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); + public final String toString() { return getClass().getName(); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index face06292..bf94eed43 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -301,8 +301,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { ARBVBOKey key = new ARBVBOKey(addr, sz); java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key); if (_res == null) { - _res = InternalBufferUtils.newDirectByteBuffer(addr, sz); - BufferUtil.nativeOrder(_res); + _res = newDirectByteBuffer(addr, sz); + InternalBufferUtil.nativeOrder(_res); arbVBOCache.put(key, _res); } _res.position(0); @@ -312,6 +312,8 @@ public java.nio.ByteBuffer glMapBuffer(int target, int access) { /** 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); + public void glClearDepth(double depth) { glClearDepthf((float)depth); } diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java index b8c9685f6..94a859ba5 100755 --- a/make/config/jogl/glu-CustomJavaCode-base.java +++ b/make/config/jogl/glu-CustomJavaCode-base.java @@ -1363,21 +1363,21 @@ public void gluLookAt(double eyeX, double eyeY, double eyeZ, double centerX, dou * <P> Accepts the outgoing window coordinates as a single array. */ public boolean gluProject(double objX, double objY, double objZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] winPos, int winPos_offset) { - return project.gluProject((float)objX, (float)objY, (float)objZ, BufferUtil.getFloatArray(model), model_offset, BufferUtil.getFloatArray(proj), proj_offset, view, view_offset, BufferUtil.getFloatArray(winPos), winPos_offset); + return project.gluProject((float)objX, (float)objY, (float)objZ, InternalBufferUtil.getFloatArray(model), model_offset, InternalBufferUtil.getFloatArray(proj), proj_offset, view, view_offset, InternalBufferUtil.getFloatArray(winPos), winPos_offset); } /** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code> * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array. */ public boolean gluUnProject(double winX, double winY, double winZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] objPos, int objPos_offset) { - return project.gluUnProject((float)winX, (float)winY, (float)winZ, BufferUtil.getFloatArray(model), model_offset, BufferUtil.getFloatArray(proj), proj_offset, view, view_offset, BufferUtil.getFloatArray(objPos), objPos_offset); + return project.gluUnProject((float)winX, (float)winY, (float)winZ, InternalBufferUtil.getFloatArray(model), model_offset, InternalBufferUtil.getFloatArray(proj), proj_offset, view, view_offset, InternalBufferUtil.getFloatArray(objPos), objPos_offset); } /** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code> * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array. */ public boolean gluUnProject4(double winX, double winY, double winZ, double clipW, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double nearVal, double farVal, double[] objPos, int objPos_offset) { - return project.gluUnProject4((float)winX, (float)winY, (float)winZ, (float)clipW, BufferUtil.getFloatArray(model), model_offset, BufferUtil.getFloatArray(proj), proj_offset, view, view_offset, (float)nearVal, (float)farVal, BufferUtil.getFloatArray(objPos), objPos_offset); + return project.gluUnProject4((float)winX, (float)winY, (float)winZ, (float)clipW, InternalBufferUtil.getFloatArray(model), model_offset, InternalBufferUtil.getFloatArray(proj), proj_offset, view, view_offset, (float)nearVal, (float)farVal, InternalBufferUtil.getFloatArray(objPos), objPos_offset); } public void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset) { diff --git a/make/config/jogl/glu-CustomJavaCode-gl2.java b/make/config/jogl/glu-CustomJavaCode-gl2.java index aedacf3dd..623d08e8c 100644 --- a/make/config/jogl/glu-CustomJavaCode-gl2.java +++ b/make/config/jogl/glu-CustomJavaCode-gl2.java @@ -218,13 +218,13 @@ private final ByteBuffer copyToByteBuffer(Buffer buf) { if (buf.position() == 0) { return (ByteBuffer) buf; } - return BufferUtil.copyByteBuffer((ByteBuffer) buf); + return InternalBufferUtil.copyByteBuffer((ByteBuffer) buf); } else if (buf instanceof ShortBuffer) { - return BufferUtil.copyShortBufferAsByteBuffer((ShortBuffer) buf); + return InternalBufferUtil.copyShortBufferAsByteBuffer((ShortBuffer) buf); } else if (buf instanceof IntBuffer) { - return BufferUtil.copyIntBufferAsByteBuffer((IntBuffer) buf); + return InternalBufferUtil.copyIntBufferAsByteBuffer((IntBuffer) buf); } else if (buf instanceof FloatBuffer) { - return BufferUtil.copyFloatBufferAsByteBuffer((FloatBuffer) buf); + return InternalBufferUtil.copyFloatBufferAsByteBuffer((FloatBuffer) buf); } else { throw new IllegalArgumentException("Unsupported buffer type (must be one of byte, short, int, or float)"); } @@ -239,11 +239,11 @@ private final int gluScaleImageJava( int format, int widthin, int heightin, if( dataout instanceof ByteBuffer ) { out = (ByteBuffer)dataout; } else if( dataout instanceof ShortBuffer ) { - out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_SHORT); + out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_SHORT); } else if ( dataout instanceof IntBuffer ) { - out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_INT); + out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_INT); } else if ( dataout instanceof FloatBuffer ) { - out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_FLOAT); + out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_FLOAT); } else { throw new IllegalArgumentException("Unsupported destination buffer type (must be byte, short, int, or float)"); } diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java index 074ff99b4..8afc28c15 100755 --- a/make/config/jogl/glu-CustomJavaCode-gl2es1.java +++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java @@ -99,13 +99,13 @@ private final java.nio.ByteBuffer copyToByteBuffer(java.nio.Buffer buf) { if (buf.position() == 0) { return (java.nio.ByteBuffer) buf; } - return BufferUtil.copyByteBuffer((java.nio.ByteBuffer) buf); + return InternalBufferUtil.copyByteBuffer((java.nio.ByteBuffer) buf); } else if (buf instanceof java.nio.ShortBuffer) { - return BufferUtil.copyShortBufferAsByteBuffer((java.nio.ShortBuffer) buf); + return InternalBufferUtil.copyShortBufferAsByteBuffer((java.nio.ShortBuffer) buf); } else if (buf instanceof java.nio.IntBuffer) { - return BufferUtil.copyIntBufferAsByteBuffer((java.nio.IntBuffer) buf); + return InternalBufferUtil.copyIntBufferAsByteBuffer((java.nio.IntBuffer) buf); } else if (buf instanceof java.nio.FloatBuffer) { - return BufferUtil.copyFloatBufferAsByteBuffer((java.nio.FloatBuffer) buf); + return InternalBufferUtil.copyFloatBufferAsByteBuffer((java.nio.FloatBuffer) buf); } else { throw new IllegalArgumentException("Unsupported buffer type (must be one of byte, short, int, or float)"); } @@ -124,11 +124,11 @@ public final int gluScaleImage( int format, int widthin, int heightin, if( dataout instanceof java.nio.ByteBuffer ) { out = (java.nio.ByteBuffer)dataout; } else if( dataout instanceof java.nio.ShortBuffer ) { - out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_SHORT); + out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_SHORT); } else if ( dataout instanceof java.nio.IntBuffer ) { - out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_INT); + out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_INT); } else if ( dataout instanceof java.nio.FloatBuffer ) { - out = BufferUtil.newByteBuffer(dataout.remaining() * BufferUtil.SIZEOF_FLOAT); + out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_FLOAT); } else { throw new IllegalArgumentException("Unsupported destination buffer type (must be byte, short, int, or float)"); } diff --git a/make/config/jogl/glu-common.cfg b/make/config/jogl/glu-common.cfg index a21cfe9c6..3b5a1160a 100644 --- a/make/config/jogl/glu-common.cfg +++ b/make/config/jogl/glu-common.cfg @@ -9,10 +9,7 @@ TagNativeBinding true # Import java.nio.* Import javax.media.opengl.* -Import javax.media.opengl.sub.* -Import javax.media.opengl.sub.fixed.* Import javax.media.opengl.glu.* -Import javax.media.opengl.util.* Import com.sun.opengl.impl.* Import com.sun.opengl.impl.glu.* Import com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg index 564dfc6a7..d69a3df3b 100755 --- a/make/config/jogl/glxext.cfg +++ b/make/config/jogl/glxext.cfg @@ -9,7 +9,7 @@ JavaClass GLXExt ImplPackage com.sun.opengl.impl.x11.glx ImplJavaClass GLXExtImpl -ExtendedInterfaceSymbols ../build/jogl/temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java +ExtendedInterfaceSymbols ../build-temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java Include gl-common-gl2.cfg Include gl-desktop.cfg diff --git a/make/nativewindowRIversion b/make/nativewindowRIversion new file mode 100644 index 000000000..9bfc9e855 --- /dev/null +++ b/make/nativewindowRIversion @@ -0,0 +1,8 @@ +Specification-Title: Native Window Interface API Specification +Specification-Version: @BASEVERSION@ +Specification-Vendor: Sun Microsystems, Inc. +Implementation-Title: Native Window Interface Runtime Environment +Implementation-Version: @VERSION@ +Implementation-Vendor: Sun Microsystems, Inc. +Extension-Name: javax.media.nativewindow +Implementation-Vendor-Id: com.sun diff --git a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp new file mode 100644 index 000000000..1b989dc37 --- /dev/null +++ b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + */ + +package com.sun.opengl.impl; + +import java.lang.reflect.*; +import java.nio.*; + +/** Internal copy of selected routines from BufferUtil to avoid + outward dependencies on com.sun.opengl.util package. */ +public class InternalBufferUtil { + public static final int SIZEOF_BYTE = 1; + public static final int SIZEOF_SHORT = 2; + public static final int SIZEOF_INT = 4; + public static final int SIZEOF_FLOAT = 4; + + //---------------------------------------------------------------------- + // Allocation routines + // + + /** Allocates a new direct ByteBuffer with the specified number of + elements. The returned buffer will have its byte order set to + the host platform's native byte order. */ + public static ByteBuffer newByteBuffer(int numElements) { + ByteBuffer bb = ByteBuffer.allocateDirect(numElements); + nativeOrder(bb); + return bb; + } + + /** Allocates a new direct IntBuffer with the specified number of + elements. The returned buffer will have its byte order set to + the host platform's native byte order. */ + public static IntBuffer newIntBuffer(int numElements) { + ByteBuffer bb = newByteBuffer(numElements * SIZEOF_INT); + return bb.asIntBuffer(); + } + + //---------------------------------------------------------------------- + // Conversion routines + // + + public static float[] getFloatArray(double[] source) { + int i=source.length; + float[] dest = new float[i--]; + while(i>=0) { dest[i]=(float)source[i]; i--; } + return dest; + } + + public static ByteBuffer nativeOrder(ByteBuffer buf) { + if (!isCDCFP) { + try { + if (byteOrderClass == null) { + byteOrderClass = Class.forName("java.nio.ByteOrder"); + orderMethod = ByteBuffer.class.getMethod("order", new Class[] { byteOrderClass }); + Method nativeOrderMethod = byteOrderClass.getMethod("nativeOrder", null); + nativeOrderObject = nativeOrderMethod.invoke(null, null); + } + } catch (Throwable t) { + // Must be running on CDC / FP + isCDCFP = true; + } + + if (!isCDCFP) { + try { + orderMethod.invoke(buf, new Object[] { nativeOrderObject }); + } catch (Throwable t) { + } + } + } + return buf; + } + + //---------------------------------------------------------------------- + // Internals only below this point + // + + // NOTE that this work must be done reflectively at the present time + // because this code must compile and run correctly on both CDC/FP and J2SE + private static boolean isCDCFP; + private static Class byteOrderClass; + private static Object nativeOrderObject; + private static Method orderMethod; +} diff --git a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase new file mode 100644 index 000000000..f9f443e13 --- /dev/null +++ b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + */ + +package com.sun.opengl.impl; + +import java.lang.reflect.*; +import java.nio.*; + +/** Internal copy of selected routines from BufferUtil to avoid + outward dependencies on com.sun.opengl.util package. */ +public class InternalBufferUtil { + public static final int SIZEOF_BYTE = 1; + public static final int SIZEOF_SHORT = 2; + public static final int SIZEOF_INT = 4; + public static final int SIZEOF_FLOAT = 4; + public static final int SIZEOF_LONG = 8; + public static final int SIZEOF_DOUBLE = 8; + + //---------------------------------------------------------------------- + // Allocation routines + // + + /** Allocates a new direct ByteBuffer with the specified number of + elements. The returned buffer will have its byte order set to + the host platform's native byte order. */ + public static ByteBuffer newByteBuffer(int numElements) { + ByteBuffer bb = ByteBuffer.allocateDirect(numElements); + nativeOrder(bb); + return bb; + } + + /** Allocates a new direct DoubleBuffer with the specified number of + elements. The returned buffer will have its byte order set to + the host platform's native byte order. */ + public static DoubleBuffer newDoubleBuffer(int numElements) { + ByteBuffer bb = newByteBuffer(numElements * SIZEOF_DOUBLE); + return bb.asDoubleBuffer(); + } + + /** Allocates a new direct IntBuffer with the specified number of + elements. The returned buffer will have its byte order set to + the host platform's native byte order. */ + public static IntBuffer newIntBuffer(int numElements) { + ByteBuffer bb = newByteBuffer(numElements * SIZEOF_INT); + return bb.asIntBuffer(); + } + + /** Allocates a new direct FloatBuffer with the specified number of + elements. The returned buffer will have its byte order set to + the host platform's native byte order. */ + public static FloatBuffer newFloatBuffer(int numElements) { + ByteBuffer bb = newByteBuffer(numElements * SIZEOF_FLOAT); + return bb.asFloatBuffer(); + } + + //---------------------------------------------------------------------- + // Copy routines (type-to-type) + // + + /** Copies the <i>remaining</i> elements (as defined by + <code>limit() - position()</code>) in the passed ByteBuffer into + a newly-allocated direct ByteBuffer. The returned buffer will + have its byte order set to the host platform's native byte + order. The position of the newly-allocated buffer will be zero, + and the position of the passed buffer is unchanged (though its + mark is changed). */ + public static ByteBuffer copyByteBuffer(ByteBuffer orig) { + ByteBuffer dest = newByteBuffer(orig.remaining()); + dest.put(orig); + dest.rewind(); + return dest; + } + + //---------------------------------------------------------------------- + // Copy routines (type-to-ByteBuffer) + // + + /** Copies the <i>remaining</i> elements (as defined by + <code>limit() - position()</code>) in the passed FloatBuffer + into a newly-allocated direct ByteBuffer. The returned buffer + will have its byte order set to the host platform's native byte + order. The position of the newly-allocated buffer will be zero, + and the position of the passed buffer is unchanged (though its + mark is changed). */ + public static ByteBuffer copyFloatBufferAsByteBuffer(FloatBuffer orig) { + ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_FLOAT); + dest.asFloatBuffer().put(orig); + dest.rewind(); + return dest; + } + + /** Copies the <i>remaining</i> elements (as defined by + <code>limit() - position()</code>) in the passed IntBuffer into + a newly-allocated direct ByteBuffer. The returned buffer will + have its byte order set to the host platform's native byte + order. The position of the newly-allocated buffer will be zero, + and the position of the passed buffer is unchanged (though its + mark is changed). */ + public static ByteBuffer copyIntBufferAsByteBuffer(IntBuffer orig) { + ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_INT); + dest.asIntBuffer().put(orig); + dest.rewind(); + return dest; + } + + /** Copies the <i>remaining</i> elements (as defined by + <code>limit() - position()</code>) in the passed ShortBuffer + into a newly-allocated direct ByteBuffer. The returned buffer + will have its byte order set to the host platform's native byte + order. The position of the newly-allocated buffer will be zero, + and the position of the passed buffer is unchanged (though its + mark is changed). */ + public static ByteBuffer copyShortBufferAsByteBuffer(ShortBuffer orig) { + ByteBuffer dest = newByteBuffer(orig.remaining() * SIZEOF_SHORT); + dest.asShortBuffer().put(orig); + dest.rewind(); + return dest; + } + + //---------------------------------------------------------------------- + // Conversion routines + // + + public static float[] getFloatArray(double[] source) { + int i=source.length; + float[] dest = new float[i--]; + while(i>=0) { dest[i]=(float)source[i]; i--; } + return dest; + } + + public static ByteBuffer nativeOrder(ByteBuffer buf) { + if (!isCDCFP) { + try { + if (byteOrderClass == null) { + byteOrderClass = Class.forName("java.nio.ByteOrder"); + orderMethod = ByteBuffer.class.getMethod("order", new Class[] { byteOrderClass }); + Method nativeOrderMethod = byteOrderClass.getMethod("nativeOrder", null); + nativeOrderObject = nativeOrderMethod.invoke(null, null); + } + } catch (Throwable t) { + // Must be running on CDC / FP + isCDCFP = true; + } + + if (!isCDCFP) { + try { + orderMethod.invoke(buf, new Object[] { nativeOrderObject }); + } catch (Throwable t) { + } + } + } + return buf; + } + + //---------------------------------------------------------------------- + // Internals only below this point + // + + // NOTE that this work must be done reflectively at the present time + // because this code must compile and run correctly on both CDC/FP and J2SE + private static boolean isCDCFP; + private static Class byteOrderClass; + private static Object nativeOrderObject; + private static Method orderMethod; +} diff --git a/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java b/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java index 5788bbc9b..cc8ba639f 100755 --- a/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java +++ b/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java @@ -117,8 +117,7 @@ package com.sun.opengl.impl; import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.util.*; -import javax.media.opengl.sub.fixed.GLMatrixIf; +import javax.media.opengl.fixedfunc.GLMatrixFunc; /** * ProjectFloat.java @@ -181,7 +180,7 @@ public class ProjectFloat { // Slice up one big buffer because some NIO implementations // allocate a huge amount of memory to back even the smallest of // buffers. - locbuf = BufferUtil.newFloatBuffer(2*16+2*4+3*3); + locbuf = InternalBufferUtil.newFloatBuffer(2*16+2*4+3*3); int pos = 0; int sz = 16; matrixBuf = slice(locbuf, pos, sz); @@ -547,7 +546,7 @@ public class ProjectFloat { * @param bottom * @param top */ - public void gluOrtho2D(GLMatrixIf gl, float left, float right, float bottom, float top) { + public void gluOrtho2D(GLMatrixFunc gl, float left, float right, float bottom, float top) { gl.glOrthof(left, right, bottom, top, -1, 1); } @@ -559,7 +558,7 @@ public class ProjectFloat { * @param zNear * @param zFar */ - public void gluPerspective(GLMatrixIf gl, float fovy, float aspect, float zNear, float zFar) { + public void gluPerspective(GLMatrixFunc gl, float fovy, float aspect, float zNear, float zFar) { float sine, cotangent, deltaZ; float radians = fovy / 2 * (float) Math.PI / 180; @@ -597,7 +596,7 @@ public class ProjectFloat { * @param upy * @param upz */ - public void gluLookAt(GLMatrixIf gl, + public void gluLookAt(GLMatrixFunc gl, float eyex, float eyey, float eyez, @@ -1010,7 +1009,7 @@ public class ProjectFloat { * @param deltaY * @param viewport */ - public void gluPickMatrix(GLMatrixIf gl, + public void gluPickMatrix(GLMatrixFunc gl, float x, float y, float deltaX, @@ -1038,7 +1037,7 @@ public class ProjectFloat { * @param viewport * @param viewport_offset */ - public void gluPickMatrix(GLMatrixIf gl, + public void gluPickMatrix(GLMatrixFunc gl, float x, float y, float deltaX, diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index b73cfbd3e..a5f1d2ca3 100755 --- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -348,7 +348,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { public native void shutdown(); public void testGetDirectBufferAddress() { - java.nio.FloatBuffer buf = com.sun.opengl.util.BufferUtil.newFloatBuffer(12); + java.nio.FloatBuffer buf = com.sun.opengl.impl.InternalBufferUtil.newFloatBuffer(12); int addr = getDirectBufferAddress(buf); System.out.println("Direct FloatBuffer's address: 0x" + Integer.toHexString(addr)); } diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java b/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java index 619c0bee3..5b7b679ad 100755 --- a/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java +++ b/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java @@ -117,7 +117,6 @@ package com.sun.opengl.impl.gl2; import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.util.*; import com.sun.opengl.impl.*; /** @@ -174,7 +173,7 @@ public class ProjectDouble { // Slice up one big buffer because some NIO implementations // allocate a huge amount of memory to back even the smallest of // buffers. - DoubleBuffer locbuf = BufferUtil.newDoubleBuffer(128); + DoubleBuffer locbuf = InternalBufferUtil.newDoubleBuffer(128); int pos = 0; int sz = 16; matrixBuf = slice(locbuf, pos, sz); diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/scripts/nvidia-apx/glslc-ff.bat b/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/scripts/nvidia-apx/glslc-ff.bat deleted file mode 100755 index 21fba2fc3..000000000 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/scripts/nvidia-apx/glslc-ff.bat +++ /dev/null @@ -1,9 +0,0 @@ -REM -REM You have to call it from the 'shader' directory, e.g.: -REM scripts\nvidia-apx\glslc-ff.bat -REM -IF !"%JOGLDIR%"==""! GOTO YESPATH -set JOGLDIR=..\lib -:YESPATH - -java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar javax.media.opengl.sdk.glsl.CompileShaderNVidia FixedFuncColor.fp FixedFuncColorTexture.fp FixedFuncColorLight.vp FixedFuncColor.vp diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java b/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java index 2d6e41126..bb1decf42 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java @@ -116,7 +116,6 @@ package com.sun.opengl.impl.glu; import javax.media.opengl.*; -import javax.media.opengl.sub.*; import javax.media.opengl.glu.*; import com.sun.opengl.util.ImmModeSink; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java index c30f83d20..f77f76fc8 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java +++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java @@ -47,8 +47,8 @@ package com.sun.opengl.impl.glu.mipmap; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.glu.GLU; -import javax.media.opengl.util.BufferUtil; import com.sun.opengl.impl.Debug; +import com.sun.opengl.impl.InternalBufferUtil; import java.nio.*; import java.io.*; @@ -89,7 +89,7 @@ public class BuildMipmap { Mipmap.retrieveStoreModes( gl, psm ); try { - newImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, 1, format, + newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, 1, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer(); } catch( OutOfMemoryError ome ) { return( GLU.GLU_OUT_OF_MEMORY ); @@ -117,7 +117,7 @@ public class BuildMipmap { if( otherImage == null ) { memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT ); try { - otherImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer(); + otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer(); } catch( OutOfMemoryError ome ) { gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() ); gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() ); @@ -178,7 +178,7 @@ public class BuildMipmap { } try { - newImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, height, + newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, height, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer(); } catch( OutOfMemoryError ome ) { return( GLU.GLU_OUT_OF_MEMORY ); @@ -206,7 +206,7 @@ public class BuildMipmap { if( otherImage == null ) { memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT ); try { - otherImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer(); + otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer(); } catch( OutOfMemoryError ome ) { gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() ); gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() ); @@ -364,7 +364,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -481,7 +481,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -519,7 +519,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -653,7 +653,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -880,7 +880,7 @@ public class BuildMipmap { int i, j; try { - newImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( + newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, height, format, GL2.GL_UNSIGNED_BYTE ) )); } catch( OutOfMemoryError err ) { return( GLU.GLU_OUT_OF_MEMORY ); @@ -924,7 +924,7 @@ public class BuildMipmap { if( otherImage == null ) { memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE ); try { - otherImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); } catch( OutOfMemoryError err ) { gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() ); gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() ); @@ -1102,7 +1102,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -1288,7 +1288,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -1329,7 +1329,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); @@ -1391,7 +1391,7 @@ public class BuildMipmap { case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ): case( GL2.GL_UNSIGNED_INT_10_10_10_2 ): case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ): - dstImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); + dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )); break; default: return( GLU.GLU_INVALID_ENUM ); diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java index b048bf1f5..aa33550ca 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java +++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java @@ -47,9 +47,9 @@ package com.sun.opengl.impl.glu.mipmap; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.glu.GLU; -import javax.media.opengl.util.BufferUtil; import javax.media.opengl.GLException; import java.nio.*; +import com.sun.opengl.impl.InternalBufferUtil; /** * @@ -574,8 +574,8 @@ public class Mipmap { if( !isLegalFormatForPackedPixelType( format, typeout ) ) { return( GLU.GLU_INVALID_OPERATION ); } - beforeimage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthin, heightin, format, GL2.GL_UNSIGNED_SHORT ) )); - afterimage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthout, heightout, format, GL2.GL_UNSIGNED_SHORT ) )); + beforeimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthin, heightin, format, GL2.GL_UNSIGNED_SHORT ) )); + afterimage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( image_size( widthout, heightout, format, GL2.GL_UNSIGNED_SHORT ) )); if( beforeimage == null || afterimage == null ) { return( GLU.GLU_OUT_OF_MEMORY ); } diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java index 70ddab880..f51c72ea6 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java +++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java @@ -47,8 +47,8 @@ package com.sun.opengl.impl.glu.mipmap; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.glu.GLU; -import javax.media.opengl.util.BufferUtil; import java.nio.*; +import com.sun.opengl.impl.InternalBufferUtil; /** * @@ -2425,9 +2425,9 @@ public class ScaleInternal { } try { - beforeImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn, + beforeImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn, heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer(); - afterImage = BufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn, + afterImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn, heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer(); } catch( OutOfMemoryError err ) { return( GLU.GLU_OUT_OF_MEMORY ); diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index 10d7c5a22..3380de742 100644 --- a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -44,7 +44,6 @@ import java.util.*; import javax.media.nativewindow.*; import javax.media.opengl.*; import com.sun.opengl.impl.*; -import javax.media.opengl.util.BufferUtil; public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { private static final boolean DEBUG = Debug.debug("WindowsWGLDrawableFactory"); diff --git a/src/jogl/classes/javax/media/opengl/util/BufferUtil.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp index 5cad64d04..40f035514 100755 --- a/src/jogl/classes/javax/media/opengl/util/BufferUtil.java.javame_cdc_fp +++ b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp @@ -37,14 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package javax.media.opengl.util; +package com.sun.opengl.util; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GL2ES2; import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; -import com.sun.nativewindow.impl.NWReflection; import java.nio.*; import java.util.*; @@ -379,19 +378,16 @@ public class BufferUtil { // Convenient GL put methods with generic target Buffer // public static void put(Buffer dest, Buffer v) { - Class dClazz = dest.getClass(); - Class vClazz = v.getClass(); - if(!NWReflection.instanceOf(vClazz, dClazz.getName())) { - throw new GLException("This array's dest class "+dClazz+" doesn't match the argument's Class: "+vClazz); - } - if(dest instanceof ByteBuffer) { + if((dest instanceof ByteBuffer) && (v instanceof ByteBuffer)) { ((ByteBuffer)dest).put((ByteBuffer)v); - } else if(dest instanceof ShortBuffer) { + } else if((dest instanceof ShortBuffer) && (v instanceof ShortBuffer)) { ((ShortBuffer)dest).put((ShortBuffer)v); - } else if(dest instanceof IntBuffer) { + } else if((dest instanceof IntBuffer) && (v instanceof IntBuffer)) { ((IntBuffer)dest).put((IntBuffer)v); - } else if(dest instanceof FloatBuffer) { + } else if((dest instanceof FloatBuffer) && (v instanceof FloatBuffer)) { ((FloatBuffer)dest).put((FloatBuffer)v); + } else { + throw new GLException("Incompatible Buffer classes: dest = "+dest.getClass().getName() + ", src = " + v.getClass().getName()); } } diff --git a/src/jogl/classes/javax/media/opengl/util/BufferUtil.java.javase b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase index c3b0a3ab8..d02f3d15f 100755 --- a/src/jogl/classes/javax/media/opengl/util/BufferUtil.java.javase +++ b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase @@ -37,14 +37,13 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package javax.media.opengl.util; +package com.sun.opengl.util; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GL2ES2; import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; -import com.sun.nativewindow.impl.NWReflection; import java.nio.*; import java.util.*; @@ -421,19 +420,16 @@ public class BufferUtil { // Convenient GL put methods with generic target Buffer // public static void put(Buffer dest, Buffer v) { - Class dClazz = dest.getClass(); - Class vClazz = v.getClass(); - if(!NWReflection.instanceOf(vClazz, dClazz.getName())) { - throw new GLException("This array's dest class "+dClazz+" doesn't match the argument's Class: "+vClazz); - } - if(dest instanceof ByteBuffer) { + if((dest instanceof ByteBuffer) && (v instanceof ByteBuffer)) { ((ByteBuffer)dest).put((ByteBuffer)v); - } else if(dest instanceof ShortBuffer) { + } else if((dest instanceof ShortBuffer) && (v instanceof ShortBuffer)) { ((ShortBuffer)dest).put((ShortBuffer)v); - } else if(dest instanceof IntBuffer) { + } else if((dest instanceof IntBuffer) && (v instanceof IntBuffer)) { ((IntBuffer)dest).put((IntBuffer)v); - } else if(dest instanceof FloatBuffer) { + } else if((dest instanceof FloatBuffer) && (v instanceof FloatBuffer)) { ((FloatBuffer)dest).put((FloatBuffer)v); + } else { + throw new GLException("Incompatible Buffer classes: dest = "+dest.getClass().getName() + ", src = " + v.getClass().getName()); } } diff --git a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtils.java b/src/jogl/classes/com/sun/opengl/util/FixedPoint.java index 89639c493..e9bdae0e9 100644 --- a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtils.java +++ b/src/jogl/classes/com/sun/opengl/util/FixedPoint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -29,27 +29,33 @@ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * - * You acknowledge that this software is not designed or intended for use - * in the design, construction, operation or maintenance of any nuclear - * facility. - * - * Sun gratefully acknowledges that this software was originally authored - * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl; +package com.sun.opengl.util; + +public class FixedPoint { + public static final int toFixed(int value) { + if (value < -32768) value = -32768; + if (value > 32767) value = 32767; + return value * 65536; + } -import java.nio.*; + public static final int toFixed(float value) { + if (value < -32768) value = -32768; + if (value > 32767) value = 32767; + return (int)(value * 65536.0f); + } -/** Utility routines available only to the JOGL implementation. */ + public static final float toFloat(int value) { + return (float)value/65536.0f; + } -public class InternalBufferUtils { - /** Allocates a new direct byte buffer at the given address with the - given capacity. This is exposed only because of glMapBufferARB - and its semantics; it is undesirable to allocate a new buffer - every frame because (a) ByteBuffers are finalizable and (b) the - application would typically need to re-slice the buffer every - frame. Instead we cache these ByteBuffer objects up in Java and - look them up in a HashMap by base address and capacity. */ - public static native ByteBuffer newDirectByteBuffer(long address, int capacity); + public static final int mult(int x1, int x2) { + return (int) ( ((long)x1*(long)x2)/65536 ); + } + + public static final int div(int x1, int x2) { + return (int) ( (((long)x1)<<16)/x2 ); + } } + diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java index efee49a16..3dc8159b9 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java +++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java @@ -1,10 +1,14 @@ package com.sun.opengl.util; +import java.security.*; + import javax.media.opengl.*; import javax.media.opengl.util.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.glsl.*; + +import com.sun.opengl.util.glsl.*; + +import com.sun.opengl.impl.SystemUtil; import java.nio.*; @@ -17,7 +21,11 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData * * This should not be necessary on proper native implementations. */ - public static final boolean hasVBOBug = (SystemUtil.getenv("JOGL_VBO_BUG") != null); + public static final boolean hasVBOBug = AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return SystemUtil.getenv("JOGL_VBO_BUG"); + } + }) != null; /** * @arg index The GL array index @@ -34,7 +42,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData int initialSize) throws GLException { - GLProfile.isValidateArrayDataType(index, comps, dataType, false, true); + GLProfile.isValidArrayDataType(index, comps, dataType, false, true); GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc); adc.init(name, index, comps, dataType, normalized, 0, null, initialSize, false, glArrayHandler, 0, 0); @@ -45,7 +53,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData int stride, Buffer buffer) throws GLException { - GLProfile.isValidateArrayDataType(index, comps, dataType, false, true); + GLProfile.isValidArrayDataType(index, comps, dataType, false, true); GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc); adc.init(name, index, comps, dataType, normalized, stride, buffer, comps*comps, false, glArrayHandler, 0, 0); @@ -59,7 +67,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } - GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); + GLProfile.isValidArrayDataType(-1, comps, dataType, true, true); GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc); @@ -74,7 +82,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } - GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); + GLProfile.isValidArrayDataType(-1, comps, dataType, true, true); GLArrayDataClient adc = new GLArrayDataClient(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc); diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java index 59024dec7..caf6efe12 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java +++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java @@ -3,8 +3,8 @@ package com.sun.opengl.util; import javax.media.opengl.*; import java.nio.*; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.glsl.*; + +import com.sun.opengl.util.glsl.*; public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataEditable { @@ -35,7 +35,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE int stride, Buffer buffer, int vboBufferUsage) throws GLException { - GLProfile.isValidateArrayDataType(index, comps, dataType, false, true); + GLProfile.isValidArrayDataType(index, comps, dataType, false, true); GLArrayDataServer ads = new GLArrayDataServer(); GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads); @@ -59,7 +59,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE int initialSize, int vboBufferUsage) throws GLException { - GLProfile.isValidateArrayDataType(index, comps, dataType, false, true); + GLProfile.isValidArrayDataType(index, comps, dataType, false, true); GLArrayDataServer ads = new GLArrayDataServer(); GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads); @@ -81,7 +81,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } - GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); + GLProfile.isValidArrayDataType(-1, comps, dataType, true, true); GLArrayDataServer ads = new GLArrayDataServer(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads); @@ -103,7 +103,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } - GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); + GLProfile.isValidArrayDataType(-1, comps, dataType, true, true); GLArrayDataServer ads = new GLArrayDataServer(); GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads); diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java index 808848b22..cacc285d1 100644 --- a/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java +++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java @@ -3,7 +3,8 @@ package com.sun.opengl.util; import javax.media.opengl.*; import javax.media.opengl.util.*; -import com.sun.opengl.impl.*; + +import com.sun.opengl.util.glsl.fixedfunc.impl.*; import java.nio.*; @@ -14,7 +15,7 @@ public class GLArrayDataWrapper implements GLArrayData { int vboName, long bufferOffset) throws GLException { - GLProfile.isValidateArrayDataType(index, comps, dataType, false, true); + GLProfile.isValidArrayDataType(index, comps, dataType, false, true); GLArrayDataWrapper adc = new GLArrayDataWrapper(); adc.init(null, index, comps, dataType, normalized, stride, buffer, false, vboName, bufferOffset); @@ -29,7 +30,7 @@ public class GLArrayDataWrapper implements GLArrayData { if(!GLProfile.isGL2ES2()) { throw new GLException("GLArrayDataServer not supported for profile: "+GLProfile.getProfile()); } - GLProfile.isValidateArrayDataType(-1, comps, dataType, true, true); + GLProfile.isValidArrayDataType(-1, comps, dataType, true, true); GLArrayDataWrapper adc = new GLArrayDataWrapper(); adc.init(name, -1, comps, dataType, normalized, stride, buffer, true, @@ -157,7 +158,8 @@ public class GLArrayDataWrapper implements GLArrayData { this.isVertexAttribute = isVertexAttribute; this.index = index; this.location = -1; - this.name = (null==name)?GLContext.getPredefinedArrayIndexName(index):name; + // We can't have any dependence on the FixedFuncUtil class here for build bootstrapping reasons + this.name = (null==name)?FixedFuncPipeline.getPredefinedArrayIndexName(index):name; if(null==this.name) { throw new GLException("Not a valid GL array index: "+index); } diff --git a/src/jogl/classes/com/sun/opengl/impl/GLArrayHandler.java b/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java index d34e04b10..9443ad6ed 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLArrayHandler.java +++ b/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java @@ -1,8 +1,7 @@ -package com.sun.opengl.impl; +package com.sun.opengl.util; import javax.media.opengl.*; -import javax.media.opengl.sub.*; public interface GLArrayHandler { diff --git a/src/jogl/classes/com/sun/opengl/impl/GLFixedArrayHandler.java b/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java index 86ae92754..f1e2502be 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLFixedArrayHandler.java +++ b/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java @@ -1,9 +1,8 @@ -package com.sun.opengl.impl; +package com.sun.opengl.util; import javax.media.opengl.*; -import javax.media.opengl.sub.*; -import javax.media.opengl.sub.fixed.*; +import javax.media.opengl.fixedfunc.*; import com.sun.opengl.util.*; import java.nio.*; @@ -14,18 +13,18 @@ public class GLFixedArrayHandler implements GLArrayHandler { this.ad = ad; } - protected final void passArrayPointer(GLPointerIf gl) { + protected final void passArrayPointer(GLPointerFunc gl) { switch(ad.getIndex()) { - case GLPointerIf.GL_VERTEX_ARRAY: + case GLPointerFunc.GL_VERTEX_ARRAY: gl.glVertexPointer(ad); break; - case GLPointerIf.GL_NORMAL_ARRAY: + case GLPointerFunc.GL_NORMAL_ARRAY: gl.glNormalPointer(ad); break; - case GLPointerIf.GL_COLOR_ARRAY: + case GLPointerFunc.GL_COLOR_ARRAY: gl.glColorPointer(ad); break; - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: gl.glTexCoordPointer(ad); break; default: @@ -34,7 +33,7 @@ public class GLFixedArrayHandler implements GLArrayHandler { } public void enableBuffer(GL gl, boolean enable) { - GLPointerIf glp = gl.getGL2ES1(); + GLPointerFunc glp = gl.getGL2ES1(); if(enable) { glp.glEnableClientState(ad.getIndex()); diff --git a/src/jogl/classes/javax/media/opengl/util/Gamma.java b/src/jogl/classes/com/sun/opengl/util/Gamma.java index ba7bc5a32..8be4f4edf 100755 --- a/src/jogl/classes/javax/media/opengl/util/Gamma.java +++ b/src/jogl/classes/com/sun/opengl/util/Gamma.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package javax.media.opengl.util; +package com.sun.opengl.util; import com.sun.opengl.impl.*; diff --git a/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java b/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java index 4f30cd7b1..d3b61d7c5 100644 --- a/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java +++ b/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java @@ -3,8 +3,7 @@ package com.sun.opengl.util; import javax.media.opengl.*; import javax.media.opengl.util.*; -import javax.media.opengl.sub.*; -import javax.media.opengl.sub.fixed.*; +import javax.media.opengl.fixedfunc.*; import com.sun.nativewindow.impl.NWReflection; import java.nio.*; import java.util.Iterator; @@ -861,25 +860,25 @@ public class ImmModeSink { buffer.flip(); if(vComps>0) { - vArrayData = GLArrayDataWrapper.createFixed(GLPointerIf.GL_VERTEX_ARRAY, vComps, vDataType, false, + vArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, vComps, vDataType, false, 0, vertexArray, 0, vOffset); } else { vArrayData = null; } if(cComps>0) { - cArrayData = GLArrayDataWrapper.createFixed(GLPointerIf.GL_COLOR_ARRAY, cComps, cDataType, false, + cArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, cComps, cDataType, false, 0, colorArray, 0, cOffset); } else { cArrayData = null; } if(nComps>0) { - nArrayData = GLArrayDataWrapper.createFixed(GLPointerIf.GL_NORMAL_ARRAY, nComps, nDataType, false, + nArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_NORMAL_ARRAY, nComps, nDataType, false, 0, normalArray, 0, nOffset); } else { nArrayData = null; } if(tComps>0) { - tArrayData = GLArrayDataWrapper.createFixed(GLPointerIf.GL_TEXTURE_COORD_ARRAY, tComps, tDataType, false, + tArrayData = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, tComps, tDataType, false, 0, textCoordArray, 0, tOffset); } else { tArrayData = null; diff --git a/src/jogl/classes/com/sun/opengl/impl/io/Locator.java b/src/jogl/classes/com/sun/opengl/util/Locator.java index 863829960..06cd50ce8 100644 --- a/src/jogl/classes/com/sun/opengl/impl/io/Locator.java +++ b/src/jogl/classes/com/sun/opengl/util/Locator.java @@ -1,13 +1,44 @@ -package com.sun.opengl.impl.io; +/* + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * + */ -import javax.media.opengl.util.*; +package com.sun.opengl.util; import java.util.*; import java.nio.*; import java.io.*; import java.net.*; -/** Utilities for dealing with streams. */ +/** Utilities for dealing with resources. */ public class Locator { private Locator() {} diff --git a/src/jogl/classes/javax/media/opengl/util/PMVMatrix.java b/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java index 4598993f1..4211e893b 100755 --- a/src/jogl/classes/javax/media/opengl/util/PMVMatrix.java +++ b/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java @@ -1,8 +1,37 @@ /* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistribution in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. ALL + * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN + * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR + * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR + * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR + * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE + * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, + * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF + * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * */ -package javax.media.opengl.util; +package com.sun.opengl.util; import com.sun.opengl.impl.ProjectFloat; @@ -11,9 +40,9 @@ import java.util.ArrayList; import java.util.List; import javax.media.opengl.*; -import javax.media.opengl.sub.fixed.GLMatrixIf; +import javax.media.opengl.fixedfunc.GLMatrixFunc; -public class PMVMatrix implements GLMatrixIf { +public class PMVMatrix implements GLMatrixFunc { public PMVMatrix() { projectFloat = new ProjectFloat(); diff --git a/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java index d40339264..6e668b84a 100755 --- a/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java +++ b/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java @@ -38,9 +38,9 @@ */ package com.sun.opengl.util.awt; -import com.sun.opengl.impl.*; -import com.sun.opengl.impl.packrect.*; +import com.sun.opengl.impl.Debug; import com.sun.opengl.util.*; +import com.sun.opengl.util.packrect.*; import com.sun.opengl.util.texture.*; import com.sun.opengl.util.texture.awt.*; @@ -70,7 +70,6 @@ import javax.media.opengl.*; import javax.media.opengl.glu.*; import javax.media.opengl.glu.gl2.*; import javax.media.opengl.awt.*; -import javax.media.opengl.util.*; /** Renders bitmapped Java 2D text into an OpenGL window with high diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/GLSLArrayHandler.java b/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java index 30c4a0190..1ef9874e4 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/GLSLArrayHandler.java +++ b/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java @@ -1,10 +1,8 @@ -package com.sun.opengl.impl.glsl; - -import com.sun.opengl.impl.*; +package com.sun.opengl.util.glsl; import javax.media.opengl.*; -import javax.media.opengl.sub.*; +import javax.media.opengl.fixedfunc.*; import com.sun.opengl.util.*; import com.sun.opengl.util.glsl.ShaderState; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java index f5ed88ff0..cba5f91b3 100644 --- a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java @@ -2,9 +2,7 @@ package com.sun.opengl.util.glsl; import javax.media.opengl.*; -import javax.media.opengl.util.*; -import com.sun.opengl.util.StreamUtil; -import com.sun.opengl.impl.io.Locator; +import com.sun.opengl.util.*; import java.util.*; import java.nio.*; diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java new file mode 100644 index 000000000..02d6ec92e --- /dev/null +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java @@ -0,0 +1,81 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + */ + +package com.sun.opengl.util.glsl.fixedfunc; + +import javax.media.opengl.*; +import javax.media.opengl.fixedfunc.*; + +import com.sun.opengl.util.glsl.fixedfunc.impl.*; + +/** + * Tool to pipeline GL2ES2 into a fixed function emulation implementing GL2ES1. + */ +public class FixedFuncUtil { + /** + * @return If gl is a GL2ES1, return the type cast object, + * otherwise create a fixed function emulation pipeline with the GL2ES2 impl. + * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2 + */ + public static final GL2ES1 getFixedFuncImpl(GL gl) { + if(gl.isGL2ES1()) { + return gl.getGL2ES1(); + } else if(gl.isGL2ES2()) { + GL2ES2 es2 = (GL2ES2)gl; + FixedFuncHook hook = new FixedFuncHook(es2); + FixedFuncImpl impl = new FixedFuncImpl(es2, hook); + gl.getContext().setGL(impl); + return impl; + } + throw new GLException("GL Object is neither GL2ES1 nor GL2ES2"); + } + + /** + * Mapping fixed function (client) array indices to + * GLSL array attribute names. + * + * Useful for uniq mapping of canonical array index names as listed. + * + * @see #mgl_Vertex + * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_VERTEX_ARRAY + * @see #mgl_Normal + * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_NORMAL_ARRAY + * @see #mgl_Color + * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_COLOR_ARRAY + * @see #mgl_MultiTexCoord + * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_TEXTURE_COORD_ARRAY + * @see javax.media.opengl.fixedfunc.GLPointerFunc#glEnableClientState + * @see javax.media.opengl.fixedfunc.GLPointerFunc#glVertexPointer + * @see javax.media.opengl.fixedfunc.GLPointerFunc#glColorPointer + * @see javax.media.opengl.fixedfunc.GLPointerFunc#glNormalPointer + * @see javax.media.opengl.fixedfunc.GLPointerFunc#glTexCoordPointer + */ + public static String getPredefinedArrayIndexName(int glArrayIndex) { + return FixedFuncPipeline.getPredefinedArrayIndexName(glArrayIndex); + } + + /** + * String name for + * @see javax.media.opengl.GL#GL_VERTEX_ARRAY + */ + public static final String mgl_Vertex = FixedFuncPipeline.mgl_Vertex; + + /** + * String name for + * @see javax.media.opengl.GL#GL_NORMAL_ARRAY + */ + public static final String mgl_Normal = FixedFuncPipeline.mgl_Normal; + + /** + * String name for + * @see javax.media.opengl.GL#GL_COLOR_ARRAY + */ + public static final String mgl_Color = FixedFuncPipeline.mgl_Color; + + /** + * String name for + * @see javax.media.opengl.GL#GL_TEXTURE_COORD_ARRAY + */ + public static final String mgl_MultiTexCoord = FixedFuncPipeline.mgl_MultiTexCoord; +} diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixed/FixedFuncHook.java b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java index cb80cdcf9..626f3fdaa 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/fixed/FixedFuncHook.java +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java @@ -2,20 +2,18 @@ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. */ -package com.sun.opengl.util.glsl.fixed; +package com.sun.opengl.util.glsl.fixedfunc.impl; import javax.media.opengl.*; -import javax.media.opengl.sub.*; -import javax.media.opengl.sub.fixed.*; +import javax.media.opengl.fixedfunc.*; import javax.media.opengl.util.*; import javax.media.opengl.glu.*; import com.sun.gluegen.runtime.BufferFactory; import com.sun.opengl.util.*; import com.sun.opengl.util.glsl.*; -import com.sun.opengl.impl.glsl.fixed.*; import java.nio.*; -public class FixedFuncHook implements GLLightingIf, GLMatrixIf, GLPointerIf { +public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFunc { public static final int MAX_TEXTURE_UNITS = 8; protected FixedFuncPipeline fixedFunction=null; diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/FixedFuncPipeline.java b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java index 1d33254c0..1b8dd1f11 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/FixedFuncPipeline.java +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java @@ -1,16 +1,37 @@ -package com.sun.opengl.impl.glsl.fixed; +package com.sun.opengl.util.glsl.fixedfunc.impl; import javax.media.opengl.*; -import javax.media.opengl.util.*; -import javax.media.opengl.sub.fixed.*; +import javax.media.opengl.fixedfunc.*; +import com.sun.opengl.util.*; import com.sun.opengl.util.glsl.*; +import com.sun.opengl.util.glsl.fixedfunc.*; import java.nio.*; public class FixedFuncPipeline { public static final int MAX_TEXTURE_UNITS = 8; public static final int MAX_LIGHTS = 8; + // We can't have any dependencies on the FixedFuncUtil class for build bootstrapping reasons + public static final String mgl_Vertex = "mgl_Vertex"; + public static final String mgl_Normal = "mgl_Normal"; + public static final String mgl_Color = "mgl_Color"; + public static final String mgl_MultiTexCoord = "mgl_MultiTexCoord" ; + + public static String getPredefinedArrayIndexName(int glArrayIndex) { + switch(glArrayIndex) { + case GLPointerFunc.GL_VERTEX_ARRAY: + return mgl_Vertex; + case GLPointerFunc.GL_NORMAL_ARRAY: + return mgl_Normal; + case GLPointerFunc.GL_COLOR_ARRAY: + return mgl_Color; + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: + return mgl_MultiTexCoord; + } + return null; + } + public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix) { init(gl, pmvMatrix, FixedFuncPipeline.class, shaderSrcRootDef, shaderBinRootDef, vertexColorFileDef, vertexColorLightFileDef, fragmentColorFileDef, fragmentColorTextureFileDef); @@ -41,13 +62,13 @@ public class FixedFuncPipeline { } public String getArrayIndexName(int glArrayIndex) { - String name = GLContext.getPredefinedArrayIndexName(glArrayIndex); + String name = getPredefinedArrayIndexName(glArrayIndex); switch(glArrayIndex) { - case GLPointerIf.GL_VERTEX_ARRAY: - case GLPointerIf.GL_NORMAL_ARRAY: - case GLPointerIf.GL_COLOR_ARRAY: + case GLPointerFunc.GL_VERTEX_ARRAY: + case GLPointerFunc.GL_NORMAL_ARRAY: + case GLPointerFunc.GL_COLOR_ARRAY: break; - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: name = name + activeTextureUnit; } return name; @@ -115,38 +136,38 @@ public class FixedFuncPipeline { public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) { shaderState.glUseProgram(gl, true); - light -=GLLightingIf.GL_LIGHT0; + light -=GLLightingFunc.GL_LIGHT0; if(0 <= light && light < MAX_LIGHTS) { GLUniformData ud = null; switch(pname) { - case GLLightingIf.GL_AMBIENT: + case GLLightingFunc.GL_AMBIENT: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].ambient"); break; - case GLLightingIf.GL_DIFFUSE: + case GLLightingFunc.GL_DIFFUSE: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].diffuse"); break; - case GLLightingIf.GL_SPECULAR: + case GLLightingFunc.GL_SPECULAR: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].specular"); break; - case GLLightingIf.GL_POSITION: + case GLLightingFunc.GL_POSITION: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].position"); break; - case GLLightingIf.GL_SPOT_DIRECTION: + case GLLightingFunc.GL_SPOT_DIRECTION: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotDirection"); break; - case GLLightingIf.GL_SPOT_EXPONENT: + case GLLightingFunc.GL_SPOT_EXPONENT: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotExponent"); break; - case GLLightingIf.GL_SPOT_CUTOFF: + case GLLightingFunc.GL_SPOT_CUTOFF: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotCutoff"); break; - case GLLightingIf.GL_CONSTANT_ATTENUATION: + case GLLightingFunc.GL_CONSTANT_ATTENUATION: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].constantAttenuation"); break; - case GLLightingIf.GL_LINEAR_ATTENUATION: + case GLLightingFunc.GL_LINEAR_ATTENUATION: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].linearAttenuation"); break; - case GLLightingIf.GL_QUADRATIC_ATTENUATION: + case GLLightingFunc.GL_QUADRATIC_ATTENUATION: ud = shaderState.getUniform(mgl_LightSource+"["+light+"].quadraticAttenuation"); break; default: @@ -181,22 +202,22 @@ public class FixedFuncPipeline { GLUniformData ud = null; switch(pname) { - case GLLightingIf.GL_AMBIENT: + case GLLightingFunc.GL_AMBIENT: ud = shaderState.getUniform(mgl_FrontMaterial+".ambient"); break; - case GLLightingIf.GL_AMBIENT_AND_DIFFUSE: - glMaterialfv(gl, face, GLLightingIf.GL_AMBIENT, params); + case GLLightingFunc.GL_AMBIENT_AND_DIFFUSE: + glMaterialfv(gl, face, GLLightingFunc.GL_AMBIENT, params); // fall through intended .. - case GLLightingIf.GL_DIFFUSE: + case GLLightingFunc.GL_DIFFUSE: ud = shaderState.getUniform(mgl_FrontMaterial+".diffuse"); break; - case GLLightingIf.GL_SPECULAR: + case GLLightingFunc.GL_SPECULAR: ud = shaderState.getUniform(mgl_FrontMaterial+".specular"); break; - case GLLightingIf.GL_EMISSION: + case GLLightingFunc.GL_EMISSION: ud = shaderState.getUniform(mgl_FrontMaterial+".emission"); break; - case GLLightingIf.GL_SHININESS: + case GLLightingFunc.GL_SHININESS: ud = shaderState.getUniform(mgl_FrontMaterial+".shininess"); break; default: @@ -251,7 +272,7 @@ public class FixedFuncPipeline { case GL.GL_TEXTURE_2D: textureEnabled=enable; return true; - case GLLightingIf.GL_LIGHTING: + case GLLightingFunc.GL_LIGHTING: lightingEnabled=enable; return false; case GL.GL_CULL_FACE: @@ -262,7 +283,7 @@ public class FixedFuncPipeline { return true; } - int light = cap - GLLightingIf.GL_LIGHT0; + int light = cap - GLLightingFunc.GL_LIGHT0; if(0 <= light && light < MAX_LIGHTS) { if ( (lightsEnabled.get(light)==1) != enable ) { lightsEnabled.put(light, enable?1:0); @@ -307,7 +328,7 @@ public class FixedFuncPipeline { } ud = shaderState.getUniform(mgl_ColorEnabled); if(null!=ud) { - int ca = (shaderState.isVertexAttribArrayEnabled(GLContext.mgl_Color)==true)?1:0; + int ca = (shaderState.isVertexAttribArrayEnabled(mgl_Color)==true)?1:0; if(ca!=ud.intValue()) { ud.setData(ca); shaderState.glUniform(gl, ud); @@ -527,7 +548,7 @@ public class FixedFuncPipeline { protected static final String vertexColorLightFileDef = "FixedFuncColorLight"; protected static final String fragmentColorFileDef = "FixedFuncColor"; protected static final String fragmentColorTextureFileDef = "FixedFuncColorTexture"; - protected static final String shaderSrcRootDef = "shader" ; - protected static final String shaderBinRootDef = "shader/bin" ; + protected static final String shaderSrcRootDef = "shaders" ; + protected static final String shaderBinRootDef = "shaders/bin" ; } diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColor.fp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp index 408ff7251..408ff7251 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColor.fp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColor.vp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp index 346e40196..346e40196 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColor.vp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColorLight.vp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp index ce203cfb9..ce203cfb9 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColorLight.vp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColorTexture.fp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp index 86e6ace73..86e6ace73 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/FixedFuncColorTexture.fp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColor.bfp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp Binary files differindex 3ebaaee1d..3ebaaee1d 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColor.bfp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColor.bvp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp Binary files differindex 279ef72c7..279ef72c7 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColor.bvp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColorLight.bvp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp Binary files differindex 5a9deea71..5a9deea71 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColorLight.bvp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColorTexture.bfp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp Binary files differindex ce1397fe1..ce1397fe1 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/bin/nvidia/FixedFuncColorTexture.bfp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/es_precision.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl index fd6abe54e..fd6abe54e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/es_precision.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_attribute.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl index b09bdb05a..b09bdb05a 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_attribute.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_const.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl index 1a464a1cb..1a464a1cb 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_const.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_lightdef.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl index 98e214139..98e214139 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_lightdef.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_settexcoord.vp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp index 1efe328d0..1efe328d0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_settexcoord.vp +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_uniform.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl index d8b3c7f95..d8b3c7f95 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_uniform.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_uniform_light.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl index 0dedb5d5d..0dedb5d5d 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_uniform_light.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_varying.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl index fc9f735d1..fc9f735d1 100644 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/mgl_varying.glsl +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat new file mode 100755 index 000000000..002dca8ef --- /dev/null +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat @@ -0,0 +1,9 @@ +REM +REM You have to call it from the 'shaders' directory, e.g.: +REM scripts\nvidia-apx\glslc-ff.bat +REM +IF !"%JOGLDIR%"==""! GOTO YESPATH +set JOGLDIR=..\lib +:YESPATH + +java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar com.sun.opengl.util.glsl.sdk.CompileShaderNVidia FixedFuncColor.fp FixedFuncColorTexture.fp FixedFuncColorLight.vp FixedFuncColor.vp diff --git a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/scripts/nvidia-apx/glslc.bat b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat index 28f3cf822..9b5a4b39c 100755 --- a/src/jogl/classes/com/sun/opengl/impl/glsl/fixed/shader/scripts/nvidia-apx/glslc.bat +++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat @@ -1,9 +1,9 @@ REM -REM You have to call it from the 'shader' directory, e.g.: +REM You have to call it from the 'shaders' directory, e.g.: REM scripts\nvidia-apx\glslc.bat <FileName> REM IF !"%JOGLDIR%"==""! GOTO YESPATH set JOGLDIR=..\lib :YESPATH -java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar javax.media.opengl.sdk.glsl.CompileShaderNVidia %1 +java -cp %JOGLDIR%\jogl.core.jar;%JOGLDIR%\jogl.gles2.jar;%JOGLDIR%\jogl.fixed.jar;%JOGLDIR%\jogl.sdk.jar com.sun.opengl.util.glsl.sdk.CompileShaderNVidia %1 diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java index 9b3a48780..f18005feb 100755 --- a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java +++ b/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java @@ -1,7 +1,7 @@ package com.sun.opengl.util.glsl.sdk; import javax.media.opengl.*; -import com.sun.opengl.impl.io.Locator; +import com.sun.opengl.util.*; import com.sun.opengl.util.glsl.*; import java.io.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/BackingStoreManager.java b/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java index 2ca5a5a7b..754ba2757 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/BackingStoreManager.java +++ b/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.packrect; +package com.sun.opengl.util.packrect; /** This interface must be implemented by the end user and is called in response to events like addition of rectangles into the diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/Level.java b/src/jogl/classes/com/sun/opengl/util/packrect/Level.java index 12a09cd9a..3dae4301d 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/Level.java +++ b/src/jogl/classes/com/sun/opengl/util/packrect/Level.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.packrect; +package com.sun.opengl.util.packrect; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/LevelSet.java b/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java index 97a1f2e74..973980fdc 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/LevelSet.java +++ b/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.packrect; +package com.sun.opengl.util.packrect; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/Rect.java b/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java index f47660e94..2f12981a6 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/Rect.java +++ b/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.packrect; +package com.sun.opengl.util.packrect; /** Represents a rectangular region on the backing store. The edges of the rectangle are the infinitely thin region between adjacent diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/RectVisitor.java b/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java index 6474f204e..8f395ed99 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/RectVisitor.java +++ b/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.packrect; +package com.sun.opengl.util.packrect; /** Iteration construct without exposing the internals of the RectanglePacker and without implementing a complex Iterator. */ diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/RectanglePacker.java b/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java index 8520484cf..51e6842c0 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/RectanglePacker.java +++ b/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java @@ -37,7 +37,7 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -package com.sun.opengl.impl.packrect; +package com.sun.opengl.util.packrect; import java.util.*; diff --git a/src/jogl/classes/com/sun/opengl/impl/packrect/package.html b/src/jogl/classes/com/sun/opengl/util/packrect/package.html index 7f2522244..7f2522244 100755 --- a/src/jogl/classes/com/sun/opengl/impl/packrect/package.html +++ b/src/jogl/classes/com/sun/opengl/util/packrect/package.html diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase b/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase index cca8dbd2b..8a3e1c4be 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase +++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase @@ -44,7 +44,7 @@ import java.nio.*; import java.nio.channels.*; import javax.media.opengl.*; -import javax.media.opengl.util.*; +import com.sun.opengl.util.*; import com.sun.opengl.util.texture.*; /** A reader and writer for DirectDraw Surface (.dds) files, which are diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java new file mode 100644 index 000000000..9d88bae58 --- /dev/null +++ b/src/jogl/classes/javax/media/opengl/GLBase.java @@ -0,0 +1,105 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + */ + +package javax.media.opengl; + +import java.nio.*; + +/** + * The base interface from which all GL profiles derive, providing + * checked conversion down to concrete profiles, and access to the + * OpenGL context associated with the GL. + */ +public interface GLBase { + + /** + * Indicates whether this GL object conforms to any of the common GL profiles. + * @return whether this GL object conforms to any of the common GL profiles + */ + public boolean isGL(); + + /** + * Indicates whether this GL object conforms to the GL2 profile. + * @return whether this GL object conforms to the GL2 profile + */ + public boolean isGL2(); + + /** + * Indicates whether this GL object conforms to the GLES1 profile. + * @return whether this GL object conforms to the GLES1 profile + */ + public boolean isGLES1(); + + /** + * Indicates whether this GL object conforms to the GLES2 profile. + * @return whether this GL object conforms to the GLES2 profile + */ + public boolean isGLES2(); + + /** + * Indicates whether this GL object conforms to one of the OpenGL ES profiles. + * @return whether this GL object conforms to one of the OpenGL ES profiles + */ + public boolean isGLES(); + + /** + * Indicates whether this GL object conforms to the GL2ES1 profile. + * @return whether this GL object conforms to the GL2ES1 profile + */ + public boolean isGL2ES1(); + + /** + * Indicates whether this GL object conforms to the GL2ES2 profile. + * @return whether this GL object conforms to the GL2ES2 profile + */ + public boolean isGL2ES2(); + + /** + * Casts this object to the GL interface. + * @return this object cast to the GL interface + * @throws GLException if this GLObject is not a GL implementation + */ + public GL getGL() throws GLException; + + /** + * Casts this object to the GL2 interface. + * @return this object cast to the GL2 interface + * @throws GLException if this GLObject is not a GL2 implementation + */ + public GL2 getGL2() throws GLException; + + /** + * Casts this object to the GLES1 interface. + * @return this object cast to the GLES1 interface + * @throws GLException if this GLObject is not a GLES1 implementation + */ + public GLES1 getGLES1() throws GLException; + + /** + * Casts this object to the GLES2 interface. + * @return this object cast to the GLES2 interface + * @throws GLException if this GLObject is not a GLES2 implementation + */ + public GLES2 getGLES2() throws GLException; + + /** + * Casts this object to the GL2ES1 interface. + * @return this object cast to the GL2ES1 interface + * @throws GLException if this GLObject is not a GL2ES1 implementation + */ + public GL2ES1 getGL2ES1() throws GLException; + + /** + * Casts this object to the GL2ES2 interface. + * @return this object cast to the GL2ES2 interface + * @throws GLException if this GLObject is not a GL2ES2 implementation + */ + public GL2ES2 getGL2ES2() throws GLException; + + /** + * Returns the GLContext with which this GL object is associated. + * @return the GLContext with which this GL object is associated + */ + public GLContext getContext(); +} diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 78252b4e8..5a4631560 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -40,7 +40,6 @@ package javax.media.opengl; import com.sun.opengl.impl.Debug; -import javax.media.opengl.sub.fixed.*; import java.util.HashMap; /** Abstraction for an OpenGL rendering context. In order to perform @@ -229,63 +228,4 @@ public abstract class GLContext { GLX) extensions. Can only be called while this context is current. */ public abstract String getPlatformExtensionsString(); - - /** - * Mapping fixed function (client) array indices to - * GLSL array attribute names. - * - * Useful for uniq mapping of canonical array index names as listed. - * - * @see #mgl_Vertex - * @see javax.media.opengl.sub.fixed.GLPointerIf#GL_VERTEX_ARRAY - * @see #mgl_Normal - * @see javax.media.opengl.sub.fixed.GLPointerIf#GL_NORMAL_ARRAY - * @see #mgl_Color - * @see javax.media.opengl.sub.fixed.GLPointerIf#GL_COLOR_ARRAY - * @see #mgl_MultiTexCoord - * @see javax.media.opengl.sub.fixed.GLPointerIf#GL_TEXTURE_COORD_ARRAY - * @see javax.media.opengl.sub.fixed.GLPointerIf#glEnableClientState - * @see javax.media.opengl.sub.fixed.GLPointerIf#glVertexPointer - * @see javax.media.opengl.sub.fixed.GLPointerIf#glColorPointer - * @see javax.media.opengl.sub.fixed.GLPointerIf#glNormalPointer - * @see javax.media.opengl.sub.fixed.GLPointerIf#glTexCoordPointer - */ - public static String getPredefinedArrayIndexName(int glArrayIndex) { - switch(glArrayIndex) { - case GLPointerIf.GL_VERTEX_ARRAY: - return mgl_Vertex; - case GLPointerIf.GL_NORMAL_ARRAY: - return mgl_Normal; - case GLPointerIf.GL_COLOR_ARRAY: - return mgl_Color; - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: - return mgl_MultiTexCoord; - } - return null; - } - - /** - * String name for - * @see javax.media.opengl.GL#GL_VERTEX_ARRAY - */ - public static final String mgl_Vertex = "mgl_Vertex"; - - /** - * String name for - * @see javax.media.opengl.GL#GL_NORMAL_ARRAY - */ - public static final String mgl_Normal = "mgl_Normal"; - - /** - * String name for - * @see javax.media.opengl.GL#GL_COLOR_ARRAY - */ - public static final String mgl_Color = "mgl_Color"; - - /** - * String name for - * @see javax.media.opengl.GL#GL_TEXTURE_COORD_ARRAY - */ - public static final String mgl_MultiTexCoord = "mgl_MultiTexCoord" ; - } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 54bf63dda..0d20f1a4d 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -36,7 +36,7 @@ package javax.media.opengl; -import javax.media.opengl.sub.fixed.*; +import javax.media.opengl.fixedfunc.*; import java.lang.reflect.*; import java.security.*; import com.sun.opengl.impl.*; @@ -235,7 +235,7 @@ public class GLProfile { } } - public static String getGLTypeName(int type) { + private static String getGLTypeName(int type) { switch (type) { case GL.GL_UNSIGNED_BYTE: return "GL_UNSIGNED_BYTE"; @@ -265,6 +265,20 @@ public class GLProfile { return null; } + private static String getGLArrayName(int array) { + switch(array) { + case GLPointerFunc.GL_VERTEX_ARRAY: + return "GL_VERTEX_ARRAY"; + case GLPointerFunc.GL_NORMAL_ARRAY: + return "GL_NORMAL_ARRAY"; + case GLPointerFunc.GL_COLOR_ARRAY: + return "GL_COLOR_ARRAY"; + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: + return "GL_TEXTURE_COORD_ARRAY"; + } + return null; + } + /** * General validation if type is a valid GL data type * for the current profile @@ -297,19 +311,19 @@ public class GLProfile { return false; } - public static boolean isValidateArrayDataType(int index, int comps, int type, - boolean isVertexAttribPointer, boolean throwException) { - String indexName = GLContext.getPredefinedArrayIndexName(index); + public static boolean isValidArrayDataType(int index, int comps, int type, + boolean isVertexAttribPointer, boolean throwException) { + String arrayName = getGLArrayName(index); if(GLProfile.isGLES1()) { if(isVertexAttribPointer) { if(throwException) { - throw new GLException("Illegal array type for "+indexName+" on profile GLES1: VertexAttribPointer"); + throw new GLException("Illegal array type for "+arrayName+" on profile GLES1: VertexAttribPointer"); } return false; } switch(index) { - case GLPointerIf.GL_VERTEX_ARRAY: - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: + case GLPointerFunc.GL_VERTEX_ARRAY: + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: switch(type) { case GL.GL_BYTE: case GL.GL_SHORT: @@ -318,7 +332,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES1: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type); } return false; } @@ -330,12 +344,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } break; - case GLPointerIf.GL_NORMAL_ARRAY: + case GLPointerFunc.GL_NORMAL_ARRAY: switch(type) { case GL.GL_BYTE: case GL.GL_SHORT: @@ -344,7 +358,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES1: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type); } return false; } @@ -354,12 +368,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } break; - case GLPointerIf.GL_COLOR_ARRAY: + case GLPointerFunc.GL_COLOR_ARRAY: switch(type) { case GL.GL_UNSIGNED_BYTE: case GL.GL_FIXED: @@ -367,7 +381,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES1: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type); } return false; } @@ -377,7 +391,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } @@ -396,7 +410,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GLES2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GLES2: "+type); } return false; } @@ -409,7 +423,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } @@ -427,7 +441,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -440,13 +454,13 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } } else { switch(index) { - case GLPointerIf.GL_VERTEX_ARRAY: + case GLPointerFunc.GL_VERTEX_ARRAY: switch(type) { case GL.GL_SHORT: case GL.GL_FLOAT: @@ -455,7 +469,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -467,12 +481,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } break; - case GLPointerIf.GL_NORMAL_ARRAY: + case GLPointerFunc.GL_NORMAL_ARRAY: switch(type) { case GL.GL_BYTE: case GL.GL_SHORT: @@ -482,7 +496,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -492,12 +506,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GLES1: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps); } return false; } break; - case GLPointerIf.GL_COLOR_ARRAY: + case GLPointerFunc.GL_COLOR_ARRAY: switch(type) { case GL.GL_UNSIGNED_BYTE: case GL.GL_BYTE: @@ -510,7 +524,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -521,12 +535,12 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } break; - case GLPointerIf.GL_TEXTURE_COORD_ARRAY: + case GLPointerFunc.GL_TEXTURE_COORD_ARRAY: switch(type) { case GL.GL_SHORT: case GL.GL_FLOAT: @@ -535,7 +549,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal data type for "+indexName+" on profile GL2: "+type); + throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type); } return false; } @@ -548,7 +562,7 @@ public class GLProfile { break; default: if(throwException) { - throw new GLException("Illegal component number for "+indexName+" on profile GL2: "+comps); + throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps); } return false; } @@ -558,5 +572,4 @@ public class GLProfile { } return true; } - } diff --git a/src/jogl/classes/javax/media/opengl/sub/fixed/GLLightingIf.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java index 1f3aa9ab7..5563ea9c8 100644 --- a/src/jogl/classes/javax/media/opengl/sub/fixed/GLLightingIf.java +++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java @@ -2,14 +2,13 @@ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. */ -package javax.media.opengl.sub.fixed; +package javax.media.opengl.fixedfunc; import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.sub.*; -public interface GLLightingIf { +public interface GLLightingFunc { public static final int GL_LIGHT0 = 0x4000; public static final int GL_LIGHT1 = 0x4001; public static final int GL_LIGHT2 = 0x4002; diff --git a/src/jogl/classes/javax/media/opengl/sub/fixed/GLMatrixIf.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java index 834731b98..61757abde 100644 --- a/src/jogl/classes/javax/media/opengl/sub/fixed/GLMatrixIf.java +++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java @@ -2,14 +2,13 @@ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. */ -package javax.media.opengl.sub.fixed; +package javax.media.opengl.fixedfunc; import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.sub.*; -public interface GLMatrixIf { +public interface GLMatrixFunc { public static final int GL_MATRIX_MODE = 0x0BA0; public static final int GL_MODELVIEW = 0x1700; diff --git a/src/jogl/classes/javax/media/opengl/sub/fixed/GLPointerIf.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java index 2f4cda1aa..ed7bef5d4 100644 --- a/src/jogl/classes/javax/media/opengl/sub/fixed/GLPointerIf.java +++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java @@ -2,14 +2,13 @@ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. */ -package javax.media.opengl.sub.fixed; +package javax.media.opengl.fixedfunc; import java.nio.*; import javax.media.opengl.*; -import javax.media.opengl.sub.*; -public interface GLPointerIf { +public interface GLPointerFunc { public static final int GL_VERTEX_ARRAY = 0x8074; public static final int GL_NORMAL_ARRAY = 0x8075; public static final int GL_COLOR_ARRAY = 0x8076; diff --git a/src/jogl/classes/javax/media/opengl/sub/GLObject.java b/src/jogl/classes/javax/media/opengl/sub/GLObject.java deleted file mode 100644 index 1426f75d1..000000000 --- a/src/jogl/classes/javax/media/opengl/sub/GLObject.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. - */ - -package javax.media.opengl.sub; - -import java.nio.*; - -import javax.media.opengl.*; - -/** - * GLObject specifies the GL profile related implementations - * and it's composition with GLContext, which is a lifetime one. - */ -public interface GLObject { - - public boolean isGL(); - - public boolean isGL2(); - - public boolean isGLES1(); - - public boolean isGLES2(); - - public boolean isGLES(); - - public boolean isGL2ES1(); - - public boolean isGL2ES2(); - - /** - * @return This object cast to GL - * @throws GLException is this GLObject is not a GL implementation - */ - public GL getGL() throws GLException; - - /** - * @return This object cast to GL2 - * @throws GLException is this GLObject is not a GL2 implementation - */ - public GL2 getGL2() throws GLException; - - /** - * @return This object cast to GLES1 - * @throws GLException is this GLObject is not a GLES1 implementation - */ - public GLES1 getGLES1() throws GLException; - - /** - * @return This object cast to GLES2 - * @throws GLException is this GLObject is not a GLES2 implementation - */ - public GLES2 getGLES2() throws GLException; - - /** - * @return This object cast to GL2ES1 - * @throws GLException is this GLObject is not a GL2ES1 implementation - */ - public GL2ES1 getGL2ES1() throws GLException; - - /** - * @return This object cast to GL2ES2 - * @throws GLException is this GLObject is not a GL2ES2 implementation - */ - public GL2ES2 getGL2ES2() throws GLException; - - public String toString(); - - /** - * @return This GL object's bound GLContext - */ - public GLContext getContext(); - -} - diff --git a/src/jogl/classes/javax/media/opengl/sub/fixed/GLFixedFuncUtil.java b/src/jogl/classes/javax/media/opengl/sub/fixed/GLFixedFuncUtil.java deleted file mode 100644 index 4f6688879..000000000 --- a/src/jogl/classes/javax/media/opengl/sub/fixed/GLFixedFuncUtil.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. - */ - -package javax.media.opengl.sub.fixed; - -import javax.media.opengl.*; -import javax.media.opengl.sub.*; - -import com.sun.nativewindow.impl.NWReflection; -import java.lang.reflect.*; - -/** - * Tool to pipeline GL2ES2 into a fixed function emulation, - * implementing GL2ES1. - * The implementation is retrieved by reflection. - */ -public class GLFixedFuncUtil { - static final Constructor fFuncHookCstr; - static final Constructor fFuncImplCstr; - - static { - if(NWReflection.isClassAvailable("com.sun.opengl.util.glsl.fixed.FixedFuncHook") && - NWReflection.isClassAvailable("com.sun.opengl.util.glsl.fixed.FixedFuncImpl")) { - Class argsHook[] = { javax.media.opengl.GL2ES2.class }; - Class argsImpl[] = { javax.media.opengl.GL2ES2.class, NWReflection.getClass("com.sun.opengl.util.glsl.fixed.FixedFuncHook") }; - fFuncHookCstr = NWReflection.getConstructor("com.sun.opengl.util.glsl.fixed.FixedFuncHook", argsHook); - fFuncImplCstr = NWReflection.getConstructor("com.sun.opengl.util.glsl.fixed.FixedFuncImpl", argsImpl); - } else { - fFuncHookCstr=null; - fFuncImplCstr=null; - } - } - - /** - * @return If gl is a GL2ES1, return the type cast object, - * otherwise create a FixedFuncImpl pipeline with the GL2ES2 impl. - * @throws GLException If this GL Object is neither GL2ES1 nor GL2ES2 - */ - public static final GL2ES1 getFixedFuncImpl(GL gl) { - if(gl instanceof GL2ES1) { - return (GL2ES1)gl; - } else if(gl instanceof GL2ES2) { - if(null!=fFuncImplCstr) { - try { - GL2ES2 es2 = (GL2ES2)gl; - Object fFuncHook = fFuncHookCstr.newInstance( new Object[] { es2 } ); - GL2ES1 fFuncImpl = (GL2ES1) fFuncImplCstr.newInstance( new Object[] { es2, fFuncHook } ); - gl.getContext().setGL(fFuncImpl); - return fFuncImpl; - } catch (Exception e) { - throw new GLException(e); - } - } else { - throw new GLException("GL Object is GL2ES2, but no fixed function impl. available"); - } - } - throw new GLException("GL Object is neither GL2ES1 nor GL2ES2"); - } -} - diff --git a/src/jogl/classes/javax/media/opengl/util/FixedPoint.java b/src/jogl/classes/javax/media/opengl/util/FixedPoint.java deleted file mode 100644 index 35e2aaaf4..000000000 --- a/src/jogl/classes/javax/media/opengl/util/FixedPoint.java +++ /dev/null @@ -1,29 +0,0 @@ - -package javax.media.opengl.util; - -public class FixedPoint { - public static final int toFixed(int value) { - if (value < -32768) value = -32768; - if (value > 32767) value = 32767; - return value * 65536; - } - - public static final int toFixed(float value) { - if (value < -32768) value = -32768; - if (value > 32767) value = 32767; - return (int)(value * 65536.0f); - } - - public static final float toFloat(int value) { - return (float)value/65536.0f; - } - - public static final int mult(int x1, int x2) { - return (int) ( ((long)x1*(long)x2)/65536 ); - } - - public static final int div(int x1, int x2) { - return (int) ( (((long)x1)<<16)/x2 ); - } -} - diff --git a/src/jogl/native/InternalBufferUtils.c b/src/jogl/native/GLXGetProcAddressARB.c index 4b2001a34..6e9f6c3c2 100644 --- a/src/jogl/native/InternalBufferUtils.c +++ b/src/jogl/native/GLXGetProcAddressARB.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -37,31 +37,6 @@ * and developed by Kenneth Bradley Russell and Christopher John Kline. */ -#include <jni.h> - -#ifdef _WIN32 - #ifdef _MSC_VER - /* This typedef is apparently needed for Microsoft compilers before VC8, - and on Windows CE */ - #if (_MSC_VER < 1400) || defined(UNDER_CE) - #ifdef _WIN64 - typedef long long intptr_t; - #else - typedef int intptr_t; - #endif - #endif - #else - #include <inttypes.h> - #endif -#else - #include <inttypes.h> -#endif - -JNIEXPORT jobject JNICALL -Java_com_sun_opengl_impl_InternalBufferUtils_newDirectByteBuffer(JNIEnv* env, jclass unused, jlong address, jint capacity) { - return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) address, capacity); -} - #if defined(__sun) || defined(_HPUX) #include <dlfcn.h> |