Bladeren bron

move jme3 to trunk

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@6971 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 jaren geleden
commit
9e53abbb7a
100 gewijzigde bestanden met toevoegingen van 9084 en 0 verwijderingen
  1. 42 0
      engine/.classpath
  2. 17 0
      engine/.project
  3. 1 0
      engine/MANIFEST.MF
  4. BIN
      engine/TestChooser.exe
  5. 53 0
      engine/build-android.xml
  6. 223 0
      engine/build.xml
  7. BIN
      engine/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
  8. BIN
      engine/lib/JWSAntTasks/org-netbeans-modules-javawebstart-anttasks.jar
  9. BIN
      engine/lib/android/android.jar
  10. BIN
      engine/lib/antlibs/jsch-0.1.42.jar
  11. BIN
      engine/lib/jbullet/asm-all-3.1.jar
  12. BIN
      engine/lib/jbullet/jbullet.jar
  13. BIN
      engine/lib/jbullet/stack-alloc.jar
  14. BIN
      engine/lib/jbullet/vecmath.jar
  15. 23 0
      engine/lib/jheora/LICENSE.jheora
  16. BIN
      engine/lib/jheora/cortado-0.6.0.tar.gz
  17. BIN
      engine/lib/jheora/jheora-debug-0.6.0.jar
  18. BIN
      engine/lib/jheora/jheora-jst-debug-0.6.0.jar
  19. BIN
      engine/lib/jogg/j-ogg-oggd.jar
  20. BIN
      engine/lib/jogg/j-ogg-vorbisd.jar
  21. 101 0
      engine/lib/jogl/CHANGELOG.txt
  22. 31 0
      engine/lib/jogl/COPYRIGHT.txt
  23. 152 0
      engine/lib/jogl/LICENSE-JOGL-1.1.1.txt
  24. 45 0
      engine/lib/jogl/README.txt
  25. 999 0
      engine/lib/jogl/Userguide.html
  26. BIN
      engine/lib/jogl/gluegen-rt.jar
  27. BIN
      engine/lib/jogl/jME3-jogl-natives.jar
  28. BIN
      engine/lib/jogl/jogl.jar
  29. BIN
      engine/lib/jogl/macosx_ppc/libgluegen-rt.jnilib
  30. BIN
      engine/lib/jogl/macosx_ppc/libjogl.jnilib
  31. BIN
      engine/lib/jogl/macosx_ppc/libjogl_awt.jnilib
  32. BIN
      engine/lib/jogl/macosx_ppc/libjogl_cg.jnilib
  33. BIN
      engine/lib/jogl/macosx_universal/libgluegen-rt.jnilib
  34. BIN
      engine/lib/jogl/macosx_universal/libjogl.jnilib
  35. BIN
      engine/lib/jogl/macosx_universal/libjogl_awt.jnilib
  36. BIN
      engine/lib/jogl/macosx_universal/libjogl_cg.jnilib
  37. BIN
      engine/lib/jogl/win32/gluegen-rt.dll
  38. BIN
      engine/lib/jogl/win32/jogl.dll
  39. BIN
      engine/lib/jogl/win32/jogl_awt.dll
  40. BIN
      engine/lib/jogl/win32/jogl_cg.dll
  41. BIN
      engine/lib/jogl/win64/gluegen-rt.dll
  42. BIN
      engine/lib/jogl/win64/jogl.dll
  43. BIN
      engine/lib/jogl/win64/jogl_awt.dll
  44. BIN
      engine/lib/jogl/win64/jogl_cg.dll
  45. BIN
      engine/lib/jogl2/gluegen-rt.jar
  46. BIN
      engine/lib/jogl2/jogl.all.jar
  47. BIN
      engine/lib/jogl2/linux32/libgluegen-rt.so
  48. BIN
      engine/lib/jogl2/linux32/libjogl_desktop.so
  49. BIN
      engine/lib/jogl2/linux32/libnativewindow_awt.so
  50. BIN
      engine/lib/jogl2/linux32/libnativewindow_x11.so
  51. BIN
      engine/lib/jogl2/linux32/libnewt.so
  52. BIN
      engine/lib/jogl2/nativewindow.all.jar
  53. BIN
      engine/lib/jogl2/nativewindow.os.x11.jar
  54. BIN
      engine/lib/jogl2/newt.all.jar
  55. BIN
      engine/lib/jogl2/newt.os.x11.jar
  56. BIN
      engine/lib/junit_4/junit-4.5-api.zip
  57. BIN
      engine/lib/junit_4/junit-4.5-src.jar
  58. BIN
      engine/lib/junit_4/junit-4.5.jar
  59. 32 0
      engine/lib/lwjgl/3rdparty/jinput_license.txt
  60. 152 0
      engine/lib/lwjgl/3rdparty/jogl_license.txt
  61. 15 0
      engine/lib/lwjgl/3rdparty/lzma_license.txt
  62. 437 0
      engine/lib/lwjgl/3rdparty/openal_license.txt
  63. 36 0
      engine/lib/lwjgl/CREDITS
  64. 31 0
      engine/lib/lwjgl/LICENSE
  65. 50 0
      engine/lib/lwjgl/README
  66. BIN
      engine/lib/lwjgl/jME3-lwjgl-natives.jar
  67. BIN
      engine/lib/lwjgl/jinput.jar
  68. BIN
      engine/lib/lwjgl/lwjgl-debug.jar
  69. BIN
      engine/lib/lwjgl/lwjgl.jar
  70. 25 0
      engine/lib/lwjgl/lwjgl_hidden_switches.text
  71. 55 0
      engine/lib/nblibraries.properties
  72. BIN
      engine/lib/niftygui/eventbus-1.4.jar
  73. BIN
      engine/lib/niftygui/nifty-1.3-SNAPSHOT.jar
  74. BIN
      engine/lib/niftygui/nifty-default-controls-1.3-SNAPSHOT.jar
  75. BIN
      engine/lib/niftygui/nifty-examples-1.3-SNAPSHOT.jar
  76. BIN
      engine/lib/niftygui/nifty-style-black-1.3-SNAPSHOT.jar
  77. BIN
      engine/lib/niftygui/nifty-style-grey-1.0.jar
  78. BIN
      engine/lib/niftygui/xmlpull-xpp3-1.1.4c.jar
  79. BIN
      engine/lib/swing-layout/swing-layout-1.0.4-doc.zip
  80. BIN
      engine/lib/swing-layout/swing-layout-1.0.4-src.zip
  81. BIN
      engine/lib/swing-layout/swing-layout-1.0.4.jar
  82. BIN
      engine/lib/swingext/swing-layout-1.0.3.jar
  83. 26 0
      engine/master-application.jnlp
  84. 1082 0
      engine/nbproject/build-impl.xml
  85. 4 0
      engine/nbproject/configs/JWS_generated.properties
  86. 11 0
      engine/nbproject/genfiles.properties
  87. 414 0
      engine/nbproject/jnlp-impl.xml
  88. 131 0
      engine/nbproject/profiler-build-impl.xml
  89. 107 0
      engine/nbproject/project.properties
  90. 42 0
      engine/nbproject/project.xml
  91. 17 0
      engine/preview-application.html
  92. BIN
      engine/quake3level.zip
  93. 20 0
      engine/src/android/com/jme3/R.java
  94. 72 0
      engine/src/android/com/jme3/app/AndroidHarness.java
  95. 20 0
      engine/src/android/com/jme3/app/R.java
  96. 269 0
      engine/src/android/com/jme3/asset/AndroidAssetManager.java
  97. 62 0
      engine/src/android/com/jme3/asset/plugins/AndroidLocator.java
  98. 448 0
      engine/src/android/com/jme3/input/android/AndroidInput.java
  99. 991 0
      engine/src/android/com/jme3/renderer/android/OGLESRenderer.java
  100. 2848 0
      engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java

+ 42 - 0
engine/.classpath

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/core"/>
+	<classpathentry kind="src" path="src/core-data"/>
+	<classpathentry kind="src" path="src/core-plugins"/>
+	<classpathentry kind="src" path="src/desktop"/>
+	<classpathentry kind="src" path="src/desktop-fx"/>
+	<classpathentry kind="src" path="src/games"/>
+	<classpathentry kind="src" path="src/jbullet"/>
+	<classpathentry kind="src" path="src/jogg"/>
+	<classpathentry kind="src" path="src/lwjgl-oal"/>
+	<classpathentry kind="src" path="src/lwjgl-ogl"/>
+	<classpathentry kind="src" path="src/niftygui"/>
+	<classpathentry kind="src" path="src/ogre"/>
+	<classpathentry kind="src" path="src/pack"/>
+	<classpathentry kind="src" path="src/test"/>
+	<classpathentry kind="src" path="src/test-data"/>
+	<classpathentry kind="src" path="src/tools"/>
+	<classpathentry kind="src" path="src/xml"/>
+	<classpathentry kind="src" path="src/terrain"/>
+	<classpathentry kind="src" path="src/networking"/>
+	<classpathentry kind="lib" path="lib/jbullet/asm-all-3.1.jar"/>
+	<classpathentry kind="lib" path="lib/jbullet/jbullet.jar"/>
+	<classpathentry kind="lib" path="lib/jbullet/stack-alloc.jar"/>
+	<classpathentry kind="lib" path="lib/jbullet/vecmath.jar"/>
+	<classpathentry kind="lib" path="lib/jogg/j-ogg-oggd.jar"/>
+	<classpathentry kind="lib" path="lib/jogg/j-ogg-vorbisd.jar"/>
+	<classpathentry kind="lib" path="lib/jogl/jME3-jogl-natives.jar"/>
+	<classpathentry kind="lib" path="lib/swing-layout/swing-layout-1.0.4.jar"/>
+	<classpathentry kind="lib" path="lib/swingext/swing-layout-1.0.3.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="lib/lwjgl/jinput.jar"/>
+	<classpathentry kind="lib" path="lib/lwjgl/lwjgl.jar"/>
+	<classpathentry kind="lib" path="lib/lwjgl/jME3-lwjgl-natives.jar"/>
+	<classpathentry kind="lib" path="lib/niftygui/nifty-1.3-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/niftygui/nifty-default-controls-1.3-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/niftygui/nifty-style-black-1.3-SNAPSHOT.jar"/>
+        <classpathentry kind="lib" path="lib/niftygui/eventbus-1.4.jar"/>
+	<classpathentry kind="lib" path="lib/niftygui/nifty-examples-1.3-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/niftygui/xmlpull-xpp3-1.1.4c.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 17 - 0
engine/.project

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>jme3</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 1 - 0
engine/MANIFEST.MF

@@ -0,0 +1 @@
+X-Comment: jMonkeyEngine 3.0

BIN
engine/TestChooser.exe


+ 53 - 0
engine/build-android.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  -
+  - ant build file for jMonkeyEngine Android Renderer
+  -
+  - author: Anton Yudin
+  - created: Sun Nov  7 22:38:27 EST 2010
+  -
+-->
+
+<project name="jMonkeyEngine Android Renderer" default="dist" basedir=".">
+
+
+	<path id="classpath">
+		<pathelement path="lib/android/android.jar"/>
+		<pathelement path="dist/jMonkeyEngine3.jar"/>
+	</path>
+
+	<target name="initialize">
+		<mkdir dir="build/android"/>
+	</target>
+
+	<target name="compile" depends="initialize">
+		<javac
+			target="1.6"
+			encoding="UTF-8"
+			debug="true"
+			deprecation="on"
+			srcdir="src/android"
+			destdir="build/android"
+			classpathref="classpath"
+			excludes="**/OGLESRenderer.java,**/TestsActivity.java,**/AboutActivity.java"
+		/>
+	</target>
+
+	<target name="dist" depends="compile">
+		<jar
+			jarfile="build/jmonkeyengine3-android-renderer.jar"
+			basedir="build/android"
+		/>
+		<jar
+			jarfile="build/jmonkeyengine3-android-tests.jar"
+			basedir="build/testclasses"
+		/>
+		<jar
+			jarfile="build/jmonkeyengine3-android-dist.jar"
+			basedir="build/classes"
+			excludes="com/jme3/system/JmeSystem*"
+		/>
+	</target>
+
+</project>

+ 223 - 0
engine/build.xml

@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="jME3_ordered" default="default" basedir=".">
+    <description>Builds, tests, and runs the project jME3_ordered.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <import file="nbproject/profiler-build-impl.xml"/>
+
+
+    <!--this target creates the assets jar file and modifies the classpath to include it-->
+    <target name="-pre-jar">
+        <!--separate test classes-->
+        <mkdir dir="build/testclasses/"/>
+        <move file="build/classes/jme3test" todir="build/testclasses/" failonerror="false"/>
+        <move file="build/classes/jme3game" todir="build/testclasses/" failonerror="false"/>
+        <jar jarfile="build/jme3test.jar" basedir="build/testclasses/" compress="true"/>
+
+        <!--create jar from assets-->
+        <jar jarfile="build/jme3testdata.jar" basedir="src/test-data" compress="true"/>
+        <!--resolve assets and assets jar location-->
+        <property location="src/test-data" name="testdata.dir.resolved"/>
+        <property location="build/jme3testdata.jar" name="testdata.jar.resolved"/>
+        <!--this sets properties that would normally later be created in the build-impl.xml-->
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <pathconvert property="run.classpath.without.build.classes.dir">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to=""/>
+            <!--replace assets folder in dist classpath-->
+            <map from="${testdata.dir.resolved}" to="${testdata.jar.resolved}"/>
+            <!--add tests jar to dist classpath-->
+            <path path="build/jme3test.jar"/>
+        </pathconvert>
+    </target>
+
+    <!-- puts jme3 jars, libs, source and javadoc in a dated zip file -->
+    <target name="dist" depends="clean, jar, javadoc">
+        <!-- create date in the format MM-dd-yyyy -->
+        <tstamp>
+            <format property="date" pattern="yyyy-MM-dd" locale="en,US"/>
+        </tstamp>
+        <property name="jme3zip" value="jME3_${date}.zip"/>
+
+        <!-- make zip file -->
+        <zip destfile="${jme3zip}">
+            <fileset dir=".">
+                <include name="TestChooser.exe"/>
+                <include name="README.TXT"/>
+            </fileset>
+            <fileset dir="dist/">
+                <include name="jMonkeyEngine3.jar"/>
+            </fileset>
+            <zipfileset dir="dist/lib" prefix="lib"/>
+            <zipfileset dir="dist/javadoc" prefix="javadoc"/>
+            <zipfileset dir="${src.core.dir}" prefix="source"/>
+            <zipfileset dir="${src.core-data.dir}" prefix="source"/>
+            <zipfileset dir="${src.core-plugins.dir}" prefix="source"/>
+            <zipfileset dir="${src.desktop.dir}" prefix="source"/>
+            <zipfileset dir="${src.desktop-fx.dir}" prefix="source"/>
+            <zipfileset dir="${src.games.dir}" prefix="source"/>
+            <zipfileset dir="${src.jbullet.dir}" prefix="source"/>
+            <zipfileset dir="${src.niftygui.dir}" prefix="source"/>
+            <zipfileset dir="${src.jogg.dir}" prefix="source"/>
+            <zipfileset dir="${src.lwjgl-oal.dir}" prefix="source"/>
+            <zipfileset dir="${src.lwjgl-ogl.dir}" prefix="source"/>
+            <zipfileset dir="${src.ogre.dir}" prefix="source"/>
+            <zipfileset dir="${src.pack.dir}" prefix="source"/>
+            <zipfileset dir="${src.jheora.dir}" prefix="source"/>
+            <zipfileset dir="${src.test.dir}" prefix="source"/>
+            <zipfileset dir="${src.tools.dir}" prefix="source"/>
+            <zipfileset dir="${src.xml.dir}" prefix="source"/>
+            <zipfileset dir="${src.terrain.dir}" prefix="source"/>
+            <zipfileset dir="${src.networking.dir}" prefix="source"/>
+        </zip>
+    </target>
+    
+    <!-- convenience target to transfer jme3 libraries to jme3-gde (jMonkeyPlatform) -->
+    <target name="update-gde" depends="jar, javadoc">
+        <antcall target="-do-update-gde" inheritall="true">
+            <param name="jmp_dir" value="../jme3-gde/"/>
+        </antcall>
+    </target>
+
+    <!-- convenience target to transfer jme3 libraries to the jme3-jmp folder on the Hudson build server (jMonkeyPlatform) -->
+    <target name="update-jmp-hudson">
+        <!--update jme3 svn revision info properly-->
+        <exec executable="svn" dir=".">
+            <arg value="update" />
+        </exec>
+        <!--update jmp-->
+        <antcall target="-do-update-gde" inheritall="true">
+            <param name="jmp_dir" value="../../jme3-jmp/workspace/"/>
+        </antcall>
+        <!--antcall target="-create-jme3-svn-properties" inheritall="true">
+            <param name="jmp_dir" value="../../jme3-jmp/workspace/"/>
+        </antcall-->
+    </target>
+
+    <target name="-do-update-gde">
+        <!--clear old files-->
+        <delete dir="${jmp_dir}/JME3TestsTemplate/src/"/>
+        <delete dir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/"/>
+        <delete dir="${jmp_dir}/jme3-core-libraries/release/modules/ext/"/>
+        <delete dir="${jmp_dir}/jme3-project-libraries/release/libs/"/>
+        <delete dir="${jmp_dir}/jme3-project-baselibs/release/libs/"/>
+        <delete dir="${jmp_dir}/jme3-project-testdata/release/libs/"/>
+
+        <!--jme3 base libs-->
+        <copy file="${dist.jar}" toDir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/" overwrite="true" failonerror="true" verbose="true"/>
+        <copy file="dist/lib/jME3-lwjgl-natives.jar" toDir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/" overwrite="true" failonerror="true" verbose="true"/>
+<!--        <copy file="dist/lib/jME3-jogl-natives.jar" toDir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/" overwrite="true" failonerror="true" verbose="true"/>-->
+<!--        <copy file="dist/lib/jME3-natives-joal.jar" toDir="${jmp_dir}/jme3-core-baselibs/release/modules/ext/" overwrite="true" failonerror="true" verbose="true"/>-->
+
+        <copy file="${dist.jar}" toDir="${jmp_dir}/jme3-project-baselibs/release/libs/" overwrite="true" failonerror="true" verbose="true"/>
+
+        <!--jme3 libraries-->
+        <copy todir="${jmp_dir}/jme3-core-libraries/release/modules/ext/" overwrite="true" failonerror="true" verbose="true">
+            <!--exclude jme3 test data from core-->
+            <fileset dir="dist/lib/">
+                <exclude name="jme3testdata.jar"/>
+                <exclude name="jme3test.jar"/>
+                <exclude name="jME3-lwjgl-natives.jar"/>
+                <exclude name="jME3-jogl-natives.jar"/>
+                <exclude name="jME3-natives-joal.jar"/>
+            </fileset>
+        </copy>
+        <copy todir="${jmp_dir}/jme3-project-libraries/release/libs/" overwrite="true" failonerror="true" verbose="true">
+            <!--exclude jme3 test data from libs-->
+            <fileset dir="dist/lib/">
+                <exclude name="jme3testdata.jar"/>
+                <exclude name="jme3test.jar"/>
+            </fileset>
+        </copy>
+
+        <!--test data-->
+        <copy file="dist/lib/jme3testdata.jar" toDir="${jmp_dir}/jme3-project-testdata/release/libs/" overwrite="true" failonerror="true" verbose="true"/>
+
+        <!--javadoc-->
+        <zip destfile="dist/jMonkeyEngine3-javadoc.zip">
+            <zipfileset dir="dist/javadoc/"/>
+        </zip>
+        <copy file="dist/jMonkeyEngine3-javadoc.zip" toDir="${jmp_dir}/jme3-project-baselibs/release/libs/" overwrite="true" failonerror="true" verbose="true"/>
+
+        <!--sources-->
+        <zip destfile="dist/jMonkeyEngine3-sources.zip">
+            <zipfileset dir="${src.core.dir}"/>
+            <zipfileset dir="${src.core-data.dir}"/>
+            <zipfileset dir="${src.core-plugins.dir}"/>
+            <zipfileset dir="${src.desktop.dir}"/>
+            <zipfileset dir="${src.desktop-fx.dir}"/>
+            <zipfileset dir="${src.games.dir}"/>
+            <zipfileset dir="${src.jbullet.dir}"/>
+            <zipfileset dir="${src.niftygui.dir}"/>
+            <zipfileset dir="${src.jogg.dir}"/>
+            <zipfileset dir="${src.lwjgl-oal.dir}"/>
+            <zipfileset dir="${src.lwjgl-ogl.dir}"/>
+            <zipfileset dir="${src.ogre.dir}"/>
+            <zipfileset dir="${src.pack.dir}"/>
+            <zipfileset dir="${src.jheora.dir}"/>
+            <zipfileset dir="${src.test.dir}"/>
+            <zipfileset dir="${src.tools.dir}"/>
+            <zipfileset dir="${src.xml.dir}"/>
+            <zipfileset dir="${src.terrain.dir}"/>
+            <zipfileset dir="${src.networking.dir}"/>
+        </zip>
+        <copy file="dist/jMonkeyEngine3-sources.zip" toDir="${jmp_dir}/jme3-project-baselibs/release/libs/" overwrite="true" failonerror="true" verbose="true"/>
+        
+        <!--examples-->
+        <copy todir="${jmp_dir}/JME3TestsTemplate/src/" overwrite="true" failonerror="true" verbose="true">
+            <fileset dir="src/test/">
+                <exclude name=".svn"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <!--creates properties files containing svn info for the jme3 folders in jMP-->
+    <target name="-create-jme3-svn-properties">
+        <mkdir dir="${jmp_dir}/build"/>
+        <!--update jme3 svn revision-->
+        <exec executable="svn" dir=".">
+            <arg value="update" />
+        </exec>
+        <!--jme3 svn properties-->
+        <exec executable="svn" dir="." output="${jmp_dir}/build/jme3-svn.properties">
+            <arg value="info" />
+        </exec>
+        <replace file="${jmp_dir}/build/jme3-svn.properties" token=" " value=""/>
+        <!--jme3 test data svn properties-->
+        <exec executable="svn" dir="src/test-data/" output="${jmp_dir}/build/jme3-testdata-svn.properties">
+            <arg value="info" />
+        </exec>
+        <replace file="${jmp_dir}/build/jme3-testdata-svn.properties" token=" " value=""/>
+        <!--jme3 libraries svn properties-->
+        <exec executable="svn" dir="lib/" output="${jmp_dir}/build/jme3-lib-svn.properties">
+            <arg value="info" />
+        </exec>
+        <replace file="${jmp_dir}/build/jme3-lib-svn.properties" token=" " value=""/>
+        <!--jme3 tests svn properties-->
+        <exec executable="svn" dir="src/test/" output="${jmp_dir}/build/jme3-tests-svn.properties">
+            <arg value="info" />
+        </exec>
+        <replace file="${jmp_dir}/build/jme3-tests-svn.properties" token=" " value=""/>
+    </target>
+
+    <!-- upload jme3 zip to jmonkeyengine.com/nightly -->
+    <target name="deploy" depends="dist">
+        <scp todir="${sshpath}:/var/www/nightly" verbose="yes" trust="yes">
+            <fileset dir=".">
+                <include name="${jme3zip}"/>
+            </fileset>
+        </scp>
+    </target>
+
+    <!-- upload jme3 zip to jmonkeyengine.com/nightly -->
+    <target name="deploy-hudson" depends="dist">
+        <copy
+            file="${jme3zip}"
+            toDir="/var/www/nightly" overwrite="true" failonerror="true" verbose="true"
+            />
+        <copydir
+            src="dist/javadoc/" dest="/var/wwworg/javadoc/" forceoverwrite="true"
+            />
+    </target>
+
+</project>

BIN
engine/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar


BIN
engine/lib/JWSAntTasks/org-netbeans-modules-javawebstart-anttasks.jar


BIN
engine/lib/android/android.jar


BIN
engine/lib/antlibs/jsch-0.1.42.jar


BIN
engine/lib/jbullet/asm-all-3.1.jar


BIN
engine/lib/jbullet/jbullet.jar


BIN
engine/lib/jbullet/stack-alloc.jar


BIN
engine/lib/jbullet/vecmath.jar


+ 23 - 0
engine/lib/jheora/LICENSE.jheora

@@ -0,0 +1,23 @@
+/* Jheora
+ * Copyright (C) 2004 Fluendo S.L.
+ *  
+ * Written by: 2004 Wim Taymans <[email protected]>
+ *   
+ * Many thanks to 
+ *   The Xiph.Org Foundation http://www.xiph.org/
+ * Jheora was based on their Theora reference decoder.
+ *   
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License
+ * as published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */

BIN
engine/lib/jheora/cortado-0.6.0.tar.gz


BIN
engine/lib/jheora/jheora-debug-0.6.0.jar


BIN
engine/lib/jheora/jheora-jst-debug-0.6.0.jar


BIN
engine/lib/jogg/j-ogg-oggd.jar


BIN
engine/lib/jogg/j-ogg-vorbisd.jar


+ 101 - 0
engine/lib/jogl/CHANGELOG.txt

@@ -0,0 +1,101 @@
+Changes between JOGL 1.1.0 and 1.1.1:
+
+ - Fixed a bug in the checking of incoming buffers' sizes to
+   glTexImage1D, glTexImage2D, and glTexImage3D.
+
+Changes between JOGL 1.0.0 and 1.1.0:
+
+ - The glext.h and associated header files JOGL uses have been updated
+   to OpenGL 2.1 with NVidia's GeForce 8 series extensions. The new
+   functions are available as methods in the GL interface.
+
+ - The developer build bundles have been changed to zip archives, so
+   instead of having to download multiple jars, you can now just
+   download the zip archive for your particular platform. The new zip
+   archives are versioned with the build date.
+
+ - The source distribution now contains the generated sources like
+   GL.java, GLU.java, etc. for more convenient use in IDEs.
+
+ - The chosen GLCapabilities are now exposed from the GLDrawable via
+   GLDrawable.getChosenGLCapabilities(); this functionality works on
+   all platforms even in cases where the GLCapabilitiesChooser is not
+   supported, and attempts to provide correct answers so programs can
+   make decisions based on the results.
+
+ - The native code for the "DRI hack" (to support the open-source DRI
+   drivers on Linux and other X11 platforms) has been removed; JOGL
+   now uses the GlueGen NativeLibrary class for this purpose.
+   Reliability improvements have been made to the implementation of
+   this class; it has been confirmed as working again with ATI's
+   proprietary drivers on Linux and should also work better with
+   NVidia's drivers.
+
+ - The GlueGen runtime classes have been removed from jogl.jar. These
+   have been factored out into gluegen-rt.jar and are referenced by
+   both the JOGL and JOAL projects.
+
+ - Thanks to John Burkey some optimizations have been made to the
+   buffer object-related validity checks in glVertexPointer, etc. as
+   well as a buffer size query that was being made in the glMapBuffer
+   implementation. This improves performance for applications
+   performing a lot of VBO- or vertex array-based rendering, in
+   particular with the multithreaded OpenGL implementation on Mac OS
+   X.
+
+ - The JOGL applet launcher now supports deployment of applets which
+   use both OpenGL for 3D graphics via JOGL as well as OpenAL for
+   spatialized audio via JOAL. It now prompts the user on Windows
+   platforms to allow it to enable the -Dsun.java2d.noddraw=true
+   system property for best robustness. It has been updated for the
+   changes in the GlueGen runtime classes and native library
+   structure. Some bugs have been fixed, some of which were preventing
+   different JOGL-based applets from being deployed from the same
+   codebase. The documentation and on-line examples have been updated
+   as well.
+
+ - The TextureIO implementation has been changed to no longer copy the
+   data associated with BufferedImage TextureData objects. Instead,
+   the necessary vertical flip is now implemented by flipping the
+   texture coordinates vertically.
+
+ - An API for updating a sub-image of a Texture object from a
+   sub-portion of a TextureData object has been added.
+
+ - A GLContext.copy() operation has been added based on community
+   feedback.
+
+ - Three helper classes have been added to the com.sun.opengl.util.j2d
+   package to improve interoperability between JOGL and Java 2D:
+   TextureRenderer, Overlay and TextRenderer. The TextureRenderer
+   supports drawing into an OpenGL texture using Java 2D. The Overlay
+   class provides a convenient Java 2D-based overlay on top of an
+   arbitrary GLDrawable. The TextRenderer class supports drawing of
+   Java 2D text into an OpenGL context. Thanks to Chris Campbell of
+   the Java 2D team for collaboration and to the JOGL community for
+   extensive feedback and testing assistance.
+
+ - Various bug fixes and robustness improvements were made to the
+   GlueGen runtime, JOGL and GLU implementations.
+
+ - Fixes to the DDSImage class were contributed by the community: a
+   bug fix to mipmap handling and support for cubemap textures. Thanks
+   to java.net user bandures.
+
+ - TextureIO.setTexRectEnabled() and isTexRectEnabled() were added
+   based on feedback from Chris Campbell, in order to simplify the
+   writing of pixel shaders which have different samplers for
+   GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE_ARB targets.
+
+ - Thanks to Erik Tollerud, the links to the OpenGL documentation in
+   the JOGL javadoc were revised to point to the new on-line man pages
+   in the OpenGL SDK.
+
+ - Support for automatic mipmap generation via GL_GENERATE_MIPMAP was
+   added to the TextureIO, TextureRenderer and TextRenderer classes.
+
+ - Windows/AMD64 binaries, including the JOGL Cg binding, are now
+   supplied.
+
+ - Worked around breakage of JOGL with 5.0u10; see Sun bug IDs 6504460
+   and 6333613.

+ 31 - 0
engine/lib/jogl/COPYRIGHT.txt

@@ -0,0 +1,31 @@
+
+Copyright 2007 Sun Microsystems, Inc., 4150 Network 
+Circle, Santa Clara, California 95054, U.S.A. All rights 
+reserved.
+
+U.S. Government Rights - Commercial software. Government 
+users are subject to the Sun Microsystems, Inc. 
+standard license agreement and applicable provisions of 
+the FAR and its supplements.
+
+Use is subject to license terms. 
+
+This distribution may include materials developed by third 
+parties.
+
+Sun, Sun Microsystems, the Sun logo and Java are trademarks 
+or registered trademarks of Sun Microsystems, Inc. in the 
+U.S. and other countries.
+
+OpenGL is a registered trademark of Silicon Graphics, Inc. 
+
+This product is covered and controlled by U.S. Export 
+Control laws and may be subject to the export or import 
+laws in other countries. Nuclear, missile, chemical 
+biological weapons or nuclear maritime end uses or end 
+users, whether direct or indirect, are strictly prohibited. 
+Export or reexport to countries subject to U.S. embargo or 
+to entities identified on U.S. export exclusion lists, 
+including, but not limited to, the denied persons and 
+specially designated nationals lists is strictly prohibited. 
+

+ 152 - 0
engine/lib/jogl/LICENSE-JOGL-1.1.1.txt

@@ -0,0 +1,152 @@
+JOGL is released under the BSD license. The full license terms follow:
+
+   Copyright (c) 2003-2007 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.
+   
+   You acknowledge that this software is not designed or intended for use
+   in the design, construction, operation or maintenance of any nuclear
+   facility.
+
+The JOGL source tree contains code ported from the OpenGL sample
+implementation by Silicon Graphics, Inc. This code is licensed under
+the SGI Free Software License B (Sun is redistributing the modified code 
+under a slightly modified, alternative license, which is described two
+paragraphs below after "NOTE:"):
+
+   License Applicability. Except to the extent portions of this file are
+   made subject to an alternative license as permitted in the SGI Free
+   Software License B, Version 1.1 (the "License"), the contents of this
+   file are subject only to the provisions of the License. You may not use
+   this file except in compliance with the License. You may obtain a copy
+   of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+   Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+   
+   http://oss.sgi.com/projects/FreeB
+   
+   Note that, as provided in the License, the Software is distributed on an
+   "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+   DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+   CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+   PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+
+   NOTE:  The Original Code (as defined below) has been licensed to Sun 
+   Microsystems, Inc. ("Sun") under the SGI Free Software License B 
+   (Version 1.1), shown above ("SGI License").   Pursuant to Section  
+   3.2(3) of the SGI License, Sun is distributing the Covered Code to 
+   you under an alternative license ("Alternative License").  This 
+   Alternative License includes all of the provisions of the SGI License 
+   except that Section 2.2 and 11 are omitted.  Any differences between 
+   the Alternative License and the SGI License are offered solely by Sun 
+   and not by SGI.
+   
+   Original Code. The Original Code is: OpenGL Sample Implementation,
+   Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+   Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+   Copyright in any portions created by third parties is as indicated
+   elsewhere herein. All Rights Reserved.
+   
+   Additional Notice Provisions: The application programming interfaces
+   established by SGI in conjunction with the Original Code are The
+   OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+   April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+   1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+   Window System(R) (Version 1.3), released October 19, 1998. This software
+   was created using the OpenGL(R) version 1.2.1 Sample Implementation
+   published by SGI, but has not been independently verified as being
+   compliant with the OpenGL(R) version 1.2.1 Specification.
+
+
+The JOGL source tree contains code from the LWJGL project which is
+similarly covered by the BSD license:
+
+   Copyright (c) 2002-2004 LWJGL Project
+   All rights reserved.
+   
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are 
+   met:
+   
+   * Redistributions of source code must retain the above copyright 
+     notice, this list of conditions and the following disclaimer.
+  
+   * Redistributions 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 'LWJGL' nor the names of 
+     its contributors may be used to endorse or promote products derived 
+     from this software without specific prior written permission.
+   
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The JOGL source tree also contains a Java port of Brian Paul's Tile
+Rendering library, used with permission of the author under the BSD
+license instead of the original LGPL:
+
+   Copyright (c) 1997-2005 Brian Paul. 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 Brian Paul 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. THE COPYRIGHT HOLDERS AND CONTRIBUTORS 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 THE COPYRIGHT HOLDERS OR CONTRIBUTORS 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 THE COPYRIGHT HOLDERS OR
+   CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

+ 45 - 0
engine/lib/jogl/README.txt

@@ -0,0 +1,45 @@
+
+Java (TM) Binding for the OpenGL (r) API, version 1.1.1
+-------------------------------------------------------
+
+This software is licensed by Sun Microsystems, as specified
+in the LICENSE-JOGL-1.1.1.txt file.  You must use this software 
+in accordance with the terms under which the code is licensed.
+
+
+
+Instructions for unzipping Java Binding for the OpenGL API, version 1.1.1
+--------------------------------------------------------------------
+
+After downloading and unzipping the zip file containing the 
+JOGL release for your target platform, you will see the 
+following files in the top directory:
+  
+  COPYRIGHT.txt
+  LICENSE-JOGL-1.1.1.txt
+  Userguide.html
+  README.txt                  README file (you are reading it now)
+
+and the following subdirectory:
+
+  lib                         contains JOGL implementation
+
+All of the JOGL implementation files (jar files and native 
+libraries) are in the lib subdirectory.  For instructions on 
+how to use these implementation files to build or run a JOGL 
+program see the enclosed JOGL user guide (Userguide.html).
+
+
+
+Project source code and getting assistance
+------------------------------------------
+
+JOGL source code and project information can be found at:
+
+  https://jogl.dev.java.net/
+
+
+Numerous answers to common questions can be found on the JOGL
+forum:
+
+  http://www.javagaming.org/forums/index.php?board=25.0

+ 999 - 0
engine/lib/jogl/Userguide.html

@@ -0,0 +1,999 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<HTML>
+<HEAD>
+<TITLE>Jogl - User's Guide</TITLE>
+</HEAD>
+<BODY>
+
+<H1>Jogl - User's Guide</H1>
+
+<P>
+
+<UL>
+
+  <LI> Overview
+  <LI> Developing with JOGL
+  <UL>
+    <LI> Building the source tree
+    <LI> Local installation for development
+    <LI> Java Web Start integration
+    <LI> Applet support
+  </UL>
+  <LI> GLDrawable and GLContext
+  <LI> Creating a GLAutoDrawable
+  <LI> Writing a GLEventListener
+  <LI> Using the Composable Pipeline
+  <LI> Heavyweight and Lightweight Issues
+  <LI> Multithreading Issues
+  <LI> Pbuffers
+  <LI> GLU
+  <LI> More Resources
+  <LI> Platform notes
+  <UL>
+    <LI> All Platforms
+    <LI> Windows
+    <LI> Linux
+    <LI> Solaris, Linux (X11 platforms)
+    <LI> Macintosh OS X
+  </UL>
+  <LI> Version History
+
+</UL>
+
+<H2> Overview </H2>
+
+<P>
+
+Jogl is a Java programming language binding for the OpenGL 3D graphics
+API. It supports integration with the Java platform's AWT and Swing
+widget sets while providing a minimal and easy-to-use API that handles
+many of the issues associated with building multithreaded OpenGL
+applications. Jogl provides access to the latest OpenGL routines
+(OpenGL 2.0 with vendor extensions) as well as platform-independent
+access to hardware-accelerated offscreen rendering ("pbuffers"). Jogl
+also provides some of the most popular features introduced by other
+Java bindings for OpenGL like GL4Java, LWJGL and Magician, including a
+composable pipeline model which can provide faster debugging for
+Java-based OpenGL applications than the analogous C program.
+
+</P>
+<P>
+
+Jogl was designed for the most recent versions of the Java platform
+and for this reason supports only J2SE 1.4 and later. It also only
+supports truecolor (15 bits per pixel and higher) rendering; it does
+not support color-indexed modes. It was designed with New I/O (NIO) in
+mind and uses NIO internally in the implementation. The Jogl binding
+is itself written almost completely in the Java programming language.
+There are roughly 150 lines of handwritten C code in the entire Jogl
+source base (100 of which work around bugs in older OpenGL drivers on
+Windows); the rest of the native code is autogenerated during the
+build process by a new tool called <a
+href="http://gluegen.dev.java.net/">GlueGen</a>, the source code of
+which is available from its own java.net project.
+
+</P>
+<P>
+
+The JOGL source tree in its current form is an experimental workspace
+for the <a href="http://jcp.org/en/jsr/detail?id=231">JSR-231</a> Java
+Bindings for OpenGL JSR. JOGL is not the official reference
+implementation, but an evolving workspace. Snapshots of the JOGL
+source tree are run through the JSR-231 Technology Compatibility Kit
+(TCK) to become the official reference implementation (RI). As of this
+writing the JSR has not been finalized, so the first official RI of
+the JSR has not yet been produced.
+
+</P>
+
+<H2> Developing with JOGL </H2>
+
+<H3> Building the source tree </H3>
+
+<P>
+
+Most developers using JOGL will download the most current <a
+href="https://jogl.dev.java.net/servlets/ProjectDocumentList">release
+build</a>. Separate instructions are available on how to <a
+href="https://jogl.dev.java.net/unbranded-source/browse/*checkout*/jogl/doc/HowToBuild.html?rev=HEAD&amp;content-type=text/html">build
+the source tree</a>.
+
+</P>
+
+<H3> Local installation for development </H3>
+
+<P>
+
+The JOGL distribution for developers comes in the form of a zip
+archive which contains the Java classes to call OpenGL from Java, as
+well as the associated JNI native libraries. JOGL depends on some
+run-time support classes and native code provided by the GlueGen
+project; these classes and native code are also provided in the zip
+bundles.
+
+</P>
+<P>
+
+If you are developing a new application which uses JOGL, download the
+zip archive for your platform (for example.,
+jogl-[version]-windows-i586.zip) and unzip it. Modify your CLASSPATH
+environment variable to include the full paths to jogl.jar and
+gluegen-rt.jar; for example,
+".;C:\Some\Other\Package\foo.jar;C:\Users\myhome\jogl-[version]-windows-i586\lib\jogl.jar;C:\Users\myhome\jogl-[version]-windows-i586\lib\gluegen-rt.jar".
+(If you did not previously set the CLASSPATH environment variable, you
+may want to make sure that ".", the current directory, is on your new
+CLASSPATH.) Modify your PATH environment variable (Windows),
+LD_LIBRARY_PATH environment variable (Solaris and Linux), or
+DYLD_LIBRARY_PATH environment variable (Mac OS X) to contain the full
+path to the "lib" directory; for example, on Windows, add
+"C:\Users\myhome\jogl-[version]-windows-i586\lib" to your PATH using
+the System control panel, Advanced tab, Environment Variables
+button. At this point your Java installation should be able to see the
+JOGL class files. Users of IDEs such as NetBeans and Eclipse should
+consult the IDE's documentation to see how to add jar files and native
+libraries to their current project.
+
+</P>
+<P>
+
+Dropping the JOGL jar and native library into the extension directory
+of the JRE is <b>strongly discouraged</b>. Doing so can cause
+conflicts with third-party applications launched via Java Web Start,
+and causes confusion later when upgrading the distribution.
+
+</P>
+<P>
+
+If you are on the Linux platform, please see the Linux-specific
+platform notes, below, with information on incompatibility between the
+JPackage Java RPMs and JOGL.
+
+</P>
+
+<H3> Java Web Start integration </H3>
+
+<P>
+
+The recommended distribution vehicle for applications using JOGL is
+Java Web Start. JOGL-based applications do not even need to be signed;
+all that is necessary is to reference the JOGL extension JNLP file.
+Because the JOGL jar files are signed, an unsigned application can
+reference the signed JOGL library and continue to run inside the
+sandbox.
+
+</P>
+<P>
+
+To reference JOGL within your application's JNLP file, simply place
+the following line in the <code>&lt;resources&gt;</code> section:
+
+<PRE>
+  &lt;extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" /&gt;
+</PRE>
+
+This JNLP file points to the current JSR-231 unofficial development
+build. For reference, the extension JNLP file for the most recent
+official JSR-231 build is available at
+
+<PRE>
+  &lt;extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-1.1.0/webstart/jogl.jnlp" /&gt;
+</PRE>
+
+Note that before JOGL transitioned to the JSR-231 APIs, there were
+releases of the library in the <code>net.java.games.jogl</code>
+namespace under version numbers "1.0", "1.1", and "1.1.1". All of
+these releases have been superseded by JSR-231. Please update your
+applications.
+
+</P>
+
+<H3> Applet support </H3>
+
+<P>
+
+Lilian Chamontin, in conjunction with several other members of the
+JOGL community, has contributed a JOGL applet installer. This
+installer uses some clever tricks to allow deployment of unsigned
+applets which use JOGL into existing web browsers and JREs as far back
+as 1.4.2, which is the earliest version of Java supported by JOGL.
+
+</P>
+<P>
+
+The JOGLAppletInstaller is distributed inside jogl.jar as a utility
+class in com.sun.opengl.util. It requires that the developer host a
+local, signed copy of jogl.jar and all of the jogl-natives jars; the
+certificates must be the same on all of these jars. Note that in the
+release builds of JOGL all of these jars are signed by Sun
+Microsystems, so the developer can deploy applets without needing any
+certificates.
+
+</P>
+<P>
+
+The JOGLAppletInstaller javadoc describes the basic steps for
+deployment of an applet utilizing JOGL. Please refer to this
+documentation for more information. A live example of deploying an
+unsigned JOGL applet will be added to this documentation shortly once
+the first signed build of the JOGLAppletInstaller has been shipped.
+
+</P>
+
+<H2> GLDrawable and GLContext </H2>
+
+<P>
+
+The JSR-231 APIs specify interfaces two low-level OpenGL abstractions:
+drawables and contexts. An OpenGL drawable is effectively a surface
+upon which OpenGL rendering will be performed. In order to perform
+rendering, an OpenGL rendering context is needed. Contexts and
+drawables typically go hand-in-hand. More than one context may be
+created for a particular drawable. In the JSR-231 abstractions, a
+context is always associated with exactly one drawable.
+
+</P>
+<P>
+
+Most end users will not need to use these abstractions directly.
+However, when sharing textures, display lists and other OpenGL objects
+between widgets, the concrete identifier for the "namespace" for these
+objects is the GLContext.
+
+</P>
+
+<H2> Creating a GLAutoDrawable </H2>
+
+<P>
+
+Jogl provides two basic widgets into which OpenGL rendering can be
+performed. The GLCanvas is a heavyweight AWT widget which supports
+hardware acceleration and which is intended to be the primary widget
+used by applications. The GLJPanel is a fully Swing-compatible
+lightweight widget which supports hardware acceleration but which is
+not as fast as the GLCanvas because it typically reads back the frame
+buffer in order to draw it using Java2D. The GLJPanel is intended to
+provide 100% correct Swing integration in the circumstances where a
+GLCanvas can not be used. See <a href =
+"http://java.sun.com/products/jfc/tsc/articles/mixing/">this
+article</a> on <a href = "http://java.sun.com/products/jfc/tsc/">The
+Swing Connection</a> for more information about mixing lightweight and
+heavyweight widgets. See also the section on "Heavyweight and
+Lightweight Issues" below. Recent work in the Mustang release of the
+JDK has sped up the GLJPanel significantly when the Java2D OpenGL
+pipeline is enabled; see <a
+href="http://www.javagaming.org/forums/index.php?topic=10813.0">this
+forum discussion</a> for more details.
+
+</P>
+<P>
+
+Both the GLCanvas and GLJPanel implement a common interface called
+GLAutoDrawable so applications can switch between them with minimal
+code changes. The GLAutoDrawable interface provides
+
+<UL>
+
+  <LI> access to the GL object for calling OpenGL routines
+
+  <LI> a callback mechanism (GLEventListener) for performing OpenGL
+  rendering
+
+  <LI> a <CODE>display()</CODE> method for forcing OpenGL rendering to
+  be performed synchronously
+
+  <LI> AWT- and Swing-independent abstractions for getting and setting
+  the size of the widget and adding and removing event listeners
+
+</UL>
+
+</P>
+<P>
+
+When creating GLCanvas and GLJPanel instances, the user may request a
+certain set of OpenGL parameters in the form of a GLCapabilities
+object, customize the format selection algorithm by specifying a
+GLCapabilitiesChooser, share textures and display lists with other
+GLDrawables, and specify the display device on which the
+GLAutoDrawable will be created (GLCanvas only).
+
+</P>
+<P>
+
+A GLCapabilities object specifies the OpenGL parameters for a
+newly-created widget, such as the color, alpha,, z-buffer and
+accumulation buffer bit depths and whether the widget is
+double-buffered. The default capabilities are loosely specified but
+provide for truecolor RGB, a reasonably large depth buffer,
+double-buffered, with no alpha, stencil, or accumulation buffers. 
+
+</P>
+<P>
+
+An application can override the default pixel format selection
+algorithm by providing a GLCapabilitiesChooser to the GLCanvas or
+GLJPanel constructor. (Not all platforms support the
+GLCapabilitiesChooser mechanism, however; it may be ignored, in
+particular on Mac OS X where pixel format selection is very different
+than on other platforms.) The chooseCapabilities method will be called
+with all of the available pixel formats as an array of GLCapabilities
+objects, as well as the index indicating the window system's
+recommended choice; it should return an integer index into this
+array. The DefaultGLCapabilitiesChooser uses the window system's
+recommendation when it is available, and otherwise attempts to use a
+platform-independent selection algorithm.
+
+</P>
+<P>
+
+The GLJPanel can be made non-opaque according to Swing's rendering
+model, so it can act as an overlay to other Swing or Java2D drawing.
+In order to enable this, set up your GLCapabilities object with a
+non-zero alpha depth (a common value is 8 bits) and call
+setOpaque(false) on the GLJPanel once it has been created. Java2D
+rendering underneath it will then show through areas where OpenGL has
+produced an alpha value less than 1.0. See the JGears and JRefract
+demos for examples of how to use this functionality.
+
+</P>
+
+<H2> Writing a GLEventListener </H2>
+
+<P>
+
+Applications implement the GLEventListener interface to perform OpenGL
+drawing via callbacks. When the methods of the GLEventListener are
+called, the underlying OpenGL context associated with the drawable is
+already current. The listener fetches the GL object out of the
+GLAutoDrawable and begins to perform rendering.
+
+</P>
+<P>
+
+The <CODE>init()</CODE> method is called when a new OpenGL context is
+created for the given GLAutoDrawable. Any display lists or textures
+used during the application's normal rendering loop can be safely
+initialized in <CODE>init()</CODE>. It is important to note that
+because the underlying AWT window may be destroyed and recreated while
+using the same GLCanvas and GLEventListener, the GLEventListener's
+<CODE>init()</CODE> method may be called more than once during the
+lifetime of the application. The init() method should therefore be
+kept as short as possible and only contain the OpenGL initialization
+required for the <CODE>display()</CODE> method to run properly. It is
+the responsibility of the application to keep track of how its various
+OpenGL contexts share display lists, textures and other OpenGL objects
+so they can be either be reinitialized or so that reinitialization can
+be skipped when the <CODE>init()</CODE> callback is called.
+
+</P>
+<P>
+
+Note also that the GLEventListener should be added to the
+GLAutoDrawable before the GLAutoDrawable is shown or rendered to for
+the first time. If this is not done, it is possible that the init()
+method will not be called on the GLEventListener. JOGL does not
+maintain internal state to keep track of whether init() has been
+called on a particular GLEventListener since the last time an OpenGL
+context was created for that GLAutoDrawable.
+
+</P>
+<P>
+
+The <CODE>display()</CODE> method is called to perform per-frame
+rendering. The <CODE>reshape()</CODE> method is called when the
+drawable has been resized; the default implementation automatically
+resizes the OpenGL viewport so often it is not necessary to do any
+work in this method.  The <CODE>displayChanged()</CODE> method is
+designed to allow applications to support on-the-fly screen mode
+switching, but support for this is not yet implemented so the body of
+this method should remain empty.
+
+</P>
+<P>
+
+It is strongly recommended that applications always refetch the GL
+object out of the GLAutoDrawable upon each call to the
+<CODE>init()</CODE>, <CODE>display()</CODE> and <CODE>reshape()</CODE>
+methods and pass the GL object down on the stack to any drawing
+routines, as opposed to storing the GL in a field and referencing it
+from there. The reason is that multithreading issues inherent to the
+AWT toolkit make it difficult to reason about which threads certain
+operations are occurring on, and if the GL object is stored in a field
+it is unfortunately too easy to accidentally make OpenGL calls from a
+thread that does not have a current context. This will usually cause
+the application to crash. For more information please see the section
+on multithreading.
+
+</P>
+
+<H2> Using the Composable Pipeline </H2>
+
+<P>
+
+Jogl supports the "composable pipeline" paradigm introduced by the
+Magician Java binding for OpenGL. The DebugGL pipeline calls
+<CODE>glGetError</CODE> after each OpenGL call, reporting any errors
+found. It can greatly speed up development time because of its
+fine-grained error checking as opposed to the manual error checking
+usually required in OpenGL programs written in C. The TraceGL prints
+logging information upon each OpenGL call and is helpful when an
+application crash makes it difficult to see where the error occurred.
+
+</P>
+<P>
+
+To use these pipelines, call <CODE>GLAutoDrawable.setGL</CODE> at the
+beginning of the <CODE>init</CODE> method in your GLEventListener. For
+example,
+
+<PRE>
+class MyListener implements GLEventListener {
+  public void init(GLDrawable drawable) {
+    drawable.setGL(new DebugGL(drawable.getGL()));
+    // ...
+  }
+
+  // ...
+}
+</PRE>
+
+</P>
+<P>
+
+Note that the GLAutoDrawable.setGL() method simply calls setGL() on
+the default OpenGL context created by the GLAutoDrawable, so
+sophisticated applications creating their own OpenGL contexts can use
+the composable pipeline with these contexts by setting the GL object
+in the context object itself. The composable pipeline needs to be
+re-installed every time GLContext.makeCurrent() returns
+CONTEXT_CURRENT_NEW.
+
+</P>
+
+<H2> Heavyweight and Lightweight Issues </H2>
+
+<P>
+
+As mentioned above, JOGL supplies both a heavyweight (GLCanvas) and a
+lightweight (GLJPanel) widget to be able to provide the fastest
+possible performance for applications which need it as well as 100%
+correct Swing integration, again for applications which need it. The
+GLCanvas usually provides higher performance than the GLJPanel, though
+in recent releases the GLJPanel's speed has been improved when the
+Java2D/OpenGL pipeline is active as described in <a
+href="http://www.javagaming.org/forums/index.php?topic=10813.0">this
+forum discussion</a>. Nonetheless, the GLCanvas can be used in almost
+every kind of application except those using JInternalFrames. Please
+see the Swing Connection article mentioned above for details on mixing
+heavyweight and lightweight widgets. A couple of common pitfalls are
+described here.
+
+</P>
+<P>
+
+When using JPopupMenus or Swing tool tips in conjunction with the
+GLCanvas, it is necessary to disable the use of lightweight widgets
+for the popups. See the methods
+<CODE>ToolTipManager.setLightWeightPopupEnabled</CODE>,
+<CODE>JPopupMenu.setLightWeightPopupEnabled</CODE>, and
+<CODE>JPopupMenu.setDefaultLightWeightPopupEnabled</CODE>.
+
+</P>
+<P>
+
+There are occasionally problems with certain LayoutManagers and
+component configurations where if a GLCanvas is placed in the middle
+of a set of lightweight widgets then it may only grow and never
+shrink. These issues are documented somewhat in <a href =
+"https://jogl.dev.java.net/issues/show_bug.cgi?id=135">JOGL Issue
+135</a> and most recently in the thread <a
+href="http://javagaming.org/forums/index.php?topic=8699.0">"Resize
+behaviour"</a> in the JOGL forum. The root cause is behavior of the
+Canvas, and in particular its ComponentPeer. The implementation of
+getPreferredSize() calls getMinimumSize() and getMinimumSize() turns
+around and calls Component.getSize(). This effectively means that the
+Canvas will report its preferred size as being as large as the
+component has ever been. For some layout managers this doesn't seem to
+matter, but for others like the BoxLayout it does. See the test case
+attached to Issue 135 for an example. Replacing the GLCanvas with an
+ordinary Canvas yields the same behavior.
+
+</P>
+<P>
+
+One suggestion was to override getPreferredSize() so that if a
+preferred size has not been set by the user, to default to (0,
+0). This works fine for some test cases but breaks all of the other
+JOGL demos because they use a different LayoutManager. There appear to
+be a lot of interactions between heavyweight vs. lightweight widgets
+and layout managers. One experiment which was done was to override
+setSize() in GLCanvas to update the preferred size.  This works down
+to the size specified by the user; if the window is resized any
+smeller the same problem appears. If reshape() (the base routine of
+setSize(), setBounds(), etc.) is changed to do the same thing, the
+demo breaks in the same way it originally did. Therefore this solution
+is fragile because it isn't clear which of these methods are used
+internally by the AWT and for what purposes.
+
+</P>
+<P>
+
+There are two possible solutions, both application-specific. The best
+and most portable appears to be to put the GLCanvas into a JPanel and
+set the JPanel's preferred size to (0, 0). The JPanel will cause this
+constraint to be enforced on its contained GLCanvas. The other
+workaround is to call <CODE>setPreferredSize(new Dimension(0,
+0))</CODE> on a newly-created GLCanvas; this method is new in 1.5.
+
+</P>
+<P>
+
+Another issue that occasionally arises on Windows is flickering during
+live resizing of a GLCanvas. This is caused by the AWT's repainting
+the background of the Canvas and can not be overridden on a per-Canvas
+basis, for example when subclassing Canvas into GLCanvas.  The
+repainting of the background of Canvases on Windows can be disabled by
+specifying the system property
+<CODE>-Dsun.awt.noerasebackground=true</CODE>. Whether to specify this
+flag depends on the application and should not be done universally,
+but instead on a case-by-case basis. Some more detail is in the thread
+<a href="http://javagaming.org/forums/index.php?topic=8770.0">"TIP:
+JOGL + Swing flicker"</a> in the JOGL forum.
+
+</P>
+
+<H2> Multithreading Issues </H2>
+
+<P>
+
+Jogl was designed to interoperate with the AWT, an inherently
+multithreaded GUI toolkit. OpenGL, in contrast, was originally
+designed in single-threaded C programming environments. For this
+reason Jogl provides a framework in which it is possible to write
+correct multithreaded OpenGL applications using the GLEventListener
+paradigm.
+
+</P>
+<P>
+
+If an application written using Jogl interacts in any way with the
+mouse or keyboard, the AWT is processing these events and the
+multithreaded aspects of the program must be considered.
+
+</P>
+<P>
+
+OpenGL applications usually behave in one of two ways: either they
+repaint only on demand, for example when mouse input comes in, or they
+repaint continually, regardless of whether user input is coming in. In
+the repaint-on-demand model, the application can merely call
+<CODE>GLAutoDrawable.display()</CODE> manually at the end of the mouse
+or keyboard listener to cause repainting to be done. Alternatively if
+the application knows the concrete type of the GLDrawable it can call
+repaint() to have the painting scheduled for a later time.
+
+</P>
+<P>
+
+In the continuous repaint model, the application typically has a main
+loop which is calling <CODE>GLAutoDrawable.display()</CODE>
+repeatedly, or is using the Animator class, which does this
+internally. In both of these cases the OpenGL rendering will be done
+on this thread rather than the internal AWT event queue thread which
+dispatches mouse and keyboard events.
+
+</P>
+<P>
+
+Both of these models (repaint-on-demand and repaint continually) still
+require the user to think about which thread keyboard and mouse events
+are coming in on, and which thread is performing the OpenGL rendering.
+OpenGL rendering <B>may not</B> occur directly inside the mouse or
+keyboard handlers, because the OpenGL context for the drawable is not
+current at this point (hence the warning about storing a GL object in
+a field, where it can be fetched and accidentally used by another
+thread). However, a mouse or keyboard listener may invoke
+<CODE>GLAutoDrawable.display()</CODE>.
+
+</P>
+<P>
+
+It is generally recommended that applications perform as little work
+as possible inside their mouse and keyboard handlers to keep the GUI
+responsive. However, since OpenGL commands can not be run from
+directly within the mouse or keyboard event listener, the best
+practice is to store off state when the listener is entered and
+retrieve this state during the next call to
+<CODE>GLEventListener.display()</CODE>.
+
+</P>
+<P>
+
+Furthermore, it is recommended that if there are long computational
+sequences in the GLEventListener's <CODE>display</CODE> method which
+reference variables which may be being simultaneously modified by the
+AWT thread (mouse and keyboard listeners) that copies of these
+variables be made upon entry to <CODE>display</CODE> and these copies
+be referenced throughout display() and the methods it calls. This will
+prevent the values from changing while the OpenGL rendering is being
+performed. Errors of this kind show up in many ways, including certain
+kinds of flickering of the rendered image as certain pieces of objects
+are rendered in one place and other pieces are rendered elsewhere in
+the scene. Restructuring the display() method as described has solved
+all instances of this kind of error that have been seen with Jogl to
+date.
+
+</P>
+<P>
+
+Prior to Jogl 1.1 b10, the Jogl library attempted to give applications
+strict control over which thread or threads performed OpenGL
+rendering. The <CODE>setRenderingThread()</CODE>,
+<CODE>setNoAutoRedrawMode()</CODE> and <CODE>display()</CODE> APIs
+were originally designed to allow the application to create its own
+animation thread and avoid OpenGL context switching on platforms that
+supported it. Unfortunately, serious stability issues caused by
+multithreading bugs in either vendors' OpenGL drivers or in the Java
+platform implementation have arisen on three of Jogl's major supported
+platforms: Windows, Linux and Mac OS X. In order to address these
+bugs, the threading model in Jogl 1.1 b10 and later has changed.
+
+</P>
+<P>
+
+All GLEventListener callbacks and other internal OpenGL context
+management are now performed on one thread. (In the current
+implementation, this thread is the AWT event queue thread, which is a
+thread internal to the implementation of the AWT and which is always
+present when the AWT is being used. Future versions of Jogl may change
+the thread on which the OpenGL work is performed.) When the
+<CODE>GLAutoDrawable.display()</CODE> method is called from user code,
+it now performs the work synchronously on the AWT event queue thread,
+even if the calling thread is a different thread. The
+<CODE>setRenderingThread()</CODE> optimization is now a no-op. The
+<CODE>setNoAutoRedrawMode()</CODE> API still works as previously
+advertised, though now that all work is done on the AWT event queue
+thread it no longer needs to be used in most cases. (It was previously
+useful for working around certain kinds of OpenGL driver bugs.)
+
+</P>
+<P>
+
+Most applications will not see a change in behavior from this change
+in the Jogl implementation. Applications which use thread-local
+storage or complex multithreading and synchronization may see a change
+in their control flow requiring code changes. While it is strongly
+recommended to change such applications to work under the new
+threading model, the old threading model can be used by specifying the
+system property <CODE>-Djogl.1thread=auto</CODE> or
+<CODE>-Djogl.1thread=false</CODE>. The "auto" setting is equivalent to
+the behavior in 1.1 b09 and before, where on ATI cards the
+single-threaded mode would be used. The "false' setting is equivalent
+to disabling the single-threaded mode. "true" is now the default
+setting.
+
+</P>
+<P>
+
+In the JSR-231 APIs the single-threaded behavior continues to be the
+default and the <CODE>setRenderingThread()</CODE> and
+<CODE>setNoAutoRedrawMode()</CODE> APIs have been removed. The public
+<CODE>Threading</CODE> class still provides some control over the
+internal use of threads in the library as well as external access to
+these mechanisms.
+
+</P>
+
+<H2> Pbuffers </H2>
+
+<P>
+
+Jogl exposes hardware-accelerated offscreen rendering (pbuffers) with
+a minimal and platform-agnostic API. Several recent demos have been
+successfully ported from C/C++ to Java using Jogl's pbuffer APIs.
+However, the pbuffer support in Jogl remains one of the more
+experimental aspects of the package and the APIs may need to change in
+the future.
+
+</P>
+<P>
+
+To create a pbuffer, call
+<CODE>GLDrawableFactory.createGLPbuffer()</CODE>. It is wise to call
+<CODE>GLDrawableFactory.canCreateGLPbuffer()</CODE> first to ensure
+the graphics card has pbuffer support first. The pbuffer is created
+immediately and is available for rendering as soon as
+<CODE>createGLPbuffer</CODE> returns.
+
+</P>
+<P>
+
+A pbuffer is used in conjunction with the GLEventListener mechanism by
+calling its display() method. Rendering, as always, occurs while the
+pbuffer's OpenGL context is current. There are render-to-texture
+options that can be specified in the GLCapabilities for the pbuffer
+which can make it easier to operate upon the resulting pixels. These
+APIs are however highly experimental and not yet implemented on all
+platforms.
+
+</P>
+
+<H2> GLU </H2>
+
+<P>
+
+Jogl contains support for the GLU (OpenGL Utility Library) version
+1.3. Jogl originally supported GLU by wrapping the C version of the
+APIs, but over time, and thanks to the contributions of several
+individuals, it now uses a pure-Java version of SGI's GLU library. The
+pure Java port is enabled by default, and addresses stability issues
+on certain Linux distributions as well as the lack of native GLU 1.3
+support on the Windows platform. In case of problems with the Java
+port, the C version of the GLU library may be used by specifying the
+system property <CODE>-Djogl.glu.nojava</CODE> on the command
+line. All of the same functionality is exposed with both the Java and
+C versions of the GLU library; currently NURBS support is the only
+missing feature on both sides. If you run into problems with the Java
+port of the GLU library please file a bug using the Issue Tracker on
+the Jogl home page.
+
+</P>
+<P>
+
+To use the GLU, simply instantiate a GLU object via <CODE>new
+GLU()</CODE> at the beginning of your program. The methods on the GLU
+object may be called at any point when an OpenGL context is current.
+Because the GLU implementation is not thread-safe, one GLU object
+should be created for each GLEventListener or other entity performing
+OpenGL rendering in a given thread.
+
+</P>
+
+<H2> More Resources </H2>
+
+<P>
+
+The <A HREF="http://javagaming.org/forums/index.php?board=25.0">JOGL
+forum</A> on <A HREF="http://javagaming.org/">javagaming.org</A> is
+the best place to ask questions about the library. Many users, as well
+as the Jogl developers, read this forum frequently, and the archived
+threads contain a lot of useful information (which still needs to be
+distilled into documentation).
+
+</P>
+<P>
+
+The <A HREF="http://jogl-demos.dev.java.net/">JOGL demos</A> provide
+several examples of usage of the library.
+
+</P>
+<P>
+
+Pepijn Van Eeckhoudt, Kevin Duling and Abdul Bezrati have done <A
+HREF="http://pepijn.fab4.be/software/nehe-java-ports/">JOGL ports of
+many of the the NeHe demos</A>. These are small examples of various
+pieces of OpenGL functionality. See also the <A
+HREF="http://nehe.gamedev.net/">NeHe web site</A>.
+
+</P>
+<P>
+
+Pepijn also did a <A
+HREF="http://www.glexcess.com/files/glexcess.jar">JOGL port</a> of
+Paolo Martella's <A HREF="http://www.glexcess.com/">GLExcess</A>
+demo. To see the news update about this port, go to the main GLExcess
+site and scroll down.
+
+</P>
+<P>
+
+Gregory Pierce's <A
+HREF="http://javagaming.org/forums/index.php?topic=1474.0">introduction
+to JOGL</a> is a useful tutorial on starting to use the JOGL library.
+
+</P>
+<P>
+
+For release information about the JOGL library, please see the <A
+HREF="http://javagaming.org/forums/index.php?topic=1596.0">JOGL Release
+Information</A> thread on the JOGL forum on javagaming.org.
+
+</P>
+<P>
+
+Please post on the JOGL forum if you have a resource you'd like to add
+to this documentation.
+
+</P>
+
+<H2> Platform Notes </H2>
+
+<H3> All Platforms </H3>
+
+<P>
+
+The following issues, among others, are outstanding on all platforms:
+
+</P>
+
+<UL>
+
+<LI> A few remaining stability issues, mostly on older graphics cards.
+
+<LI> JOGL now supports experimental integration and interoperability
+with the Java2D/OpenGL pipeline in Java SE 6 (Mustang), enabling a
+much faster GLJPanel as well as other features. Please see <a
+href="http://www.javagaming.org/forums/index.php?topic=10813.0">this
+forum discussion</a> for more details.
+
+</UL>
+
+<H3> Windows </H3>
+
+<P>
+
+For correct operation, it is necessary to specify the system property
+<CODE>-Dsun.java2d.noddraw=true</CODE> when running JOGL applications
+on Windows; this system property disables the use of DirectDraw by
+Java2D. There are driver-level incompatibilities between DirectDraw
+and OpenGL which manifest themselves as application crashes, poor
+performance, bad flickering, and other artifacts. This poor behavior
+may exhibit itself when OpenGL and DirectDraw are simply used in the
+same application, not even just in the same window, so disabling
+Java2D's DirectDraw pipeline and forcing it to use its GDI pipeline is
+the only way to work around these issues. Java Web Start applications
+may set this system property by adding the following line to the
+<CODE>&lt;resources&gt;</CODE> section of the JNLP file: <PRE>
+&lt;property name="sun.java2d.noddraw" value="true"/&gt; </PRE>
+
+</P>
+<P>
+
+There is a serious memory leak in ATI's OpenGL drivers which is
+exhibited on Windows XP on Mobility Radeon 9700 hardware. It's
+possible it will be present on other hardware as well though it was
+not reproducible at the time of this writing on desktop Radeon
+hardware or older ATI mobile chips. The bug is documented in <A
+HREF="https://jogl.dev.java.net/issues/show_bug.cgi?id=166">JOGL Issue
+166</A> and a bug has been filed with ATI. You can confirm the
+presence of the bug either with the test case in that bug report or by
+simply running the Gears demo; if the process size grows over time in
+the Task Manager, the memory leak is present on your hardware. For the
+time being, you can work around this memory leak by specifying the
+system property <CODE>-Djogl.GLContext.nofree</CODE> on the command
+line when launching your JOGL applications. There is no good
+general-purpose workaround for this bug which behaves well on all
+hardware.
+
+</P>
+
+<H3> Linux </H3>
+
+<P>
+
+The Sun JDK "compatibility" RPMs (java-1.5.0-sun-compat,
+java-1.6.0-sun-compat) provided by jpackage.org are incompatible with
+JOGL. These RPMs symlink an internal JDK directory to /usr/lib, which
+overrides how both NVidia and ATI currently provide their drivers to
+some Linux distributions, which is through an override in
+/etc/ld.so.conf (actually, in /etc/ld.so.conf.d). The implicit
+presence of /usr/lib on LD_LIBRARY_PATH forces the /usr/lib/libGL.so.1
+version of OpenGL to be used, which is typically Mesa and which will
+provide only software rendering.
+
+</P>
+<P>
+
+Unfortunately the JPackage maintainers have so far been unreceptive to
+changing their installation mechanism; see <a
+href="https://www.zarb.org/pipermail/jpackage-discuss/2007-January/010871.html">this
+mailing list posting</a>. Until this is resolved, we strongly
+discourage the use of the JPackage installers for the Sun JDK.
+Instead, download the JRE or JDK installers directly from Sun's
+website.
+
+</P>
+<P>
+
+Archived forum postings illustrating this problem are <a
+href="http://www.javagaming.org/forums/index.php?topic=15610.0">here</a>
+and <a
+href="http://www.javagaming.org/forums/index.php?topic=16105.0">here</a>.
+
+</P>
+
+<H3> Solaris, Linux (X11 platforms) </H3>
+
+<P>
+
+Support has been added to the JOGL library for allowing multiple
+threads to each have an OpenGL context current simultaneously, for
+example to implement multi-head CAVE-like environments. Normally a
+global AWT lock is held between calls to GLContext.makeCurrent() /
+release() for on-screen heavyweight contexts (for example, those
+associated with a Canvas or GLCanvas). We have found this to be
+necessary for stability purposes on all supported X11 platforms, even
+with relatively robust drivers such as those from NVidia.
+
+</P>
+<P>
+
+To enable multiple GLContexts to be made current simultaneously on X11
+platforms, specify the command line argument
+<CODE>-Djogl.GLContext.optimize</CODE> when starting the JVM. Note
+that this may incur robustness problems, in particular when resizing
+or moving windows. We have also found that ATI's proprietary drivers
+do not work at all with this flag, apparently because they cause GLX
+tokens to be sent to the X server for various GL calls even for direct
+contexts. For this reason if the GLX vendor is ATI then this flag
+currently has no effect.
+
+</P>
+
+<H3> Mac OS X </H3>
+
+<P>
+
+There are some problems with visual artifacts and stability problems
+with some of the Jogl demos on Mac OS X. It appears that at least some
+of these problems are due to bugs in Apple's OpenGL support. Bugs have
+been filed about these problems and it is hoped they will be addressed
+in the near future.
+
+</P>
+<P>
+
+The Mac OS X port of Jogl, in particular the GL interface and its
+implementation, can be used either with the provided GLCanvas widget
+or with the Cocoa NSOpenGLView. In order to use it with Cocoa the
+following steps should be taken:
+
+<UL>
+
+<LI> Create an "external" OpenGL context using the
+<CODE>GLDrawableFactory.createExternalGLContext()</CODE> API. The
+context object must be created while a real underlying OpenGL context
+is current.
+
+<LI> Fetch the GL instance out of the context using getGL() as usual.
+Only use the GL instance when the OpenGL context from the NSOpenGLView
+is current.
+
+</UL>
+
+<B>NOTE:</B> the Cocoa interoperability has not been retested
+recently, though similar interoperability has been tested on other
+platforms. Please report any problems found with using Jogl with an
+NSOpenGLView.
+
+</P>
+<P>
+
+The following issues remain with the Mac OS X port:
+
+<UL>
+
+<LI> Due to the mechanism by which the Cocoa graphics system selects
+OpenGL pixel formats, the GLCapabilitiesChooser mechanism can not be
+implemented on Mac OS X as on other platforms. Currently the
+underlying Cocoa pixel format selection is used on an
+NSOpenGLPixelFormat derived from the settings in the GLCapabilities,
+and the GLCapabilitiesChooser is ignored.
+
+</UL>
+
+</P>
+
+<H2> Version History </H2>
+
+<P>
+
+JOGL's version history can be found online in the <a
+href="http://javagaming.org/forums/index.php?topic=1596.0">"JOGL Release
+Information"</a> thread in the JOGL forum. Comments about the 1.1
+release train are in the thread <a
+href="http://javagaming.org/forums/index.php?topic=4217.0">"JOGL 1.1
+released"</a>.
+
+</BODY>
+</HTML>
+

BIN
engine/lib/jogl/gluegen-rt.jar


BIN
engine/lib/jogl/jME3-jogl-natives.jar


BIN
engine/lib/jogl/jogl.jar


BIN
engine/lib/jogl/macosx_ppc/libgluegen-rt.jnilib


BIN
engine/lib/jogl/macosx_ppc/libjogl.jnilib


BIN
engine/lib/jogl/macosx_ppc/libjogl_awt.jnilib


BIN
engine/lib/jogl/macosx_ppc/libjogl_cg.jnilib


BIN
engine/lib/jogl/macosx_universal/libgluegen-rt.jnilib


BIN
engine/lib/jogl/macosx_universal/libjogl.jnilib


BIN
engine/lib/jogl/macosx_universal/libjogl_awt.jnilib


BIN
engine/lib/jogl/macosx_universal/libjogl_cg.jnilib


BIN
engine/lib/jogl/win32/gluegen-rt.dll


BIN
engine/lib/jogl/win32/jogl.dll


BIN
engine/lib/jogl/win32/jogl_awt.dll


BIN
engine/lib/jogl/win32/jogl_cg.dll


BIN
engine/lib/jogl/win64/gluegen-rt.dll


BIN
engine/lib/jogl/win64/jogl.dll


BIN
engine/lib/jogl/win64/jogl_awt.dll


BIN
engine/lib/jogl/win64/jogl_cg.dll


BIN
engine/lib/jogl2/gluegen-rt.jar


BIN
engine/lib/jogl2/jogl.all.jar


BIN
engine/lib/jogl2/linux32/libgluegen-rt.so


BIN
engine/lib/jogl2/linux32/libjogl_desktop.so


BIN
engine/lib/jogl2/linux32/libnativewindow_awt.so


BIN
engine/lib/jogl2/linux32/libnativewindow_x11.so


BIN
engine/lib/jogl2/linux32/libnewt.so


BIN
engine/lib/jogl2/nativewindow.all.jar


BIN
engine/lib/jogl2/nativewindow.os.x11.jar


BIN
engine/lib/jogl2/newt.all.jar


BIN
engine/lib/jogl2/newt.os.x11.jar


BIN
engine/lib/junit_4/junit-4.5-api.zip


BIN
engine/lib/junit_4/junit-4.5-src.jar


BIN
engine/lib/junit_4/junit-4.5.jar


+ 32 - 0
engine/lib/lwjgl/3rdparty/jinput_license.txt

@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2003 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 materails provided with the distribution.
+ *
+ * Neither the name Sun Microsystems, Inc. or the names of the 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 WARRANT OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+ * NON-INFRINGEMEN, 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 DESTRIBUTING 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 OUR 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 us in
+ * the design, construction, operation or maintenance of any nuclear facility
+ *
+ *****************************************************************************/

+ 152 - 0
engine/lib/lwjgl/3rdparty/jogl_license.txt

@@ -0,0 +1,152 @@
+JOGL is released under the BSD license. The full license terms follow:
+
+   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
+   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.
+   
+   You acknowledge that this software is not designed or intended for use
+   in the design, construction, operation or maintenance of any nuclear
+   facility.
+
+The JOGL source tree contains code ported from the OpenGL sample
+implementation by Silicon Graphics, Inc. This code is licensed under
+the SGI Free Software License B (Sun is redistributing the modified code 
+under a slightly modified, alternative license, which is described two
+paragraphs below after "NOTE:"):
+
+   License Applicability. Except to the extent portions of this file are
+   made subject to an alternative license as permitted in the SGI Free
+   Software License B, Version 1.1 (the "License"), the contents of this
+   file are subject only to the provisions of the License. You may not use
+   this file except in compliance with the License. You may obtain a copy
+   of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+   Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+   
+   http://oss.sgi.com/projects/FreeB
+   
+   Note that, as provided in the License, the Software is distributed on an
+   "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+   DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+   CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+   PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+
+   NOTE:  The Original Code (as defined below) has been licensed to Sun 
+   Microsystems, Inc. ("Sun") under the SGI Free Software License B 
+   (Version 1.1), shown above ("SGI License").   Pursuant to Section  
+   3.2(3) of the SGI License, Sun is distributing the Covered Code to 
+   you under an alternative license ("Alternative License").  This 
+   Alternative License includes all of the provisions of the SGI License 
+   except that Section 2.2 and 11 are omitted.  Any differences between 
+   the Alternative License and the SGI License are offered solely by Sun 
+   and not by SGI.
+   
+   Original Code. The Original Code is: OpenGL Sample Implementation,
+   Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+   Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+   Copyright in any portions created by third parties is as indicated
+   elsewhere herein. All Rights Reserved.
+   
+   Additional Notice Provisions: The application programming interfaces
+   established by SGI in conjunction with the Original Code are The
+   OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+   April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+   1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+   Window System(R) (Version 1.3), released October 19, 1998. This software
+   was created using the OpenGL(R) version 1.2.1 Sample Implementation
+   published by SGI, but has not been independently verified as being
+   compliant with the OpenGL(R) version 1.2.1 Specification.
+
+
+The JOGL source tree contains code from the LWJGL project which is
+similarly covered by the BSD license:
+
+   Copyright (c) 2002-2004 LWJGL Project
+   All rights reserved.
+   
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are 
+   met:
+   
+   * Redistributions of source code must retain the above copyright 
+     notice, this list of conditions and the following disclaimer.
+  
+   * Redistributions 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 'LWJGL' nor the names of 
+     its contributors may be used to endorse or promote products derived 
+     from this software without specific prior written permission.
+   
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The JOGL source tree also contains a Java port of Brian Paul's Tile
+Rendering library, used with permission of the author under the BSD
+license instead of the original LGPL:
+
+   Copyright (c) 1997-2005 Brian Paul. 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 Brian Paul 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. THE COPYRIGHT HOLDERS AND CONTRIBUTORS 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 THE COPYRIGHT HOLDERS OR CONTRIBUTORS 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 THE COPYRIGHT HOLDERS OR
+   CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

+ 15 - 0
engine/lib/lwjgl/3rdparty/lzma_license.txt

@@ -0,0 +1,15 @@
+LZMA# SDK is licensed under two licenses:
+
+1) GNU Lesser General Public License (GNU LGPL)
+2) Common Public License (CPL)
+
+It means that you can select one of these two licenses and 
+follow rules of that license.
+
+SPECIAL EXCEPTION
+Igor Pavlov, as the author of this code, expressly permits you 
+to statically or dynamically link your code (or bind by name) 
+to the files from LZMA# SDK without subjecting your linked 
+code to the terms of the CPL or GNU LGPL. 
+Any modifications or additions to files from LZMA# SDK, however, 
+are subject to the GNU LGPL or CPL terms.

+ 437 - 0
engine/lib/lwjgl/3rdparty/openal_license.txt

@@ -0,0 +1,437 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS

+ 36 - 0
engine/lib/lwjgl/CREDITS

@@ -0,0 +1,36 @@
+The following people have helped to make this project what it is today:
+ - Caspian Rychlik-Prince <[email protected]>
+ - Brian Matzon <[email protected]>
+ - Elias Naur <[email protected]>
+ - Ioannis Tsakpinis <[email protected]>
+ - Niels Jørgensen <[email protected]>
+ - Tristan Campbell <[email protected]>
+ - Gregory Pierce <[email protected]>
+ - Luke Holden <[email protected]>
+ - Mark Bernard <[email protected]>
+ - Erik Duijs <[email protected]>
+ - Jos Hirth <[email protected]>
+ - Kevin Glass <[email protected]>
+ - Atsuya Takagi
+ - kappaOne
+ - Simon Felix
+ - Ryan McNally 
+ - Ciardhubh <ciardhubh[at]ciardhubh.de>
+ - Jens von Pilgrim
+ - Ruben Garat
+ 
+additional credits goes to:
+ - Joseph I. Valenzuela [OpenAL stuff]
+ - Lev Povalahev [OpenGL Extensions]
+ - Endolf [Nightly builds and JInput]
+
+The LWJGL project includes files from or depends on the following projects:
+ - OpenGL, SGI - http://opengl.org/
+ - OpenAL, Creative Labs - http://openal.org/
+ - jinput, Sun - https://jinput.dev.java.net/
+ - lzma, p7zip - http://p7zip.sourceforge.net/
+ - JOGL, Sun - http://kenai.com/projects/jogl/pages/Home
+
+Please see the /doc/3rdparty/ directory for licenses.
+
+All trademarks and registered trademarks are the property of their respective owners.

+ 31 - 0
engine/lib/lwjgl/LICENSE

@@ -0,0 +1,31 @@
+/* 
+ * Copyright (c) 2002-2008 Lightweight Java Game Library Project
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are 
+ * met:
+ * 
+ * * Redistributions of source code must retain the above copyright 
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'Light Weight Java Game Library' nor the names of 
+ *   its contributors may be used to endorse or promote products derived 
+ *   from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */

+ 50 - 0
engine/lib/lwjgl/README

@@ -0,0 +1,50 @@
+This is the official readme file for lwjgl.
+
+Unless otherwise stated, all files distributed or in SVN are covered by 
+the license as stated in the LICENSE file. If you have not received this
+file, please download it from the cvs server.
+
+To run some of the included tests:
+ Extract the archive, and cd into directory
+ (please substitute ; and \ according to platform)
+
+  java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\jinput.jar; -Djava.library.path=native\<windows|linux|macosx|solaris> TEST 
+  (this specifies that the jvm should locate the lwjgl native libs in 'native' directory)
+  
+ where TEST is some of the following: 
+ 
+  org.lwjgl.test.WindowCreationTest
+  org.lwjgl.test.SysTest
+  org.lwjgl.test.DisplayTest
+ 
+  org.lwjgl.test.input.MouseCreationTest
+  org.lwjgl.test.input.MouseTest
+  org.lwjgl.test.input.HWCursorTest
+  org.lwjgl.test.input.KeyboardTest
+  org.lwjgl.test.input.TestControllers
+  
+  org.lwjgl.test.openal.ALCTest
+  org.lwjgl.test.openal.OpenALCreationTest
+  org.lwjgl.test.openal.MovingSoundTest
+  org.lwjgl.test.openal.PlayTest
+  org.lwjgl.test.openal.PlayTestMemory
+  org.lwjgl.test.openal.SourceLimitTest
+  org.lwjgl.test.openal.PositionTest
+  org.lwjgl.test.openal.StressTest
+  org.lwjgl.test.openal.SourceLimitTest
+  
+  org.lwjgl.test.opengl.FullScreenWindowedTest
+  org.lwjgl.test.opengl.PbufferTest
+  org.lwjgl.test.opengl.VBOIndexTest
+  org.lwjgl.test.opengl.VBOTest
+  
+  org.lwjgl.test.opengl.pbuffers.PbufferTest
+  
+  org.lwjgl.test.opengl.shaders.ShadersTest
+
+You may also run the Space invaders demo by executing:
+  java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar; -Djava.library.path=native\<windows|linux|macosx|solaris> org.lwjgl.examples.spaceinvaders.Game
+  
+Project Webpage: www.lwjgl.org
+Project Forum: forum.lwjgl.org
+Project SVN: https://java-game-lib.svn.sourceforge.net/svnroot/java-game-lib

BIN
engine/lib/lwjgl/jME3-lwjgl-natives.jar


BIN
engine/lib/lwjgl/jinput.jar


BIN
engine/lib/lwjgl/lwjgl-debug.jar


BIN
engine/lib/lwjgl/lwjgl.jar


+ 25 - 0
engine/lib/lwjgl/lwjgl_hidden_switches.text

@@ -0,0 +1,25 @@
+LWJGL "Hidden" switches:
+
+org.lwjgl.opengl.Display.noinput
+Do not initialize any controls when creating the display
+
+org.lwjgl.opengl.Display.nomouse
+Do not create the mouse when creating the display
+
+org.lwjgl.opengl.Display.nokeyboard
+Do not create the keyboard when creating the display
+
+org.lwjgl.util.Debug
+Whether to output debug info
+
+org.lwjgl.util.NoChecks
+Whether to disable runtime function/buffer checks and state tracking.
+
+org.lwjgl.opengl.Display.allowSoftwareOpenGL
+Whether to allow creation of a software only opengl context
+
+org.lwjgl.opengl.Window.undecorated
+Whether to create an undecorated window (no title bar)
+
+org.lwjgl.input.Mouse.allowNegativeMouseCoords
+Usually mouse is clamped to 0,0 - setting this to true will cause you to get negative values if dragging outside and below or left of window

+ 55 - 0
engine/lib/nblibraries.properties

@@ -0,0 +1,55 @@
+libs.CopyLibs.classpath=\
+    ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
+libs.jbullet.classpath=\
+    ${base}/jbullet/jbullet.jar:\
+    ${base}/jbullet/stack-alloc.jar:\
+    ${base}/jbullet/vecmath.jar
+libs.jheora.classpath=\
+    ${base}/jheora/jheora-jst-debug-0.6.0.jar
+libs.jme3-test-data.classpath=\
+    ${base}/../src/test-data/
+libs.jogg.classpath=\
+    ${base}/jogg/j-ogg-oggd.jar:\
+    ${base}/jogg/j-ogg-vorbisd.jar
+libs.jogl.classpath=\
+    ${base}/jogl/gluegen-rt.jar:\
+    ${base}/jogl/jME3-jogl-natives.jar:\
+    ${base}/jogl/jogl.jar
+libs.jogl2.classpath=\
+    ${base}/jogl2/jogl.all.jar;\
+    ${base}/jogl2/nativewindow.all.jar;\
+    ${base}/jogl2/newt.all.jar;\
+    ${base}/jogl2/gluegen-rt.jar
+libs.junit_4.classpath=\
+    ${base}/junit_4/junit-4.5.jar
+libs.junit_4.javadoc=\
+    ${base}/junit_4/junit-4.5-api.zip
+libs.junit_4.src=\
+    ${base}/junit_4/junit-4.5-src.jar
+libs.JWSAntTasks.classpath=\
+    ${base}/JWSAntTasks/org-netbeans-modules-javawebstart-anttasks.jar
+libs.lwjgl.classpath=\
+    ${base}/lwjgl/jME3-lwjgl-natives.jar;\
+    ${base}/lwjgl/jinput.jar;\
+    ${base}/lwjgl/lwjgl.jar
+libs.niftygui1.2.classpath=\
+    ${base}/niftygui/nifty-1.2-SNAPSHOT.jar;\
+    ${base}/niftygui/nifty-default-controls-1.2-SNAPSHOT.jar;\
+    ${base}/niftygui/nifty-style-black-1.2-SNAPSHOT.jar;\
+    ${base}/niftygui/xmlpull-xpp3-1.1.4c.jar;\
+    ${base}/niftygui/nifty-examples-1.2_small.jar
+libs.niftygui1.3.classpath=\
+    ${base}/niftygui/nifty-1.3-SNAPSHOT.jar;\
+    ${base}/niftygui/nifty-default-controls-1.3-SNAPSHOT.jar;\
+    ${base}/niftygui/nifty-style-black-1.3-SNAPSHOT.jar;\
+    ${base}/niftygui/nifty-style-grey-1.0.jar;\
+    ${base}/niftygui/nifty-examples-1.3-SNAPSHOT.jar;\
+    ${base}/niftygui/xmlpull-xpp3-1.1.4c.jar;\
+    ${base}/niftygui/eventbus-1.4.jar
+libs.swing-layout.classpath=\
+    ${base}/swing-layout/swing-layout-1.0.4.jar
+libs.swing-layout.javadoc=\
+    ${base}/swing-layout/swing-layout-1.0.4-doc.zip
+libs.swing-layout.src=\
+    ${base}/swing-layout/swing-layout-1.0.4-src.zip
+

BIN
engine/lib/niftygui/eventbus-1.4.jar


BIN
engine/lib/niftygui/nifty-1.3-SNAPSHOT.jar


BIN
engine/lib/niftygui/nifty-default-controls-1.3-SNAPSHOT.jar


BIN
engine/lib/niftygui/nifty-examples-1.3-SNAPSHOT.jar


BIN
engine/lib/niftygui/nifty-style-black-1.3-SNAPSHOT.jar


BIN
engine/lib/niftygui/nifty-style-grey-1.0.jar


BIN
engine/lib/niftygui/xmlpull-xpp3-1.1.4c.jar


BIN
engine/lib/swing-layout/swing-layout-1.0.4-doc.zip


BIN
engine/lib/swing-layout/swing-layout-1.0.4-src.zip


BIN
engine/lib/swing-layout/swing-layout-1.0.4.jar


BIN
engine/lib/swingext/swing-layout-1.0.3.jar


+ 26 - 0
engine/master-application.jnlp

@@ -0,0 +1,26 @@
+<jnlp spec="1.0+" codebase="${jnlp.codebase}" href="launch.jnlp">
+    <information>
+        <title>${APPLICATION.TITLE}</title>
+        <vendor>${APPLICATION.VENDOR}</vendor>
+        <homepage href="${APPLICATION.HOMEPAGE}"/>
+        <description>${APPLICATION.DESC}</description>
+        <description kind="short">${APPLICATION.DESC.SHORT}</description>
+<!--${JNLP.ICONS}-->
+    </information>
+<!--${JNLP.UPDATE}-->
+<!--${JNLP.SECURITY}-->
+    <resources>
+<!--${JNLP.RESOURCES.RUNTIME}-->
+<!--${JNLP.RESOURCES.MAIN.JAR}-->
+<!--${JNLP.RESOURCES.JARS}-->
+<jar href='lib/jme3testdata.jar'/>
+<!--${JNLP.RESOURCES.EXTENSIONS}-->
+    </resources>
+    <application-desc main-class="${jnlp.main.class}">
+<!--${JNLP.APPLICATION.ARGS}-->
+    </application-desc>
+    <shortcut online="false">
+  	<desktop />
+  	<menu submenu="jMonkeyEngine 3.0"/>
+    </shortcut>
+</jnlp>

+ 1082 - 0
engine/nbproject/build-impl.xml

@@ -0,0 +1,1082 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - junit compilation
+  - junit execution
+  - junit debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jMonkeyEngine3-impl">
+    <import file="jnlp-impl.xml"/>
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target name="-pre-init-libraries">
+        <property location="./lib/nblibraries.properties" name="libraries.path"/>
+        <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
+        <pathconvert dirsep="/" property="libraries.dir">
+            <path path="${libraries.dir.nativedirsep}"/>
+        </pathconvert>
+        <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
+        <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
+    </target>
+    <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
+        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
+            <filterchain>
+                <replacestring from="$${base}" to="${libraries.dir}"/>
+                <escapeunicode/>
+            </filterchain>
+        </loadproperties>
+    </target>
+    <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
+        <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
+            <filterchain>
+                <replacestring from="$${base}" to="${libraries.dir}"/>
+                <escapeunicode/>
+            </filterchain>
+        </loadproperties>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <available file="${manifest.file}" property="manifest.available"/>
+        <available file="${application.splash}" property="splashscreen.available"/>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class.available"/>
+            </and>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
+            <and>
+                <istrue value="${manifest.available+main.class+mkdist.available}"/>
+                <istrue value="${splashscreen.available}"/>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class+mkdist.available}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
+            <and>
+                <istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.test.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.core.dir}"/>
+                <available file="${src.core-data.dir}"/>
+                <available file="${src.core-plugins.dir}"/>
+                <available file="${src.terrain.dir}"/>
+                <available file="${src.networking.dir}"/>
+                <available file="${src.desktop.dir}"/>
+                <available file="${src.desktop-fx.dir}"/>
+                <available file="${src.games.dir}"/>
+                <available file="${src.jbullet.dir}"/>
+                <available file="${src.niftygui.dir}"/>
+                <available file="${src.jogg.dir}"/>
+                <available file="${src.lwjgl-oal.dir}"/>
+                <available file="${src.lwjgl-ogl.dir}"/>
+                <available file="${src.ogre.dir}"/>
+                <available file="${src.pack.dir}"/>
+                <available file="${src.jheora.dir}"/>
+                <available file="${src.test.dir}"/>
+                <available file="${src.tools.dir}"/>
+                <available file="${src.xml.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <length length="0" string="${endorsed.classpath}" when="greater"/>
+        </condition>
+        <property name="javac.fork" value="false"/>
+        <property name="jar.index" value="false"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.core.dir">Must set src.core.dir</fail>
+        <fail unless="src.core-data.dir">Must set src.core-data.dir</fail>
+        <fail unless="src.core-plugins.dir">Must set src.core-plugins.dir</fail>
+        <fail unless="src.terrain.dir">Must set src.terrain.dir</fail>
+        <fail unless="src.networking.dir">Must set src.networking.dir</fail>
+        <fail unless="src.desktop.dir">Must set src.desktop.dir</fail>
+        <fail unless="src.desktop-fx.dir">Must set src.desktop-fx.dir</fail>
+        <fail unless="src.games.dir">Must set src.games.dir</fail>
+        <fail unless="src.jbullet.dir">Must set src.jbullet.dir</fail>
+        <fail unless="src.niftygui.dir">Must set src.niftygui.dir</fail>
+        <fail unless="src.jogg.dir">Must set src.jogg.dir</fail>
+        <fail unless="src.lwjgl-oal.dir">Must set src.lwjgl-oal.dir</fail>
+        <fail unless="src.lwjgl-ogl.dir">Must set src.lwjgl-ogl.dir</fail>
+        <fail unless="src.ogre.dir">Must set src.ogre.dir</fail>
+        <fail unless="src.pack.dir">Must set src.pack.dir</fail>
+        <fail unless="src.jheora.dir">Must set src.jheora.dir</fail>
+        <fail unless="src.test.dir">Must set src.test.dir</fail>
+        <fail unless="src.tools.dir">Must set src.tools.dir</fail>
+        <fail unless="src.xml.dir">Must set src.xml.dir</fail>
+        <fail unless="test.test.dir">Must set test.test.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete file="${javac.includesfile.binary}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-junit">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <sequential>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <classpath>
+                        <path path="${run.test.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: jMonkeyEngine3 was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean"/>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.core.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.core-data.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.core-plugins.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.terrain.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.networking.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.desktop.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.desktop-fx.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.games.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.jbullet.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.niftygui.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.jogg.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.lwjgl-oal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.lwjgl-ogl.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.ogre.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.pack.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.jheora.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.tools.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.xml.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.core.dir}:${src.core-data.dir}:${src.core-plugins.dir}:${src.terrain.dir}:${src.networking.dir}:${src.desktop.dir}:${src.desktop-fx.dir}:${src.games.dir}:${src.jbullet.dir}:${src.niftygui.dir}:${src.jogg.dir}:${src.lwjgl-oal.dir}:${src.lwjgl-ogl.dir}:${src.ogre.dir}:${src.pack.dir}:${src.jheora.dir}:${src.test.dir}:${src.tools.dir}:${src.xml.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
+        <j2seproject1:jar/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+        <echo>To run this application from the command line without Ant, try:</echo>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <j2seproject3:copylibs>
+            <customize>
+                <attribute name="Main-Class" value="${main.class}"/>
+                <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+            </customize>
+        </j2seproject3:copylibs>
+        <echo>To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo>java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
+        <j2seproject3:copylibs>
+            <customize>
+                <attribute name="Main-Class" value="${main.class}"/>
+            </customize>
+        </j2seproject3:copylibs>
+        <echo>To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo>java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.core.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.core-data.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.core-plugins.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.terrain.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.networking.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.desktop.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.desktop-fx.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.games.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.jbullet.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.niftygui.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.jogg.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.lwjgl-oal.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.lwjgl-ogl.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.ogre.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.pack.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.jheora.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.test.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.tools.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.xml.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+            </fileset>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.core.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.core-data.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.core-plugins.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.terrain.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.networking.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.desktop.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.desktop-fx.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.games.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.jbullet.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.niftygui.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.jogg.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.lwjgl-oal.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.lwjgl-ogl.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.ogre.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.pack.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.jheora.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.test.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.tools.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.xml.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                JUNIT COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.test.dir}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.test.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.test.dir}" srcdir="${test.test.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                JUNIT EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:junit testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:junit excludes="" includes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <!--
+                =======================
+                JUNIT DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
+        <delete file="${test.report.file}"/>
+        <mkdir dir="${build.test.results.dir}"/>
+        <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
+            <customize>
+                <syspropertyset>
+                    <propertyref prefix="test-sys-prop."/>
+                    <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                </syspropertyset>
+                <arg value="${test.class}"/>
+                <arg value="showoutput=true"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
+                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target name="-deps-clean-init" unless="built-clean.properties">
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+        <delete file="${built-clean.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+        <echo level="warn" message="Cycle detected: jMonkeyEngine3 was already built"/>
+    </target>
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-clean.properties}" verbose="false"/>
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>
+        <antcall target="-warn-already-built-clean"/>
+        <propertyfile file="${built-clean.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target name="-check-call-dep">
+        <property file="${call.built.properties}" prefix="already.built."/>
+        <condition property="should.call.dep">
+            <not>
+                <isset property="already.built.${call.subproject}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+            <propertyset>
+                <propertyref prefix="transfer."/>
+                <mapper from="transfer.*" to="*" type="glob"/>
+            </propertyset>
+        </ant>
+    </target>
+</project>

+ 4 - 0
engine/nbproject/configs/JWS_generated.properties

@@ -0,0 +1,4 @@
+$label=Web Start
+$target.debug=jws-debug
+$target.run=jws-run
+compile.on.save.unsupported.javawebstart=true

+ 11 - 0
engine/nbproject/genfiles.properties

@@ -0,0 +1,11 @@
+build.xml.data.CRC32=52f8cb9e
+build.xml.script.CRC32=34d4c2f2
+build.xml.stylesheet.CRC32=958a1d3e
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=759acdca
+nbproject/build-impl.xml.script.CRC32=10762282
+nbproject/[email protected]
+nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
+nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
+nbproject/[email protected]

+ 414 - 0
engine/nbproject/jnlp-impl.xml

@@ -0,0 +1,414 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+Other names may be trademarks of their respective owners.
+
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+particular file as subject to the "Classpath" exception as provided
+by Oracle in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+
+<project name="jnlp-impl" default="default" basedir=".." xmlns:jnlp="http://www.netbeans.org/ns/j2se-project/jnlp">
+
+    <property name="jnlp.file.name.default" value="launch.jnlp"/>
+    <property name="jnlp.dest.dir" location="dist"/>
+    
+    <!-- helper file to create list of arguments, etc. -->
+    <property name="helper.file" location="helper.txt"/>
+    
+    <target name="default">
+        <echo message="Default target is not set, you must specify which target you want to run."/>
+    </target>
+
+    <target name="-init-platform" unless="platform.home">
+        <property name="platform.home" value="${java.home}"/>
+    </target>
+
+    <!-- Main target -->
+
+    <target name="jnlp" depends="-init-filename,-test-jnlp-enabled,-do-jar-jnlp" if="is.jnlp.enabled">
+        <makeurl property="jnlp.local.codebase.url" file="${basedir}/dist" validate="false"/>
+        <antcall target="generate-jnlp"/>
+        <antcall target="generate-html-preview"/>
+    </target>
+
+    <!-- JNLP archiving -->
+
+    <target name="-init-macrodef-jnlp-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/jnlp">
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${tmp.manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}"/>
+                    <manifest>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+
+    <target name="-init-macrodef-extend-manifest">
+        <macrodef name="extend-manifest" uri="http://www.netbeans.org/ns/j2se-project/jnlp">
+            <element name="customize"/>
+            <sequential>
+                <manifest file="${tmp.manifest.file}" mode="update">
+                    <customize/>
+                </manifest>
+            </sequential>
+        </macrodef>
+    </target>
+
+    <target name="-test-jnlp-type" depends="-test-jnlp-enabled" if="is.jnlp.enabled">
+        <condition property="is.applet">
+            <equals arg1="${jnlp.descriptor}" arg2="applet" trim="true"/>
+        </condition>
+        <condition property="is.application">
+            <equals arg1="${jnlp.descriptor}" arg2="application" trim="true"/>
+        </condition>
+        <condition property="is.component">
+            <equals arg1="${jnlp.descriptor}" arg2="component" trim="true"/>
+        </condition>
+        <condition property="is.applet+mkdist.available">
+            <and>
+                <isset property="libs.CopyLibs.classpath"/>
+                <istrue value="${is.applet}"/>
+            </and>
+        </condition>
+        <condition property="is.application+mkdist.available">
+            <and>
+                <isset property="libs.CopyLibs.classpath"/>
+                <istrue value="${is.application}"/>
+            </and>
+        </condition>
+        <condition property="is.component+mkdist.available">
+            <and>
+                <isset property="libs.CopyLibs.classpath"/>
+                <istrue value="${is.component}"/>
+            </and>
+        </condition>
+    </target>
+
+    <target name="-create-tmp-manifest" unless="manifest.file">
+        <property name="tmp.manifest.file" value="${build.dir}/manifest.mf"/>
+        <delete file="${tmp.manifest.file}" failonerror="false"/>
+        <touch file="${tmp.manifest.file}"/>
+    </target>
+
+    <target name="-copy-tmp-manifest" if="manifest.file">
+        <property name="tmp.manifest.file" value="${build.dir}/manifest.mf"/>
+        <copy file="${manifest.file}" tofile="${build.dir}/manifest.mf"/>
+    </target>
+
+    <target name="-set-mixed-code-properties" depends="-check-signing-possible" if="jnlp.signed.true+signjars.task.available">
+        <property name="jnlp.mixed.code" value=""/>
+        <condition property="mixed.code.trusted.only">
+            <equals arg1="trusted_only" arg2="${jnlp.mixed.code}"/>
+        </condition>
+        <condition property="mixed.code.trusted.library">
+            <equals arg1="trusted_library" arg2="${jnlp.mixed.code}"/>
+        </condition>
+    </target>
+
+    <target name="-add-trusted-only-attribute" depends="-set-mixed-code-properties,-init-macrodef-extend-manifest" if="mixed.code.trusted.only">
+        <jnlp:extend-manifest>
+            <customize>
+                <attribute name="Trusted-Only" value="true"/>
+            </customize>
+        </jnlp:extend-manifest>
+    </target>
+
+    <target name="-add-trusted-library-attribute" depends="-set-mixed-code-properties,-init-macrodef-extend-manifest" if="mixed.code.trusted.library">
+        <jnlp:extend-manifest>
+            <customize>
+                <attribute name="Trusted-Library" value="true"/>
+            </customize>
+        </jnlp:extend-manifest>
+    </target>
+    <target name="-do-jar-applet" depends="-test-jnlp-type,-init-macrodef-jnlp-copylibs" if="is.applet+mkdist.available">
+        <jnlp:copylibs/>
+    </target>
+    <target name="-do-jar-jnlp-application" depends="-init-filename,-test-jnlp-type,-init-macrodef-jnlp-copylibs" if="is.application+mkdist.available">
+        <jnlp:copylibs>
+            <customize>
+                <attribute name="Main-Class" value="${main.class}"/>
+            </customize>
+        </jnlp:copylibs>
+        <echo>To run this application from the command line without Ant, try:</echo>
+        <property location="${jnlp.dest.dir}/${jnlp.file}" name="jnlp.file.resolved"/>
+        <echo>javaws "${jnlp.file.resolved}"</echo>
+    </target>
+    <target name="-do-jar-jnlp-component" depends="-test-jnlp-type,-init-macrodef-jnlp-copylibs" if="is.component+mkdist.available">
+        <jnlp:copylibs/>
+    </target>
+    <target name="-do-jar-jnlp" depends="-create-tmp-manifest,-copy-tmp-manifest,-add-trusted-only-attribute,-add-trusted-library-attribute,-do-jar-applet,-do-jar-jnlp-application,-do-jar-jnlp-component"/>
+
+    <!-- Init jnlp filename -->
+    
+    <target name="-init-filename" depends="-check-filename-prop,-set-jnlp-filename-custom,-set-jnlp-filename-default"/>
+    
+    <target name="-set-jnlp-filename-custom" if="jnlp.file.name.set">
+        <property name="jnlp.file" value="${jnlp.file.name}"/>
+    </target>
+    
+    <target name="-set-jnlp-filename-default" unless="jnlp.file.name.set">
+        <property name="jnlp.file" value="${jnlp.file.name.default}"/>
+    </target>
+    
+    <target name="-check-filename-prop">
+        <condition property="jnlp.file.name.set">
+            <and>
+                <isset property="jnlp.file.name"/>
+                <not>
+                    <equals arg1="jnlp.file.name" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+    </target>
+    
+    <!-- Test JNLP enabled-->
+    
+    <target name="-test-jnlp-enabled">
+        <condition property="is.jnlp.enabled">
+            <istrue value="${jnlp.enabled}"/>
+        </condition>
+    </target>
+    
+    <!-- Generating JNLP file -->
+    
+    <target name="generate-jnlp" depends="sign-jars,-test-generate-task-available,-unavailable-generate-task" if="generate.task.available">
+        <taskdef name="generate-jnlp" classname="org.netbeans.modules.javawebstart.anttasks.GenerateJnlpFileTask" 
+            classpath="${libs.JWSAntTasks.classpath}"/>
+        <property name="jnlp.lazy.jars" value=""/>
+        <generate-jnlp destfile="${jnlp.dest.dir}/${jnlp.file}_" template="master-${jnlp.descriptor}.jnlp" destdir="dist" lazyJars="${jnlp.lazy.jars}"/>
+        <antcall target="-strip-empty-lines"/>
+    </target>
+    
+    <target name="-strip-empty-lines">
+        <copy file="${jnlp.dest.dir}/${jnlp.file}_" tofile="${jnlp.dest.dir}/${jnlp.file}" overwrite="true" encoding="UTF-8">
+            <filterchain>
+                <linecontainsregexp>
+                    <regexp pattern=".+"/>
+                </linecontainsregexp>
+            </filterchain>
+        </copy>
+        <delete file="${jnlp.dest.dir}/${jnlp.file}_" failonerror="false"/>
+    </target>
+    
+    <target name="-test-generate-task-available">
+        <available property="generate.task.available" classname="org.netbeans.modules.javawebstart.anttasks.GenerateJnlpFileTask" 
+        classpath="${libs.JWSAntTasks.classpath}"/>
+    </target>
+    
+    <target name="-unavailable-generate-task" unless="generate.task.available">
+        <echo message="Task required to generate JNLP file is missing, probably the library 'JWS Ant Tasks' is missing either from shared folder or from IDE installation."/>
+        <fail/>
+    </target>
+    
+    <!-- Codebase processing -->
+    
+    <target name="-codebase-props-check">
+        <condition property="local.codebase">
+            <or>
+                <not>
+                    <isset property="jnlp.codebase.type"/>
+                </not>
+                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
+            </or>
+        </condition>
+        <condition property="non.user.codebase">
+            <or>
+                <not>
+                    <isset property="jnlp.codebase.type"/>
+                </not>
+                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
+                <equals arg1="${jnlp.codebase.type}" arg2="web" trim="true"/>
+            </or>
+        </condition>
+        <condition property="user.codebase">
+            <equals arg1="${jnlp.codebase.type}" arg2="user" trim="true"/>
+        </condition>
+    </target>
+    
+    <target name="-init-non-user-codebase" if="non.user.codebase">
+        <property name="jnlp.codebase.value" value="${jnlp.codebase.url}"/>
+    </target>
+    
+    <target name="-init-user-codebase" if="user.codebase">
+        <property name="jnlp.codebase.value" value="${jnlp.codebase.user}"/>
+    </target>
+
+    <!-- Security -->
+    
+    <target name="-security-props-check">
+        <condition property="jnlp.signed.true">
+            <istrue value="${jnlp.signed}"/>
+        </condition>
+    </target>
+    
+    <target name="-jnlp-init-keystore" depends="-jnlp-init-keystore-props,-check-keystore-exists" unless="jnlp.signjar.keystore.exists">
+        <echo message="${application.vendor}" file="${helper.file}"/>
+        <loadfile property="application.vendor.filtered" srcfile="${helper.file}">
+            <filterchain>
+                <deletecharacters chars=","/>
+            </filterchain>
+        </loadfile>
+        <delete file="${helper.file}"/>
+        <property name="jnlp.signjar.vendor" value="CN=${application.vendor.filtered}"/>
+        <echo message="Going to create default keystore in ${jnlp.signjar.keystore}"/>
+        <genkey dname="${jnlp.signjar.vendor}" alias="${jnlp.signjar.alias}" keystore="${jnlp.signjar.keystore}"
+            storepass="${jnlp.signjar.storepass}" keypass="${jnlp.signjar.keypass}"/>
+    </target>
+    
+    <target name="-check-keystore-exists">
+        <available property="jnlp.signjar.keystore.exists" file="${jnlp.signjar.keystore}"/>
+    </target>
+    
+    <target name="-jnlp-init-keystore-props">
+        <property name="jnlp.signjar.keystore" value="${basedir}/build/nb-jws.ks"/>
+        <property name="jnlp.signjar.storepass" value="storepass"/>
+        <property name="jnlp.signjar.keypass" value="keypass"/>
+        <property name="jnlp.signjar.alias" value="nb-jws"/>
+    </target>
+
+    <!-- Signing -->
+
+    <target name="-test-signjars-task-available">
+        <available property="signjars.task.available" 
+            classname="org.netbeans.modules.javawebstart.anttasks.SignJarsTask" 
+            classpath="${libs.JWSAntTasks.classpath}"/>
+    </target>
+    
+    <target name="-check-signing-possible" depends="-security-props-check,-test-signjars-task-available,-unavailable-signjars-task">
+        <condition property="jnlp.signed.true+signjars.task.available">
+            <and>
+                <isset property="jnlp.signed.true"/>
+                <isset property="signjars.task.available"/>
+            </and>
+        </condition>
+    </target>
+    
+    <target name="-unavailable-signjars-task" depends="-test-signjars-task-available" unless="signjars.task.available">
+        <echo message="Task required to sign JAR file is missing, probably the library 'JWS Ant Tasks' is missing either from shared folder or from IDE installation. JAR files will not be signed."/>
+    </target>
+
+    <target name="sign-jars" depends="-jnlp-init-keystore,-check-signing-possible" if="jnlp.signed.true+signjars.task.available">
+        <taskdef name="sign-jars" classname="org.netbeans.modules.javawebstart.anttasks.SignJarsTask" 
+            classpath="${libs.JWSAntTasks.classpath}"/>
+        <sign-jars keystore="${jnlp.signjar.keystore}" storepass="${jnlp.signjar.storepass}" 
+                keypass="${jnlp.signjar.keypass}" alias="${jnlp.signjar.alias}" mainjar="${dist.jar}" destdir="dist"
+                codebase="${jnlp.codebase.value}" signedjarsprop="jnlp.signed.jars"
+                componentsprop="jnlp.components">
+            <fileset dir="dist/lib">
+                <include name="*.jar"/>
+            </fileset>
+        </sign-jars>
+    </target>
+    
+    <!-- Running/Debugging -->
+    
+    <target name="jws-run" depends="jar,-verify-jnlp-enabled,-verify-codebase,-init-platform" description="Start javaws execution">
+        <exec executable="${platform.home}/bin/javaws">
+            <arg file="${jnlp.dest.dir}/${jnlp.file}"/>
+        </exec>
+    </target>
+    
+    <target name="jws-debug" if="netbeans.home" depends="jar,-verify-jnlp-enabled,-verify-codebase,-debug-start-debugger,-debug-javaws-debuggee" 
+        description="Debug javaws project in IDE"/>
+        
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+
+    <target name="-debug-javaws-debuggee" depends="-init-debug-args">
+        <exec executable="${java.home}/bin/javaws">
+            <env key="JAVAWS_VM_ARGS" value="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+            <arg file="${jnlp.dest.dir}/${jnlp.file}"/>
+        </exec>
+    </target>
+    
+    <target name="-verify-codebase" depends="-codebase-props-check" unless="local.codebase">
+        <fail message="Project cannot be run with non-local codebase. Open project properties dialog and set Web Start Codebase to Local Execution."/>
+    </target>
+    
+    <target name="-verify-jnlp-enabled" depends="-test-jnlp-enabled" unless="is.jnlp.enabled">
+        <fail message="Project cannot be run with selected Run Configuration when Java Web Start is disabled."/>
+    </target>
+    
+    <!-- Generate simple HTML preview page -->
+
+    <target name="-check-html-preview">
+         <condition property="generate.html.preview">
+             <or>
+                 <equals arg1="${jnlp.descriptor}" arg2="application"/>
+                 <equals arg1="${jnlp.descriptor}" arg2="applet"/>
+             </or>
+         </condition>
+     </target>
+
+    <target name="generate-html-preview" depends="-check-html-preview" if="generate.html.preview">
+        <taskdef name="copy-template-page" classname="org.netbeans.modules.javawebstart.anttasks.CopyTemplatePageTask"
+            classpath="${libs.JWSAntTasks.classpath}"/>
+        <copy-template-page destfile="${jnlp.dest.dir}/launch.html" template="preview-${jnlp.descriptor}.html" destdir="${jnlp.dest.dir}"/>
+    </target>
+    
+</project>

+ 131 - 0
engine/nbproject/profiler-build-impl.xml

@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - profiling
+  - applet profiling
+
+-->
+<project name="-profiler-impl" default="profile" basedir="..">
+    <target name="default" depends="profile" description="Build and profile the project."/>
+    <!--
+    ======================
+    INITIALIZATION SECTION
+    ======================
+    -->
+    <target name="profile-init" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check"/>
+    <target name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute name="classname" default="${main.class}"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java fork="true" classname="@{classname}" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}">
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper type="glob" from="run-sys-prop.*" to="*"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-profile-init-check" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <!--
+    =================
+    PROFILING SECTION
+    =================
+    -->
+    <target name="profile" if="netbeans.home" depends="profile-init,compile" description="Profile a project in the IDE.">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target name="profile-single" if="netbeans.home" depends="profile-init,compile-single" description="Profile a selected class in the IDE.">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <!--
+    =========================
+    APPLET PROFILING  SECTION
+    =========================
+    -->
+    <target name="profile-applet" if="netbeans.home" depends="profile-init,compile-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <!--
+    =========================
+    TESTS PROFILING  SECTION
+    =========================
+    -->
+    <target name="profile-test-single" if="netbeans.home" depends="profile-init,compile-test-single">
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit showoutput="true" fork="true" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}" failureproperty="tests.failed" errorproperty="tests.failed">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper type="glob" from="test-sys-prop.*" to="*"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+</project>

+ 107 - 0
engine/nbproject/project.properties

@@ -0,0 +1,107 @@
+annotation.processing.enabled=false
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+ant.customtasks.libs=JWSAntTasks
+application.homepage=http://www.jmonkeyengine.com/
+application.title=jMonkeyEngine 3.0
+application.vendor=jMonkeyEngine
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/jMonkeyEngine3.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.src-test-data=src/test-data
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=true
+jar.index=${jnlp.enabled}
+javac.classpath=\
+    ${libs.jogg.classpath}:\
+    ${libs.jbullet.classpath}:\
+    ${libs.lwjgl.classpath}:\
+    ${libs.jheora.classpath}:\
+    ${libs.niftygui1.3.classpath}:\
+    ${libs.jme3-test-data.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=jMonkeyEngine3
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
+jnlp.applet.class=jme3test.awt.AppHarness
+jnlp.applet.height=300
+jnlp.applet.width=300
+jnlp.codebase.type=user
+jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png
+jnlp.mixed.code=defaut
+jnlp.offline-allowed=true
+jnlp.signed=true
+main.class=jme3test.TestChooser
+manifest.file=MANIFEST.MF
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+run.jvmargs=-Xms40m -Xmx40m -XX:MaxDirectMemorySize=256M
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.core-data.dir=src/core-data
+src.core-plugins.dir=src/core-plugins
+src.core.dir=src/core
+src.desktop-fx.dir=src/desktop-fx
+src.desktop.dir=src/desktop
+src.games.dir=src/games
+src.jbullet.dir=src/jbullet
+src.jheora.dir=src/jheora
+src.jogg.dir=src/jogg
+src.lwjgl-oal.dir=src/lwjgl-oal
+src.lwjgl-ogl.dir=src/lwjgl-ogl
+src.networking.dir=src\\networking
+src.niftygui.dir=src/niftygui
+src.ogre.dir=src/ogre
+src.pack.dir=src/pack
+src.terrain.dir=src/terrain
+src.test.dir=src/test
+src.tools.dir=src/tools
+src.xml.dir=src/xml
+test.test.dir=test

+ 42 - 0
engine/nbproject/project.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
+            <extension file="jnlp-impl.xml" id="jws">
+                <dependency dependsOn="jnlp" target="jar"/>
+            </extension>
+        </buildExtensions>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>jMonkeyEngine3</name>
+            <minimum-ant-version>1.6.5</minimum-ant-version>
+            <source-roots>
+                <root id="src.core.dir" name="Core"/>
+                <root id="src.core-data.dir" name="Core-Data"/>
+                <root id="src.core-plugins.dir" name="Core-Plugins"/>
+                <root id="src.terrain.dir" name="Terrain"/>
+                <root id="src.networking.dir" name="Networking"/>
+                <root id="src.desktop.dir" name="Desktop"/>
+                <root id="src.desktop-fx.dir" name="Desktop-FX"/>
+                <root id="src.games.dir" name="Games"/>
+                <root id="src.jbullet.dir" name="JBullet"/>
+                <root id="src.niftygui.dir" name="NiftyGUI"/>
+                <root id="src.jogg.dir" name="JOGG"/>
+                <root id="src.lwjgl-oal.dir" name="LWJGL-OAL"/>
+                <root id="src.lwjgl-ogl.dir" name="LWJGL-OGL"/>
+                <root id="src.ogre.dir" name="Ogre"/>
+                <root id="src.pack.dir" name="Pack"/>
+                <root id="src.jheora.dir" name="Jheora"/>
+                <root id="src.test.dir" name="Test"/>
+                <root id="src.tools.dir" name="Tools"/>
+                <root id="src.xml.dir" name="XML"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.test.dir" name="Unit Test"/>
+            </test-roots>
+        </data>
+        <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
+            <definitions>./lib/nblibraries.properties</definitions>
+        </libraries>
+    </configuration>
+</project>

+ 17 - 0
engine/preview-application.html

@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+    <head>
+        <title>Test page for launching the application via JNLP</title>
+    </head>
+    <body>
+        <h3>Test page for launching the application via JNLP</h3>
+        <script src="http://java.com/js/deployJava.js"></script>
+        <script>
+            deployJava.createWebStartLaunchButton("${JNLP.FILE}")
+        </script>
+        <!-- Or use the following link element to launch with the application -->
+        <!--
+        <a href="${JNLP.FILE}">Launch the application</a>
+        -->
+    </body>
+</html>

BIN
engine/quake3level.zip


+ 20 - 0
engine/src/android/com/jme3/R.java

@@ -0,0 +1,20 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.jme3;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class layout {
+        public static final int main=0x7f020000;
+    }
+    public static final class string {
+        public static final int app_name=0x7f030000;
+        public static final int jme3_appclass=0x7f030001;
+    }
+}

+ 72 - 0
engine/src/android/com/jme3/app/AndroidHarness.java

@@ -0,0 +1,72 @@
+package com.jme3.app;
+
+import android.app.Activity;
+import android.content.res.Resources;
+import android.opengl.GLSurfaceView;
+import android.os.Bundle;
+import android.view.Window;
+import android.view.WindowManager;
+import com.jme3.R;
+import com.jme3.system.AppSettings;
+import com.jme3.system.JmeSystem;
+import com.jme3.system.android.OGLESContext;
+
+/**
+ *
+ * @author Kirill
+ */
+public class AndroidHarness extends Activity {
+
+    private OGLESContext ctx;
+    private GLSurfaceView view;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        JmeSystem.setResources(getResources());
+
+        requestWindowFeature(Window.FEATURE_NO_TITLE);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+        WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
+        AppSettings settings = new AppSettings(true);
+
+//        String appClass = getResources().getString(R.string.jme3_appclass);
+        String appClass = "jme3test.android.Test";
+        Application app = null;
+        try{
+            Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass);
+            app = clazz.newInstance();
+        }catch (Exception ex){
+            ex.printStackTrace();
+        }
+
+        app.setSettings(settings);
+        app.start();
+
+        ctx = (OGLESContext) app.getContext();
+        view = ctx.createView(this);
+   		setContentView(view);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        view.onResume();
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        view.onPause();
+    }
+
+//    @Override
+//    protected void onDestroy(){
+//        super.onDestroy();
+
+//        Debug.stopMethodTracing();
+//    }
+
+}

+ 20 - 0
engine/src/android/com/jme3/app/R.java

@@ -0,0 +1,20 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.jme3.app;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class layout {
+        public static final int main=0x7f020000;
+    }
+    public static final class string {
+        public static final int app_name=0x7f030000;
+        public static final int jme3_appclass=0x7f030001;
+    }
+}

+ 269 - 0
engine/src/android/com/jme3/asset/AndroidAssetManager.java

@@ -0,0 +1,269 @@
+package com.jme3.asset;
+
+import com.jme3.asset.plugins.AndroidLocator;
+import com.jme3.audio.AudioData;
+import com.jme3.audio.AudioKey;
+import com.jme3.export.binary.BinaryExporter;
+import com.jme3.export.binary.BinaryImporter;
+import com.jme3.font.BitmapFont;
+import com.jme3.font.plugins.BitmapFontLoader;
+import com.jme3.material.Material;
+import com.jme3.material.plugins.J3MLoader;
+import com.jme3.scene.Spatial;
+import com.jme3.shader.Shader;
+import com.jme3.shader.ShaderKey;
+import com.jme3.shader.plugins.GLSLLoader;
+import com.jme3.texture.Image;
+import com.jme3.texture.Texture;
+import com.jme3.texture.plugins.AndroidImageLoader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * AssetManager for Android
+ *
+ * @author Kirill Vainer
+ */
+public final class AndroidAssetManager implements AssetManager {
+
+    private static final Logger logger = Logger.getLogger(AndroidAssetManager.class.getName());
+
+    private final AndroidLocator locator = new AndroidLocator();
+    private final AndroidImageLoader imageLoader = new AndroidImageLoader();
+    private final BinaryImporter modelLoader = new BinaryImporter();
+    private final BitmapFontLoader fontLoader = new BitmapFontLoader();
+    private final J3MLoader j3mLoader = new J3MLoader();
+    private final J3MLoader j3mdLoader = new J3MLoader();
+    private final GLSLLoader glslLoader = new GLSLLoader();
+
+    private final BinaryExporter exporter = new BinaryExporter();
+    private final HashMap<AssetKey, Object> cache = new HashMap<AssetKey, Object>();
+
+    public AndroidAssetManager(){
+        this(false);
+    }
+
+    public AndroidAssetManager(boolean loadDefaults){
+        if (loadDefaults){
+//            AssetConfig cfg = new AssetConfig(this);
+//            InputStream stream = AssetManager.class.getResourceAsStream("Desktop.cfg");
+//            try{
+//                cfg.loadText(stream);
+//            }catch (IOException ex){
+//                logger.log(Level.SEVERE, "Failed to load asset config", ex);
+//            }finally{
+//                if (stream != null)
+//                    try{
+//                        stream.close();
+//                    }catch (IOException ex){
+//                    }
+//            }
+        }
+        logger.info("AndroidAssetManager created.");
+    }
+
+    public void registerLoader(String loaderClass, String ... extensions){
+    }
+
+    public void registerLocator(String rootPath, String locatorClass, String ... extensions){
+    }
+
+    private Object tryLoadFromHD(AssetKey key){
+        if (!key.getExtension().equals("fnt"))
+            return null;
+
+        File f = new File("/sdcard/" + key.getName() + ".opt");
+        if (!f.exists())
+            return null;
+
+        try {
+            InputStream stream = new FileInputStream(f);
+            BitmapFont font = (BitmapFont) modelLoader.load(stream, null, null);
+            stream.close();
+            return font;
+        } catch (IOException ex){
+        }
+
+        return null;
+    }
+
+    private void tryPutToHD(AssetKey key, Object data){
+        if (!key.getExtension().equals("fnt"))
+            return;
+
+        File f = new File("/sdcard/" + key.getName() + ".opt");
+
+        try {
+            BitmapFont font = (BitmapFont) data;
+            OutputStream stream = new FileOutputStream(f);
+            exporter.save(font, stream);
+            stream.close();
+        } catch (IOException ex){
+        }
+    }
+
+    public Object loadAsset(AssetKey key){
+	logger.info("loadAsset(" + key + ")");
+        Object asset;
+//        Object asset = tryLoadFromHD(key);
+//        if (asset != null)
+//            return asset;
+
+        if (key.shouldCache()){
+            asset = cache.get(key);
+            if (asset != null)
+                return key.createClonedInstance(asset);
+        }
+        // find resource
+        AssetInfo info = locator.locate(this, key);
+        if (info == null){
+            logger.log(Level.WARNING, "Cannot locate resource: "+key.getName());
+            return null;
+        }
+
+        String ex = key.getExtension();
+        logger.log(Level.INFO, "Loading asset: "+key.getName());
+        try{
+            if (ex.equals("png") || ex.equals("jpg") 
+             || ex.equals("jpeg") || ex.equals("j3i")){
+                Image image;
+                if (ex.equals("j3i")){
+                    image = (Image) modelLoader.load(info);
+                }else{
+                    image = (Image) imageLoader.load(info);
+                }
+                TextureKey tkey = (TextureKey) key;
+                asset = image;
+                Texture tex = (Texture) tkey.postProcess(asset);
+                tex.setMagFilter(Texture.MagFilter.Nearest);
+                tex.setAnisotropicFilter(0);
+                if (tex.getMinFilter().usesMipMapLevels()){
+                    tex.setMinFilter(Texture.MinFilter.NearestNearestMipMap);
+                }else{
+                    tex.setMinFilter(Texture.MinFilter.NearestNoMipMaps);
+                }
+                asset = tex;
+            }else if (ex.equals("j3o")){
+                asset = modelLoader.load(info);
+            }else if (ex.equals("fnt")){
+                asset = fontLoader.load(info);
+            }else if (ex.equals("j3md")){
+                asset = j3mdLoader.load(info);
+            }else if (ex.equals("j3m")){
+                asset = j3mLoader.load(info);
+            }else{
+		logger.info("loading asset as glsl shader ...");
+		asset = glslLoader.load(info);
+               // logger.log(Level.WARNING, "No loader registered for type: "+ex);
+               // return null;
+            }
+
+            if (key.shouldCache())
+                cache.put(key, asset);
+
+//            tryPutToHD(key, asset);
+
+            return key.createClonedInstance(asset);
+        } catch (Exception e){
+            logger.log(Level.WARNING, "Failed to load resource: "+key.getName(), e);
+        }
+        return null;
+    }
+
+    public AssetInfo locateAsset(AssetKey<?> key){
+        AssetInfo info = locator.locate(this, key);
+        if (info == null){
+            logger.log(Level.WARNING, "Cannot locate resource: "+key.getName());
+            return null;
+        }
+	return info;
+    }
+
+
+
+
+    public Object loadAsset(String name) {
+        return loadAsset(new AssetKey(name));
+    }
+
+    public Spatial loadModel(String name) {
+        return (Spatial) loadAsset(name);
+    }
+
+    public Material loadMaterial(String name) {
+        return (Material) loadAsset(name);
+    }
+
+    public BitmapFont loadFont(String name){
+        return (BitmapFont) loadAsset(name);
+    }
+
+    public Texture loadTexture(TextureKey key){
+        return (Texture) loadAsset(key);
+    }
+
+    public Texture loadTexture(String name){
+        return loadTexture(new TextureKey(name, false));
+    }
+
+	public Shader loadShader(ShaderKey key){
+		logger.info("loadShader(" + key + ")");
+
+		String vertName = key.getVertName();
+		String fragName = key.getFragName();
+
+		String vertSource = (String) loadAsset(new AssetKey(vertName));
+		String fragSource = (String) loadAsset(new AssetKey(fragName));
+
+		Shader s = new Shader(key.getLanguage());
+		s.addSource(Shader.ShaderType.Vertex,   vertName, vertSource, key.getDefines().getCompiled());
+		s.addSource(Shader.ShaderType.Fragment, fragName, fragSource, key.getDefines().getCompiled());
+
+		logger.info("returing shader: [" + s + "]");
+		return s;
+	}
+
+
+    public void registerLocator(String rootPath, String locatorClassName) {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public AudioData loadAudio(AudioKey key) {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public AudioData loadAudio(String name) {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public Spatial loadModel(ModelKey key) {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+	/* new */
+
+    private AssetEventListener eventListener = null;
+
+    public void setAssetEventListener(AssetEventListener listener){
+        eventListener = listener;
+    }
+
+    public void registerLocator(String rootPath, Class<? extends AssetLocator> locatorClass){
+	logger.warning("not implemented.");
+    }
+
+    public void registerLoader(Class<? extends AssetLoader> loader, String ... extensions){
+	logger.warning("not implemented.");
+    }
+
+  
+
+
+}

+ 62 - 0
engine/src/android/com/jme3/asset/plugins/AndroidLocator.java

@@ -0,0 +1,62 @@
+package com.jme3.asset.plugins;
+
+import android.content.res.AssetManager;
+import android.content.res.Resources;
+import com.jme3.asset.AssetInfo;
+import com.jme3.asset.AssetKey;
+import com.jme3.asset.AssetLocator;
+import com.jme3.system.JmeSystem;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.logging.Logger;
+
+public class AndroidLocator implements AssetLocator {
+
+    private static final Logger logger = Logger.getLogger(AndroidLocator.class.getName());
+    private Resources resources;
+    private AssetManager androidManager;
+
+    private class AndroidAssetInfo extends AssetInfo {
+
+        private final InputStream in;
+
+        public AndroidAssetInfo(com.jme3.asset.AssetManager manager, AssetKey key,
+                InputStream in){
+            super(manager, key);
+            this.in = in;
+        }
+
+        @Override
+        public InputStream openStream() {
+            return in;
+        }
+    }
+
+
+    public AndroidLocator(){
+        resources = JmeSystem.getResources();
+        androidManager = resources.getAssets();
+    }
+    
+    public void setRootPath(String rootPath) {
+    }
+
+    public AssetInfo locate(com.jme3.asset.AssetManager manager, AssetKey key) {
+        InputStream in = null;
+        try {
+            in = androidManager.open(key.getName());
+            if (in == null)
+                return null;
+
+            return new AndroidAssetInfo(manager, key, in);
+        } catch (IOException ex) {
+            if (in != null)
+                try {
+                    in.close();
+                } catch (IOException ex1) {
+                }
+        }
+        return null;
+    }
+
+}

+ 448 - 0
engine/src/android/com/jme3/input/android/AndroidInput.java

@@ -0,0 +1,448 @@
+package com.jme3.input.android;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import android.content.Context;
+import android.opengl.GLSurfaceView;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import com.jme3.input.KeyInput;
+import com.jme3.input.MouseInput;
+import com.jme3.input.RawInputListener;
+import com.jme3.input.event.KeyInputEvent;
+import com.jme3.input.event.MouseButtonEvent;
+import com.jme3.input.event.MouseMotionEvent;
+
+public class AndroidInput extends GLSurfaceView implements KeyInput, MouseInput {
+    
+    private RawInputListener listener;
+    private int lastX = -1, lastY = -1;
+
+    private static final char[] ANDROID_TO_JME_CHR = {
+        0x0,// unknown
+        0x0,// soft left
+        0x0,// soft right
+        0x0,// home
+        0x0,// back
+        0x0,// call
+        0x0,// endcall
+        '0',
+        '1',
+        '2',
+        '3',
+        '4',
+        '5',
+        '6',
+        '7',
+        '8',
+        '9',
+        '*',
+        '#',
+        0x0,//dpad_up
+        0x0,//dpad_down
+        0x0,//dpad_left
+        0x0,//dpad_right
+        0x0,//dpad_center
+        0x0,//volume up
+        0x0,//volume down
+        0x0,//power
+        0x0,//camera
+        0x0,//clear
+        'a',
+        'b',
+        'c',
+        'd',
+        'e',
+        'f',
+        'g',
+        'h',
+        'i',
+        'j',
+        'k',
+        'l',
+        'm',
+        'n',
+        'o',
+        'p',
+        'q',
+        'r',
+        's',
+        't',
+        'u',
+        'v',
+        'w',
+        'x',
+        'y',
+        'z',
+        ',',
+        '.',
+
+        0x0,//left alt
+        0x0,//right alt
+        0x0,//left ctrl
+        0x0,//right ctrl
+
+//        0x0,//fn
+//        0x0,//cap
+
+        '\t',
+        ' ',
+        0x0,//sym(bol)
+        0x0,//explorer
+        0x0,//envelope
+        '\n',//newline
+        0x0,//delete
+        '`',
+        '-',
+        '=',
+        '[',
+        ']',
+        '\\',//backslash
+        ';',
+        '\'',//apostrophe
+        '/',//slash
+        '@',//at
+        0x0,//num
+        0x0,//headset hook
+        0x0,//focus
+        0x0,
+        0x0,//menu
+        0x0,//notification
+        0x0,//search
+        0x0,//media play/pause
+        0x0,//media stop
+        0x0,//media next
+        0x0,//media previous
+        0x0,//media rewind
+        0x0,//media fastforward
+        0x0,//mute
+    };
+
+    private static final int[] ANDROID_TO_JME = {
+        0x0, // unknown
+        0x0, // key code soft left
+        0x0, // key code soft right
+        KeyInput.KEY_HOME,
+        KeyInput.KEY_ESCAPE, // key back
+        0x0, // key call
+        0x0, // key endcall
+        KeyInput.KEY_0,
+        KeyInput.KEY_1,
+        KeyInput.KEY_2,
+        KeyInput.KEY_3,
+        KeyInput.KEY_4,
+        KeyInput.KEY_5,
+        KeyInput.KEY_6,
+        KeyInput.KEY_7,
+        KeyInput.KEY_8,
+        KeyInput.KEY_9,
+        KeyInput.KEY_MULTIPLY,
+        0x0, // key pound
+        KeyInput.KEY_UP,
+        KeyInput.KEY_DOWN,
+        KeyInput.KEY_LEFT,
+        KeyInput.KEY_RIGHT,
+        KeyInput.KEY_RETURN, // dpad center
+        0x0, // volume up
+        0x0, // volume down
+        KeyInput.KEY_POWER, // power (?)
+        0x0, // camera
+        0x0, // clear
+        KeyInput.KEY_A,
+        KeyInput.KEY_B,
+        KeyInput.KEY_C,
+        KeyInput.KEY_D,
+        KeyInput.KEY_E,
+        KeyInput.KEY_F,
+        KeyInput.KEY_G,
+        KeyInput.KEY_H,
+        KeyInput.KEY_I,
+        KeyInput.KEY_J,
+        KeyInput.KEY_K,
+        KeyInput.KEY_L,
+        KeyInput.KEY_M,
+        KeyInput.KEY_N,
+        KeyInput.KEY_O,
+        KeyInput.KEY_P,
+        KeyInput.KEY_Q,
+        KeyInput.KEY_R,
+        KeyInput.KEY_S,
+        KeyInput.KEY_T,
+        KeyInput.KEY_U,
+        KeyInput.KEY_V,
+        KeyInput.KEY_W,
+        KeyInput.KEY_X,
+        KeyInput.KEY_Y,
+        KeyInput.KEY_Z,
+        KeyInput.KEY_COMMA,
+        KeyInput.KEY_PERIOD,
+
+        KeyInput.KEY_LMENU,
+        KeyInput.KEY_RMENU,
+
+        KeyInput.KEY_LSHIFT,
+        KeyInput.KEY_RSHIFT,
+
+//        0x0, // fn
+//        0x0, // cap (?)
+
+        KeyInput.KEY_TAB,
+        KeyInput.KEY_SPACE,
+        0x0, // sym (?) symbol
+        0x0, // explorer
+        0x0, // envelope
+        KeyInput.KEY_RETURN, // newline/enter
+        KeyInput.KEY_DELETE,
+        KeyInput.KEY_GRAVE,
+        KeyInput.KEY_MINUS,
+        KeyInput.KEY_EQUALS,
+
+        KeyInput.KEY_LBRACKET,
+        KeyInput.KEY_RBRACKET,
+
+        KeyInput.KEY_BACKSLASH,
+        KeyInput.KEY_SEMICOLON,
+        KeyInput.KEY_APOSTROPHE,
+        KeyInput.KEY_SLASH,
+        KeyInput.KEY_AT, // at (@)
+        KeyInput.KEY_NUMLOCK, //0x0, // num
+        0x0, //headset hook
+        0x0, //focus
+        KeyInput.KEY_ADD,
+        KeyInput.KEY_LMETA, //menu
+        0x0,//notification
+        0x0,//search
+        0x0,//media play/pause
+        0x0,//media stop
+        0x0,//media next
+        0x0,//media previous
+        0x0,//media rewind
+        0x0,//media fastforward
+        0x0,//mute
+    };
+
+//    private int[] keyMap = {
+//        0x0,
+//        KeyEvent.KEYCODE_BACK, // ESC key
+//
+//        KeyEvent.KEYCODE_1,
+//        KeyEvent.KEYCODE_2,
+//        KeyEvent.KEYCODE_3,
+//        KeyEvent.KEYCODE_4,
+//        KeyEvent.KEYCODE_5,
+//        KeyEvent.KEYCODE_6,
+//        KeyEvent.KEYCODE_7,
+//        KeyEvent.KEYCODE_8,
+//        KeyEvent.KEYCODE_9,
+//        KeyEvent.KEYCODE_0,
+//        KeyEvent.KEYCODE_MINUS,
+//        KeyEvent.KEYCODE_EQUALS,
+//        KeyEvent.KEYCODE_BACK,
+//        KeyEvent.KEYCODE_TAB,
+//        KeyEvent.KEYCODE_Q,
+//        KeyEvent.KEYCODE_W,
+//        KeyEvent.KEYCODE_E,
+//        KeyEvent.KEYCODE_R,
+//        KeyEvent.KEYCODE_T,
+//        KeyEvent.KEYCODE_Y,
+//        KeyEvent.KEYCODE_U,
+//        KeyEvent.KEYCODE_I,
+//        KeyEvent.KEYCODE_O,
+//        KeyEvent.KEYCODE_P,
+//        KeyEvent.KEYCODE_LEFT_BRACKET,
+//        KeyEvent.KEYCODE_RIGHT_BRACKET,
+//        KeyEvent.KEYCODE_ENTER,
+//        KeyEvent.KEYCODE_SOFT_LEFT, // Left Ctrl
+//        KeyEvent.KEYCODE_A,
+//        KeyEvent.KEYCODE_S,
+//        KeyEvent.KEYCODE_D,
+//        KeyEvent.KEYCODE_F,
+//        KeyEvent.KEYCODE_G,
+//        KeyEvent.KEYCODE_H,
+//        KeyEvent.KEYCODE_J,
+//        KeyEvent.KEYCODE_K,
+//        KeyEvent.KEYCODE_L,
+//        KeyEvent.KEYCODE_SEMICOLON,
+//        KeyEvent.KEYCODE_APOSTROPHE,
+//        KeyEvent.KEYCODE_GRAVE,
+//        KeyEvent.KEYCODE_SHIFT_LEFT,
+//        KeyEvent.KEYCODE_BACKSLASH,
+//        KeyEvent.KEYCODE_Z,
+//        KeyEvent.KEYCODE_X,
+//        KeyEvent.KEYCODE_C,
+//        KeyEvent.KEYCODE_V,
+//        KeyEvent.KEYCODE_B,
+//        KeyEvent.KEYCODE_N,
+//        KeyEvent.KEYCODE_M,
+//
+//        KeyEvent.KEYCODE_COMMA,
+//        KeyEvent.KEYCODE_PERIOD,
+//        KeyEvent.KEYCODE_SLASH,
+//        KeyEvent.KEYCODE_SHIFT_RIGHT,
+//        KeyEvent.KEYCODE_STAR,
+//
+//        KeyEvent.KEYCODE_ALT_LEFT,
+//        KeyEvent.KEYCODE_SPACE,
+//
+//        0x0, // no caps lock
+//
+//        0x0, // F1
+//        0x0, // F2
+//        0x0, // F3
+//        0x0, // F4
+//        0x0, // F5
+//        0x0, // F6
+//        0x0, // F7
+//        0x0, // F8
+//        0x0, // F9
+//        0x0, // F10
+//
+//        KeyEvent.KEYCODE_NUM,
+//        0x0, // scroll lock
+//
+//        0x0, // numpad7
+//        0x0, // numpad8
+//        0x0, // numpad9
+//
+//        KeyEvent.
+//    }
+
+    public AndroidInput(Context ctx, AttributeSet attribs){
+        super(ctx, attribs);
+    }
+
+    public AndroidInput(Context ctx){
+        super(ctx);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent motionEvent){
+	int newX = getWidth() - (int) motionEvent.getX();
+	int newY = (int) motionEvent.getY();
+
+
+        switch (motionEvent.getAction()){
+            case MotionEvent.ACTION_DOWN:
+                MouseButtonEvent btn = new MouseButtonEvent(0, true, newX, newY);
+                btn.setTime(motionEvent.getEventTime());
+		processEvent(btn);
+               // listener.onMouseButtonEvent(btn);
+                lastX = -1;
+                lastY = -1;
+                return true;
+            case MotionEvent.ACTION_UP:
+                MouseButtonEvent btn2 = new MouseButtonEvent(0, false, newX, newY);
+                btn2.setTime(motionEvent.getEventTime());
+		processEvent(btn2);
+               // listener.onMouseButtonEvent(btn2);
+                lastX = -1;
+                lastY = -1;
+                return true;
+            case MotionEvent.ACTION_MOVE:
+               // int newX = getWidth() - (int) motionEvent.getX();
+               // int newY = (int) motionEvent.getY();
+                int dx;
+                int dy;
+                if (lastX != -1){
+                    dx = newX - lastX;
+                    dy = newY - lastY;
+                }else{
+                    dx = 0;
+                    dy = 0;
+                }
+                lastX = newX;
+                lastY = newY;
+                MouseMotionEvent mot = new MouseMotionEvent(newX, newY, dx, dy, 0, 0);
+                mot.setTime(motionEvent.getEventTime());
+		processEvent(mot);
+                //listener.onMouseMotionEvent(mot);
+                try{
+                    Thread.sleep(15);
+                } catch (InterruptedException ex) {
+                }
+                return true;
+        }
+        return false;
+    }
+
+    @Override
+    public boolean onKeyDown (int keyCode, KeyEvent event) {
+        int jmeCode  = ANDROID_TO_JME[keyCode];
+        String str =  event.getCharacters();
+        char c = str != null && str.length() > 0 ? str.charAt(0) : 0x0;
+        KeyInputEvent evt = new KeyInputEvent(jmeCode, c, true, false);
+	processEvent(evt);
+	//     listener.onKeyEvent(evt);
+        return false;
+    }
+
+    @Override
+    public boolean onKeyUp (int keyCode, KeyEvent event) {
+        int jmeCode  = ANDROID_TO_JME[keyCode];
+        String str =  event.getCharacters();
+        char c = str != null && str.length() > 0 ? str.charAt(0) : 0x0;
+        KeyInputEvent evt = new KeyInputEvent(jmeCode, c, false, false);
+	processEvent(evt);
+        //listener.onKeyEvent(evt);
+        return false;
+    }
+
+    public void setCursorVisible(boolean visible){
+    }
+
+    public int getButtonCount(){
+        return 255;
+    }
+
+    public void initialize() {
+    }
+
+    public void update() {
+		generateEvents();
+    }
+
+    public void destroy() {
+    }
+
+    public boolean isInitialized() {
+        return true;
+    }
+
+	// XXX: android does not have an Event interface?
+	private List<Object> currentEvents = new ArrayList<Object>();
+
+	private final static int MAX_EVENTS = 1024;
+
+	private void processEvent(Object event) {
+		synchronized (currentEvents) {
+			if (currentEvents.size() < MAX_EVENTS)
+				currentEvents.add(event);
+		}
+	}
+
+	private void generateEvents() {
+		synchronized (currentEvents) {
+			for (Object event: currentEvents) {
+				if (event instanceof MouseButtonEvent) {
+              				listener.onMouseButtonEvent((MouseButtonEvent) event);
+				} else if (event instanceof MouseMotionEvent) {
+					listener.onMouseMotionEvent((MouseMotionEvent) event);
+				} else if (event instanceof KeyInputEvent) {
+					listener.onKeyEvent((KeyInputEvent) event);
+				}
+			}
+			currentEvents.clear();
+		}
+	}
+
+    public void setInputListener(RawInputListener listener) {
+        this.listener = listener;
+    }
+
+    public long getInputTimeNanos() {
+        return System.nanoTime();
+    }
+
+}

+ 991 - 0
engine/src/android/com/jme3/renderer/android/OGLESRenderer.java

@@ -0,0 +1,991 @@
+package com.jme3.renderer.android;
+
+import com.jme3.light.DirectionalLight;
+import com.jme3.light.Light;
+import com.jme3.light.LightList;
+import com.jme3.light.PointLight;
+import com.jme3.material.RenderState;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Matrix4f;
+import com.jme3.renderer.Caps;
+import com.jme3.renderer.GLObjectManager;
+import com.jme3.renderer.IDList;
+import com.jme3.renderer.RenderContext;
+import com.jme3.renderer.Renderer;
+import com.jme3.renderer.Statistics;
+import com.jme3.scene.Mesh;
+import com.jme3.scene.Mesh.Mode;
+import com.jme3.scene.VertexBuffer;
+import com.jme3.scene.VertexBuffer.Type;
+import com.jme3.scene.VertexBuffer.Usage;
+import com.jme3.shader.Shader;
+import com.jme3.shader.Shader.ShaderSource;
+import com.jme3.texture.FrameBuffer;
+import com.jme3.texture.Image;
+import com.jme3.texture.Texture;
+import com.jme3.texture.Texture.WrapAxis;
+import com.jme3.util.BufferUtils;
+import com.jme3.util.IntMap;
+import com.jme3.util.IntMap.Entry;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.logging.Logger;
+import javax.microedition.khronos.opengles.GL10;
+import javax.microedition.khronos.opengles.GL11;
+import javax.microedition.khronos.opengles.GL11Ext;
+
+public final class OGLESRenderer implements Renderer {
+
+    private static final Logger logger = Logger.getLogger(OGLESRenderer.class.getName());
+
+    private Matrix4f worldMatrix = new Matrix4f();
+    private Matrix4f viewMatrix = new Matrix4f();
+    private Matrix4f projMatrix = new Matrix4f();
+    private FloatBuffer fb16 = BufferUtils.createFloatBuffer(16);
+    private float[] fa16 = new float[16];
+    private IntBuffer intBuf1 = BufferUtils.createIntBuffer(1);
+    private GL10 gl;
+    private GL11 gl11;
+    private GL11Ext glExt;
+
+    private RenderContext context = new RenderContext();
+    private GLObjectManager objManager = new GLObjectManager();
+
+    private EnumSet<Caps> caps = EnumSet.noneOf(Caps.class);
+    private boolean powerOf2 = false;
+
+    private final Statistics statistics = new Statistics();
+    private int vpX, vpY, vpW, vpH;
+
+    public OGLESRenderer(GL10 gl){
+        setGL(gl);
+    }
+
+    public void setGL(GL10 gl){
+        this.gl = gl;
+        if (gl instanceof GL11){
+            gl11 = (GL11) gl;
+            if (gl instanceof GL11Ext){
+                glExt = (GL11Ext) gl;
+            }
+        }
+    }
+
+    public void initialize(){
+        logger.info("Vendor: "+gl.glGetString(gl.GL_VENDOR));
+        logger.info("Renderer: "+gl.glGetString(gl.GL_RENDERER));
+        logger.info("Version: "+gl.glGetString(gl.GL_VERSION));
+
+        String extensions = gl.glGetString(gl.GL_EXTENSIONS);
+        if (extensions.contains("GL_OES_texture_npot"))
+            powerOf2 = true;
+        
+        applyRenderState(RenderState.DEFAULT);
+//        gl.glClearDepthf(1.0f);
+        gl.glDisable(GL10.GL_DITHER);
+        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
+    }
+
+    public Statistics getStatistics() {
+        return null;
+    }
+
+    public void setClipRect(int x, int y, int width, int height) {
+    }
+
+    public void clearClipRect() {
+    }
+
+    public void resetGLObjects() {
+    }
+
+    public EnumSet<Caps> getCaps() {
+        return caps;
+    }
+
+    public void setBackgroundColor(ColorRGBA color) {
+        gl.glClearColor(color.r, color.g, color.b, color.a);
+    }
+
+    public void cleanup(){
+        objManager.deleteAllObjects(this);
+    }
+
+    public void clearBuffers(boolean color, boolean depth, boolean stencil) {
+        int bits = 0;
+        if (color) bits = gl.GL_COLOR_BUFFER_BIT;
+        if (depth) bits |= gl.GL_DEPTH_BUFFER_BIT;
+        if (stencil) bits |= gl.GL_STENCIL_BUFFER_BIT;
+        if (bits != 0) gl.glClear(bits);
+    }
+
+    public void applyRenderState(RenderState state){
+        // TODO: is wireframe supported under OGL ES?
+
+//        if (state.isWireframe() && !context.wireframe){
+//            gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE);
+//            context.wireframe = true;
+//        }else if (!state.isWireframe() && context.wireframe){
+//            gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
+//            context.wireframe = false;
+//        }
+
+        if (state.isDepthTest() && !context.depthTestEnabled){
+            gl.glEnable(gl.GL_DEPTH_TEST);
+            gl.glDepthFunc(gl.GL_LEQUAL);
+            context.depthTestEnabled = true;
+        }else if (!state.isDepthTest() && context.depthTestEnabled){
+            gl.glDisable(gl.GL_DEPTH_TEST);
+            context.depthTestEnabled = false;
+        }
+        if (state.isAlphaTest() && !context.alphaTestEnabled){
+            gl.glEnable(gl.GL_ALPHA_TEST);
+            gl.glAlphaFunc(gl.GL_GREATER, state.getAlphaFallOff());
+            context.alphaTestEnabled = true;
+        }else if (!state.isAlphaTest() && context.alphaTestEnabled){
+            gl.glDisable(gl.GL_ALPHA_TEST);
+            context.alphaTestEnabled = false;
+        }
+        if (state.isDepthWrite() && !context.depthWriteEnabled){
+            gl.glDepthMask(true);
+            context.depthWriteEnabled = true;
+        }else if (!state.isDepthWrite() && context.depthWriteEnabled){
+            gl.glDepthMask(false);
+            context.depthWriteEnabled = false;
+        }
+        if (state.isColorWrite() && !context.colorWriteEnabled){
+            gl.glColorMask(true,true,true,true);
+            context.colorWriteEnabled = true;
+        }else if (!state.isColorWrite() && context.colorWriteEnabled){
+            gl.glColorMask(false,false,false,false);
+            context.colorWriteEnabled = false;
+        }
+        if (state.isPolyOffset()){
+            if (!context.polyOffsetEnabled){
+                gl.glEnable(gl.GL_POLYGON_OFFSET_FILL);
+                gl.glPolygonOffset(state.getPolyOffsetFactor(),
+                                state.getPolyOffsetUnits());
+                context.polyOffsetEnabled = true;
+                context.polyOffsetFactor = state.getPolyOffsetFactor();
+                context.polyOffsetUnits = state.getPolyOffsetUnits();
+            }else{
+                if (state.getPolyOffsetFactor() != context.polyOffsetFactor
+                 || state.getPolyOffsetUnits() != context.polyOffsetUnits){
+                    gl.glPolygonOffset(state.getPolyOffsetFactor(),
+                                    state.getPolyOffsetUnits());
+                    context.polyOffsetFactor = state.getPolyOffsetFactor();
+                    context.polyOffsetUnits = state.getPolyOffsetUnits();
+                }
+            }
+        }else{
+            if (context.polyOffsetEnabled){
+                gl.glDisable(gl.GL_POLYGON_OFFSET_FILL);
+                context.polyOffsetEnabled = false;
+                context.polyOffsetFactor = 0;
+                context.polyOffsetUnits = 0;
+            }
+        }
+        if (state.getFaceCullMode() != context.cullMode){
+            if (state.getFaceCullMode() == RenderState.FaceCullMode.Off)
+                gl.glDisable(gl.GL_CULL_FACE);
+            else
+                gl.glEnable(gl.GL_CULL_FACE);
+
+            switch (state.getFaceCullMode()){
+                case Off:
+                    break;
+                case Back:
+                    gl.glCullFace(gl.GL_BACK);
+                    break;
+                case Front:
+                    gl.glCullFace(gl.GL_FRONT);
+                    break;
+                case FrontAndBack:
+                    gl.glCullFace(gl.GL_FRONT_AND_BACK);
+                    break;
+                default:
+                    throw new UnsupportedOperationException("Unrecognized face cull mode: "+
+                                                            state.getFaceCullMode());
+            }
+
+            context.cullMode = state.getFaceCullMode();
+        }
+
+        if (state.getBlendMode() != context.blendMode){
+            if (state.getBlendMode() == RenderState.BlendMode.Off)
+                gl.glDisable(gl.GL_BLEND);
+            else
+                gl.glEnable(gl.GL_BLEND);
+
+            switch (state.getBlendMode()){
+                case Off:
+                    break;
+                case Additive:
+                    gl.glBlendFunc(gl.GL_ONE, gl.GL_ONE);
+                    break;
+                case Alpha:
+                    gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA);
+                    break;
+                case PremultAlpha:
+                    gl.glBlendFunc(gl.GL_ONE, gl.GL_ONE_MINUS_SRC_ALPHA);
+                    break;
+                case Modulate:
+                    gl.glBlendFunc(gl.GL_DST_COLOR, gl.GL_ZERO);
+                    break;
+                case ModulateX2:
+                    gl.glBlendFunc(gl.GL_DST_COLOR, gl.GL_SRC_COLOR);
+                    break;
+                default:
+                    throw new UnsupportedOperationException("Unrecognized blend mode: "+
+                                                            state.getBlendMode());
+            }
+
+            context.blendMode = state.getBlendMode();
+        }
+    }
+
+    public void onFrame() {
+        objManager.deleteUnused(this);
+    }
+
+    public void setDepthRange(float start, float end) {
+        gl.glDepthRangef(start, end);
+    }
+
+    public void setViewPort(int x, int y, int width, int height){
+        gl.glViewport(x, y, width, height);
+        vpX = x;
+        vpY = y;
+        vpW = width;
+        vpH = height;
+    }
+
+    public void setViewProjectionMatrices(Matrix4f viewMatrix, Matrix4f projMatrix){
+        this.viewMatrix.set(viewMatrix);
+        this.projMatrix.set(projMatrix);
+
+        if (context.matrixMode != gl.GL_PROJECTION){
+            gl.glMatrixMode(gl.GL_PROJECTION);
+            context.matrixMode = gl.GL_PROJECTION;
+        }
+
+        projMatrix.fillFloatArray(fa16, true);
+        gl.glLoadMatrixf(fa16, 0);
+
+//        gl.glMatrixMode(gl.GL_MODELVIEW);
+//        gl.glLoadIdentity();
+//        gl.glLoadMatrixf(storeMatrix(viewMatrix, fb16));
+    }
+
+    public void setWorldMatrix(Matrix4f worldMatrix) {
+        this.worldMatrix.set(worldMatrix);
+
+        if (context.matrixMode != gl.GL_MODELVIEW){
+            gl.glMatrixMode(gl.GL_MODELVIEW);
+            context.matrixMode = gl.GL_MODELVIEW;
+        }
+
+        viewMatrix.fillFloatArray(fa16, true);
+        gl.glLoadMatrixf(fa16, 0);
+        worldMatrix.fillFloatArray(fa16, true);
+        gl.glMultMatrixf(fa16, 0);
+    }
+
+    public void setMatrixPalette(Matrix4f[] offsetMatrices){
+        if (glExt == null)
+            throw new UnsupportedOperationException("Requires GL_OES_compressed_paletted_texture");
+
+        if (context.matrixMode != glExt.GL_MATRIX_PALETTE_OES){
+            gl.glMatrixMode(glExt.GL_MATRIX_PALETTE_OES);
+            context.matrixMode = glExt.GL_MATRIX_PALETTE_OES;
+        }
+        
+        for (int i = 0; i < offsetMatrices.length; i++){
+            Matrix4f offsetMat = offsetMatrices[i];
+            glExt.glCurrentPaletteMatrixOES(i);
+
+            offsetMat.fillFloatArray(fa16, true);
+            gl.glLoadMatrixf(fa16, 0);
+        }
+    }
+
+    public void setLighting(LightList list) {
+        if (list.size() == 0) {
+            // turn off lighting
+            gl.glDisable(gl.GL_LIGHTING);
+            return;
+        }
+
+        gl.glEnable(gl.GL_LIGHTING);
+        gl.glShadeModel(gl.GL_SMOOTH);
+
+        float[] temp = new float[4];
+
+        // reset model view to specify
+        // light positions in world space
+        // instead of model space
+        gl.glPushMatrix();
+        gl.glLoadIdentity();
+
+        for (int i = 0; i < list.size()+1; i++){
+            if (list.size() <= i){
+                // goes beyond the num lights we need
+                // disable it
+                gl.glDisable(gl.GL_LIGHT0 + i);
+                break;
+            }
+
+            Light l = list.get(i);
+            int lightId = gl.GL_LIGHT0 + i;
+
+            ColorRGBA color = l.getColor();
+            color.toArray(temp);
+
+            gl.glEnable(lightId);
+            gl.glLightfv(lightId, gl.GL_DIFFUSE,  temp, 0);
+            gl.glLightfv(lightId, gl.GL_SPECULAR, temp, 0);
+
+            ColorRGBA.Black.toArray(temp);
+            gl.glLightfv(lightId, gl.GL_AMBIENT,  temp, 0);
+
+            switch (l.getType()){
+                case Directional:
+                    DirectionalLight dl = (DirectionalLight) l;
+                    dl.getDirection().toArray(temp);
+                    temp[3] = 0f; // marks to GL its a directional light
+                    gl.glLightfv(lightId, gl.GL_POSITION, temp, 0);
+                    break;
+                case Point:
+                    PointLight pl = (PointLight) l;
+                    pl.getPosition().toArray(temp);
+                    temp[3] = 1f; // marks to GL its a point light
+                    gl.glLightfv(lightId, gl.GL_POSITION, temp, 0);
+                    break;
+            }
+
+        }
+
+        // restore modelview to original value
+        gl.glPopMatrix();
+    }
+
+    public void updateShaderSourceData(ShaderSource source) {
+    }
+
+    public void deleteShaderSource(ShaderSource source) {
+    }
+
+    public void updateShaderData(Shader shader) {
+    }
+
+    public void setShader(Shader shader) {
+    }
+
+    public void deleteShader(Shader shader) {
+    }
+
+    public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst) {
+    }
+
+    public void setFrameBuffer(FrameBuffer fb) {
+    }
+
+    public void updateFrameBuffer(FrameBuffer fb) {
+    }
+
+    public void deleteFrameBuffer(FrameBuffer fb) {
+    }
+
+    /**
+     * Warning: documentation states that this method returns data in BGRA format,
+     * it actually returns data in RGBA format.
+     * @param fb
+     * @param byteBuf
+     */
+    public void readFrameBuffer(FrameBuffer fb, ByteBuffer byteBuf) {
+        if (fb == null){
+            gl.glReadPixels(vpX, vpY, vpW, vpH, gl.GL_RGBA, gl.GL_UNSIGNED_BYTE, byteBuf);
+        }else{
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    private int convertTextureType(Texture.Type type){
+        switch (type){
+            case TwoDimensional:
+                return gl.GL_TEXTURE_2D;
+            default:
+                throw new UnsupportedOperationException("Unknown texture type: "+type);
+        }
+    }
+
+    private int convertMagFilter(Texture.MagFilter filter){
+        switch (filter){
+            case Bilinear:
+                return gl.GL_LINEAR;
+            case Nearest:
+                return gl.GL_NEAREST;
+            default:
+                throw new UnsupportedOperationException("Unknown mag filter: "+filter);
+        }
+    }
+
+    private int convertMinFilter(Texture.MinFilter filter){
+        switch (filter){
+            case Trilinear:
+                return gl.GL_LINEAR_MIPMAP_LINEAR;
+            case BilinearNearestMipMap:
+                return gl.GL_LINEAR_MIPMAP_NEAREST;
+            case NearestLinearMipMap:
+                return gl.GL_NEAREST_MIPMAP_LINEAR;
+            case NearestNearestMipMap:
+                return gl.GL_NEAREST_MIPMAP_NEAREST;
+            case BilinearNoMipMaps:
+                return gl.GL_LINEAR;
+            case NearestNoMipMaps:
+                return gl.GL_NEAREST;
+            default:
+                throw new UnsupportedOperationException("Unknown min filter: "+filter);
+        }
+    }
+
+    private int convertWrapMode(Texture.WrapMode mode){
+        switch (mode){
+//            case BorderClamp:
+//                return gl.GL_CLAMP_TO_BORDER;
+//            case Clamp:
+//                return gl.GL_CLAMP;
+            case EdgeClamp:
+                return gl.GL_CLAMP_TO_EDGE;
+            case Repeat:
+                return gl.GL_REPEAT;
+//            case MirroredRepeat:
+//                return gl.GL_MIRRORED_REPEAT;
+            default:
+                throw new UnsupportedOperationException("Unknown wrap mode: "+mode);
+        }
+    }
+
+    public void updateTextureData(Texture tex){
+        int texId = tex.getId();
+        if (texId == -1){
+            // create texture
+            gl.glGenTextures(1, intBuf1);
+            texId = intBuf1.get(0);
+            tex.setId(texId);
+            objManager.registerForCleanup(tex);
+        }
+
+        // bind texture
+        int target = convertTextureType(tex.getType());
+        if (context.boundTextures[0] != tex){
+            if (context.boundTextureUnit != 0){
+                gl.glActiveTexture(gl.GL_TEXTURE0);
+                context.boundTextureUnit = 0;
+            }
+
+            gl.glBindTexture(target, texId);
+            context.boundTextures[0] = tex;
+        }
+
+        // filter things
+        int minFilter = convertMinFilter(tex.getMinFilter());
+        int magFilter = convertMagFilter(tex.getMagFilter());
+        gl.glTexParameterx(target, gl.GL_TEXTURE_MIN_FILTER, minFilter);
+		gl.glTexParameterx(target, gl.GL_TEXTURE_MAG_FILTER, magFilter);
+
+        // repeat modes
+        switch (tex.getType()){
+            case TwoDimensional:
+                gl.glTexParameterx(target, gl.GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));
+                // fall down here is intentional..
+//            case OneDimensional:
+                gl.glTexParameterx(target, gl.GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
+                break;
+            default:
+                throw new UnsupportedOperationException("Unknown texture type: "+tex.getType());
+        }
+
+        Image img = tex.getImage();
+        if (img != null){
+            boolean generateMips = false;
+            if (!img.hasMipmaps() && tex.getMinFilter().usesMipMapLevels()){
+                // No pregenerated mips available,
+                // generate from base level if required
+                if (gl11 != null){
+                    gl.glTexParameterx(target, GL11.GL_GENERATE_MIPMAP, gl.GL_TRUE);
+                }else{
+                    generateMips = true;
+                }
+            }
+            
+            TextureUtil.uploadTexture(gl, img, tex.getImageDataIndex(), generateMips, powerOf2);
+        }
+
+        tex.clearUpdateNeeded();
+    }
+
+    private void checkTexturingUsed(){
+        IDList textureList = context.textureIndexList;
+        // old mesh used texturing, new mesh doesn't use it
+        // should actually go through entire oldLen and
+        // disable texturing for each unit.. but that's for later.
+        if (textureList.oldLen > 0 && textureList.newLen == 0){
+            gl.glDisable(gl.GL_TEXTURE_2D);
+        }
+    }
+
+    public void setTexture(int unit, Texture tex){
+         if (tex.isUpdateNeeded())
+            updateTextureData(tex);
+
+         int texId = tex.getId();
+         assert texId != -1;
+
+         Texture[] textures = context.boundTextures;
+
+         int type = convertTextureType(tex.getType());
+         if (!context.textureIndexList.moveToNew(unit)){
+             if (context.boundTextureUnit != unit){
+                gl.glActiveTexture(gl.GL_TEXTURE0 + unit);
+                context.boundTextureUnit = unit;
+             }
+
+             gl.glEnable(type);
+         }
+
+         if (textures[unit] != tex){
+             if (context.boundTextureUnit != unit){
+                gl.glActiveTexture(gl.GL_TEXTURE0 + unit);
+                context.boundTextureUnit = unit;
+             }
+
+             gl.glBindTexture(type, texId);
+             textures[unit] = tex;
+         }
+    }
+
+    public void clearTextureUnits(){
+        IDList textureList = context.textureIndexList;
+        Texture[] textures = context.boundTextures;
+        for (int i = 0; i < textureList.oldLen; i++){
+            int idx = textureList.oldList[i];
+
+            if (context.boundTextureUnit != idx){
+                gl.glActiveTexture(gl.GL_TEXTURE0 + idx);
+                context.boundTextureUnit = idx;
+            }
+            gl.glDisable(convertTextureType(textures[idx].getType()));
+            textures[idx] = null;
+        }
+        context.textureIndexList.copyNewToOld();
+    }
+
+    public void deleteTexture(Texture tex){
+        int texId = tex.getId();
+        if (texId != -1){
+            intBuf1.put(0, texId);
+            intBuf1.position(0).limit(1);
+            gl.glDeleteTextures(1, intBuf1);
+            tex.resetObject();
+        }
+    }
+
+    private int convertUsage(Usage usage){
+        switch (usage){
+            case Static:
+                return gl11.GL_STATIC_DRAW;
+            case Dynamic:
+            case Stream:
+                return gl11.GL_DYNAMIC_DRAW;
+            default:
+                throw new RuntimeException("Unknown usage type: "+usage);
+        }
+    }
+
+    public void updateBufferData(VertexBuffer vb) {
+        int bufId = vb.getId();
+        if (bufId == -1){
+            // create buffer
+            gl11.glGenBuffers(1, intBuf1);
+            bufId = intBuf1.get(0);
+            vb.setId(bufId);
+            objManager.registerForCleanup(vb);
+        }
+
+        int target;
+        if (vb.getBufferType() == VertexBuffer.Type.Index){
+            target = gl11.GL_ELEMENT_ARRAY_BUFFER;
+            if (context.boundElementArrayVBO != bufId){
+                gl11.glBindBuffer(target, bufId);
+                context.boundElementArrayVBO = bufId;
+            }
+        }else{
+            target = gl11.GL_ARRAY_BUFFER;
+            if (context.boundArrayVBO != bufId){
+                gl11.glBindBuffer(target, bufId);
+                context.boundArrayVBO = bufId;
+            }
+        }
+
+        int usage = convertUsage(vb.getUsage());
+        Buffer data = vb.getData();
+        data.rewind();
+
+        gl11.glBufferData(target,
+                          data.capacity() * vb.getFormat().getComponentSize(),
+                          data,
+                          usage);
+        
+        vb.clearUpdateNeeded();
+    }
+
+    public void deleteBuffer(VertexBuffer vb) {
+        int bufId = vb.getId();
+        if (bufId != -1){
+            // delete buffer
+            intBuf1.put(0, bufId);
+            intBuf1.position(0).limit(1);
+            gl11.glDeleteBuffers(1, intBuf1);
+            vb.resetObject();
+        }
+    }
+
+    private int convertArrayType(VertexBuffer.Type type){
+        switch (type){
+            case Position:
+                return gl.GL_VERTEX_ARRAY;
+            case Normal:
+                return gl.GL_NORMAL_ARRAY;
+            case TexCoord:
+                return gl.GL_TEXTURE_COORD_ARRAY;
+            case Color:
+                return gl.GL_COLOR_ARRAY;
+            default:
+                return -1; // unsupported
+        }
+    }
+
+    private int convertVertexFormat(VertexBuffer.Format fmt){
+        switch (fmt){
+            case Byte:
+                return gl.GL_BYTE;
+            case Float:
+                return gl.GL_FLOAT;
+            case Short:
+                return gl.GL_SHORT;
+            case UnsignedByte:
+                return gl.GL_UNSIGNED_BYTE;
+            case UnsignedShort:
+                return gl.GL_UNSIGNED_SHORT;
+            case Int:
+                return gl.GL_FIXED;
+            default:
+                throw new UnsupportedOperationException("Unrecognized vertex format: "+fmt);
+        }
+    }
+
+    private int convertElementMode(Mesh.Mode mode){
+        switch (mode){
+            case Points:
+                return gl.GL_POINTS;
+            case Lines:
+                return gl.GL_LINES;
+            case LineLoop:
+                return gl.GL_LINE_LOOP;
+            case LineStrip:
+                return gl.GL_LINE_STRIP;
+            case Triangles:
+                return gl.GL_TRIANGLES;
+            case TriangleFan:
+                return gl.GL_TRIANGLE_FAN;
+            case TriangleStrip:
+                return gl.GL_TRIANGLE_STRIP;
+            default:
+                throw new UnsupportedOperationException("Unrecognized mesh mode: "+mode);
+        }
+    }
+
+    private void setVertexAttribVBO(VertexBuffer vb, VertexBuffer idb){
+        int arrayType = convertArrayType(vb.getBufferType());
+        if (arrayType == -1)
+            return; // unsupported
+
+        if (vb.isUpdateNeeded() && idb == null)
+            updateBufferData(vb);
+
+        int bufId = idb != null ? idb.getId() : vb.getId();
+        if (context.boundArrayVBO != bufId){
+            gl11.glBindBuffer(gl11.GL_ARRAY_BUFFER, bufId);
+            context.boundArrayVBO = bufId;
+        }
+
+        gl.glEnableClientState(arrayType);
+        context.boundAttribs[vb.getBufferType().ordinal()] = vb;
+
+        if (vb.getBufferType() == Type.Normal){
+            // normalize if requested
+            if (vb.isNormalized() && !context.normalizeEnabled){
+                gl.glEnable(gl.GL_NORMALIZE);
+                context.normalizeEnabled = true;
+            }else if (!vb.isNormalized() && context.normalizeEnabled){
+                gl.glDisable(gl.GL_NORMALIZE);
+                context.normalizeEnabled = false;
+            }
+        }
+
+        int comps = vb.getNumComponents();
+        int type = convertVertexFormat(vb.getFormat());
+
+        switch (vb.getBufferType()){
+            case Position:
+                gl11.glVertexPointer(comps, type, vb.getStride(), vb.getOffset());
+                break;
+            case Normal:
+                gl11.glNormalPointer(type, vb.getStride(), vb.getOffset());
+                break;
+            case Color:
+                gl11.glColorPointer(comps, type, vb.getStride(), vb.getOffset());
+                break;
+            case TexCoord:
+                gl11.glTexCoordPointer(comps, type, vb.getStride(), vb.getOffset());
+                break;
+        }
+    }
+
+    private void drawTriangleListVBO(VertexBuffer indexBuf, Mesh mesh, int count){
+        if (indexBuf.getBufferType() != VertexBuffer.Type.Index)
+            throw new IllegalArgumentException("Only index buffers are allowed as triangle lists.");
+
+        if (indexBuf.isUpdateNeeded())
+            updateBufferData(indexBuf);
+
+        int bufId = indexBuf.getId();
+        assert bufId != -1;
+
+        if (context.boundElementArrayVBO != bufId){
+            gl11.glBindBuffer(gl11.GL_ELEMENT_ARRAY_BUFFER, bufId);
+            context.boundElementArrayVBO = bufId;
+        }
+
+        if (mesh.getMode() == Mode.Hybrid){
+            int[] modeStart      = mesh.getModeStart();
+            int[] elementLengths = mesh.getElementLengths();
+
+            int elMode = convertElementMode(Mode.Triangles);
+            int fmt    = convertVertexFormat(indexBuf.getFormat());
+            int elSize = indexBuf.getFormat().getComponentSize();
+//            int listStart = modeStart[0];
+            int stripStart = modeStart[1];
+            int fanStart = modeStart[2];
+            int curOffset = 0;
+            for (int i = 0; i < elementLengths.length; i++){
+                if (i == stripStart){
+                    elMode = convertElementMode(Mode.TriangleStrip);
+                }else if (i == fanStart){
+                    elMode = convertElementMode(Mode.TriangleStrip);
+                }
+                int elementLength = elementLengths[i];
+                gl11.glDrawElements(elMode,
+                                    elementLength,
+                                    fmt,
+                                    curOffset);
+                curOffset += elementLength * elSize;
+            }
+        }else{
+            gl11.glDrawElements(convertElementMode(mesh.getMode()),
+                                indexBuf.getData().capacity(),
+                                convertVertexFormat(indexBuf.getFormat()),
+                                0);
+        }
+    }
+
+    public void setVertexAttrib(VertexBuffer vb, VertexBuffer idb) {
+        int arrayType = convertArrayType(vb.getBufferType());
+        if (arrayType == -1)
+            return; // unsupported
+
+        gl.glEnableClientState(arrayType);
+        context.boundAttribs[vb.getBufferType().ordinal()] = vb;
+
+        if (vb.getBufferType() == Type.Normal){
+            // normalize if requested
+            if (vb.isNormalized() && !context.normalizeEnabled){
+                gl.glEnable(gl.GL_NORMALIZE);
+                context.normalizeEnabled = true;
+            }else if (!vb.isNormalized() && context.normalizeEnabled){
+                gl.glDisable(gl.GL_NORMALIZE);
+                context.normalizeEnabled = false;
+            }
+        }
+        
+        // NOTE: Use data from interleaved buffer if specified
+        Buffer data = idb != null ? idb.getData() : vb.getData();
+        int comps = vb.getNumComponents();
+        int type = convertVertexFormat(vb.getFormat());
+        data.clear();
+        data.position(vb.getOffset());
+
+        switch (vb.getBufferType()){
+            case Position:
+                gl.glVertexPointer(comps, type, vb.getStride(), data);
+                break;
+            case Normal:
+                gl.glNormalPointer(type, vb.getStride(), data);
+                break;
+            case Color:
+                gl.glColorPointer(comps, type, vb.getStride(), data);
+                break;
+            case TexCoord:
+                gl.glTexCoordPointer(comps, type, vb.getStride(), data);
+                break;
+        }
+    }
+
+    public void setVertexAttrib(VertexBuffer vb){
+        setVertexAttrib(vb, null);
+    }
+
+    public void clearVertexAttribs() {
+        for (int i = 0; i < 16; i++){
+            VertexBuffer vb = context.boundAttribs[i];
+            if (vb != null){
+                int arrayType = convertArrayType(vb.getBufferType());
+                gl.glDisableClientState(arrayType);
+                context.boundAttribs[vb.getBufferType().ordinal()] = null;
+            }
+        }
+    }
+
+    public void drawTriangleList(VertexBuffer indexBuf, Mesh mesh, int count) {
+        Mesh.Mode mode = mesh.getMode();
+
+        Buffer indexData = indexBuf.getData();
+        indexData.clear();
+        if (mesh.getMode() == Mode.Hybrid){
+            int[] modeStart      = mesh.getModeStart();
+            int[] elementLengths = mesh.getElementLengths();
+
+            int elMode = convertElementMode(Mode.Triangles);
+            int fmt    = convertVertexFormat(indexBuf.getFormat());
+//            int elSize = indexBuf.getFormat().getComponentSize();
+//            int listStart = modeStart[0];
+            int stripStart = modeStart[1];
+            int fanStart = modeStart[2];
+            int curOffset = 0;
+            for (int i = 0; i < elementLengths.length; i++){
+                if (i == stripStart){
+                    elMode = convertElementMode(Mode.TriangleStrip);
+                }else if (i == fanStart){
+                    elMode = convertElementMode(Mode.TriangleStrip);
+                }
+                int elementLength = elementLengths[i];
+                indexData.position(curOffset);
+                gl.glDrawElements(elMode,
+                                  elementLength,
+                                  fmt,
+                                  indexData);
+                curOffset += elementLength;
+            }
+        }else{
+            gl.glDrawElements(convertElementMode(mode),
+                              indexData.capacity(),
+                              convertVertexFormat(indexBuf.getFormat()),
+                              indexData);
+        }
+    }
+
+    private void renderMeshDefault(Mesh mesh, int lod, int count) {
+        VertexBuffer indices = null;
+        VertexBuffer interleavedData = mesh.getBuffer(Type.InterleavedData);
+        IntMap<VertexBuffer> buffers = mesh.getBuffers();
+        if (mesh.getNumLodLevels() > 0){
+            indices = mesh.getLodLevel(lod);
+        }else{
+            indices = buffers.get(Type.Index.ordinal());
+        }
+        for (Entry<VertexBuffer> entry : buffers){
+            VertexBuffer vb = entry.getValue();
+
+            if (vb.getBufferType() == Type.InterleavedData
+             || vb.getUsage() == Usage.CpuOnly) // ignore cpu-only buffers
+                continue;
+
+            if (vb.getBufferType() == Type.Index){
+                indices = vb;
+            }else{
+                if (vb.getStride() == 0){
+                    // not interleaved
+                    setVertexAttrib(vb);
+                }else{
+                    // interleaved
+                    setVertexAttrib(vb, interleavedData);
+                }
+            }
+        }
+
+        if (indices != null){
+            drawTriangleList(indices, mesh, count);
+        }else{
+            gl.glDrawArrays(convertElementMode(mesh.getMode()), 0, mesh.getVertexCount());
+        }
+        clearVertexAttribs();
+        clearTextureUnits();
+    }
+
+    private void renderMeshVBO(Mesh mesh, int lod, int count){
+        VertexBuffer indices = null;
+        VertexBuffer interleavedData = mesh.getBuffer(Type.InterleavedData);
+        if (interleavedData != null && interleavedData.isUpdateNeeded()){
+            updateBufferData(interleavedData);
+        }
+        IntMap<VertexBuffer> buffers = mesh.getBuffers();
+        if (mesh.getNumLodLevels() > 0){
+            indices = mesh.getLodLevel(lod);
+        }else{
+            indices = buffers.get(Type.Index.ordinal());
+        }
+        for (Entry<VertexBuffer> entry : buffers){
+            VertexBuffer vb = entry.getValue();
+
+            if (vb.getBufferType() == Type.InterleavedData
+             || vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers
+             || vb.getBufferType() == Type.Index)
+                continue;
+
+            if (vb.getStride() == 0){
+                // not interleaved
+                setVertexAttribVBO(vb, null);
+            }else{
+                // interleaved
+                setVertexAttribVBO(vb, interleavedData);
+            }
+        }
+
+        if (indices != null){
+            drawTriangleListVBO(indices, mesh, count);
+        }else{
+            gl.glDrawArrays(convertElementMode(mesh.getMode()), 0, mesh.getVertexCount());
+        }
+        clearVertexAttribs();
+        clearTextureUnits();
+    }
+
+    public void renderMesh(Mesh mesh, int lod, int count){
+        // check if texturing is used for new model, if not
+        // disable texturing entirely.
+        checkTexturingUsed();
+        if (gl11 != null){
+            // use vbo
+            renderMeshVBO(mesh, lod, count);
+        }else{
+            // use vertex arrays
+            renderMeshDefault(mesh, lod, count);
+        }
+    }
+
+}

+ 2848 - 0
engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java

@@ -0,0 +1,2848 @@
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions 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 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package com.jme3.renderer.android;
+
+import com.jme3.light.LightList;
+import com.jme3.material.RenderState;
+import com.jme3.math.ColorRGBA;
+import com.jme3.math.Matrix4f;
+import com.jme3.math.Quaternion;
+import com.jme3.math.Vector2f;
+import com.jme3.math.Vector3f;
+import com.jme3.renderer.Caps;
+import com.jme3.renderer.GLObjectManager;
+import com.jme3.renderer.IDList;
+import com.jme3.renderer.Renderer;
+import com.jme3.scene.Mesh;
+import com.jme3.scene.VertexBuffer;
+import com.jme3.scene.VertexBuffer.Format;
+import com.jme3.scene.VertexBuffer.Type;
+import com.jme3.scene.VertexBuffer.Usage;
+import com.jme3.renderer.RenderContext;
+import com.jme3.renderer.RendererException;
+import com.jme3.renderer.Statistics;
+import com.jme3.scene.Mesh.Mode;
+import com.jme3.shader.Attribute;
+import com.jme3.shader.Shader;
+import com.jme3.shader.Shader.ShaderSource;
+import com.jme3.shader.Shader.ShaderType;
+import com.jme3.shader.Uniform;
+import com.jme3.texture.FrameBuffer;
+import com.jme3.texture.FrameBuffer.RenderBuffer;
+import com.jme3.texture.Image;
+import com.jme3.texture.Texture;
+import com.jme3.texture.Texture.WrapAxis;
+import com.jme3.util.BufferUtils;
+import com.jme3.util.IntMap;
+import com.jme3.util.IntMap.Entry;
+import com.jme3.util.ListMap;
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.ShortBuffer;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/*
+//import org.lwjgl.opengl.ARBGeometryShader4;
+//import org.lwjgl.opengl.ARBHalfFloatVertex;
+//import org.lwjgl.opengl.ARBVertexArrayObject;
+//import org.lwjgl.opengl.ARBHalfFloatVertex;
+//import org.lwjgl.opengl.ARBVertexArrayObject;
+import org.lwjgl.opengl.ARBDrawBuffers;
+//import org.lwjgl.opengl.ARBDrawInstanced;
+import org.lwjgl.opengl.ARBDrawInstanced;
+import org.lwjgl.opengl.ARBMultisample;
+import org.lwjgl.opengl.ContextCapabilities;
+import org.lwjgl.opengl.EXTTextureArray;
+import org.lwjgl.opengl.EXTTextureFilterAnisotropic;
+import org.lwjgl.opengl.GLContext;
+import org.lwjgl.opengl.NVHalfFloat;
+
+import static org.lwjgl.opengl.GL11.*;
+import static org.lwjgl.opengl.GL12.*;
+import static org.lwjgl.opengl.GL13.*;
+import static org.lwjgl.opengl.GL14.*;
+import static org.lwjgl.opengl.GL15.*;
+import static org.lwjgl.opengl.GL20.*;
+
+import static org.lwjgl.opengl.EXTFramebufferObject.*;
+import static org.lwjgl.opengl.EXTFramebufferMultisample.*;
+import static org.lwjgl.opengl.EXTFramebufferBlit.*;
+import org.lwjgl.opengl.ARBShaderObjects.*;
+import org.lwjgl.opengl.ARBVertexArrayObject;
+//import static org.lwjgl.opengl.ARBDrawInstanced.*;
+*/
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.opengles.GL10;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.opengl.GLES10;
+import android.opengl.GLES11;
+import android.opengl.GLES20;
+import android.opengl.GLSurfaceView;
+import android.opengl.GLUtils;
+import android.opengl.Matrix;
+import android.os.SystemClock;
+import android.util.Log;
+
+
+
+public class OGLESShaderRenderer implements Renderer {
+
+    private static final Logger logger = Logger.getLogger(OGLESShaderRenderer.class.getName());
+    private static final boolean VALIDATE_SHADER = false;
+
+    private final ByteBuffer nameBuf = BufferUtils.createByteBuffer(250);
+    private final StringBuilder stringBuf = new StringBuilder(250);
+
+    private final IntBuffer intBuf1 = BufferUtils.createIntBuffer(1);
+    private final IntBuffer intBuf16 = BufferUtils.createIntBuffer(16);
+
+    private final RenderContext context = new RenderContext();
+    private final GLObjectManager objManager = new GLObjectManager();
+    private final EnumSet<Caps> caps = EnumSet.noneOf(Caps.class);
+
+    // current state
+    private Shader boundShader;
+    private int initialDrawBuf, initialReadBuf;
+
+    private int glslVer;
+    private int vertexTextureUnits;
+    private int fragTextureUnits;
+    private int vertexUniforms;
+    private int fragUniforms;
+    private int vertexAttribs;
+    private int maxFBOSamples;
+    private int maxFBOAttachs;
+    private int maxMRTFBOAttachs;
+    private int maxRBSize;
+    private int maxTexSize;
+    private int maxCubeTexSize;
+    private int maxVertCount;
+    private int maxTriCount;
+    private boolean tdc;
+    private FrameBuffer lastFb = null;
+    
+    private final Statistics statistics = new Statistics();
+
+    private int vpX, vpY, vpW, vpH;
+    private int clipX, clipY, clipW, clipH;
+
+
+	private final GL10 gl;
+	private boolean powerOf2 = false;
+	private boolean verboseLogging = false;
+	private boolean useVBO = true;
+
+
+    public OGLESShaderRenderer(GL10 gl) {
+	this.gl = gl;
+    }
+
+	public void setUseVA(boolean value) {
+		logger.info("use_VBO [" + useVBO + "] -> [" + (!value) + "]");
+		useVBO = !value;
+	}
+
+	public void setVerboseLogging(boolean value) {
+		logger.info("verboseLogging [" + verboseLogging + "] -> [" + value + "]");
+		verboseLogging = value;
+	}
+
+    protected void updateNameBuffer(){
+        int len = stringBuf.length();
+
+        nameBuf.position(0);
+        nameBuf.limit(len);
+        for (int i = 0; i < len; i++)
+            nameBuf.put((byte)stringBuf.charAt(i));
+
+        nameBuf.rewind();
+    }
+
+    public Statistics getStatistics(){
+        return statistics;
+    }
+
+    public EnumSet<Caps> getCaps(){
+        return caps;
+    }
+
+    public void initialize(){
+
+		logger.info("Vendor: " + GLES20.glGetString(GLES20.GL_VENDOR));
+		logger.info("Renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
+		logger.info("Version: " + GLES20.glGetString(GLES20.GL_VERSION));
+
+		String shadingLanguageVersion = GLES20.glGetString(GLES20.GL_SHADING_LANGUAGE_VERSION);
+		logger.info("GLES20.Shading Language Version: " + shadingLanguageVersion);
+
+/*
+        ContextCapabilities ctxCaps = GLContext.getCapabilities();
+        if (ctxCaps.OpenGL20){
+            caps.add(Caps.OpenGL20);
+        }
+        if (ctxCaps.OpenGL21){
+            caps.add(Caps.OpenGL21);
+        }
+        if (ctxCaps.OpenGL30){
+            caps.add(Caps.OpenGL30);
+        }
+*/
+        String versionStr = GLES20.glGetString(GLES20.GL_SHADING_LANGUAGE_VERSION);
+        if (versionStr == null || versionStr.equals("")){
+            glslVer = -1;
+            throw new UnsupportedOperationException("GLSL and OpenGL2 is " +
+                                                    "required for the LWJGL " +
+                                                    "renderer!");
+        }
+
+        // Fix issue in TestRenderToMemory when GL_FRONT is the main
+        // buffer being used.
+
+//        initialDrawBuf = GLES20.glGetIntegeri(GLES20.GL_DRAW_BUFFER);
+//        initialReadBuf = GLES20.glGetIntegeri(GLES20.GL_READ_BUFFER);
+
+        int spaceIdx = versionStr.lastIndexOf(" ");
+        if (spaceIdx >= 1)
+            versionStr = versionStr.substring(spaceIdx, versionStr.length());
+
+        float version = Float.parseFloat(versionStr);
+        glslVer = (int) (version * 100);
+        
+        switch (glslVer){
+            default:
+                if (glslVer < 400)
+                    break;
+
+                // so that future OpenGL revisions wont break jme3
+
+                // fall through intentional
+            case 400:
+            case 330:
+            case 150:
+                caps.add(Caps.GLSL150);
+            case 140:
+                caps.add(Caps.GLSL140);
+            case 130:
+                caps.add(Caps.GLSL130);
+            case 120:
+                caps.add(Caps.GLSL120);
+            case 110:
+                caps.add(Caps.GLSL110);
+            case 100:
+                caps.add(Caps.GLSL100);
+                break;
+        }
+
+        if (!caps.contains(Caps.GLSL100)){
+            logger.info("Force-adding GLSL100 support, since OpenGL is supported.");
+            caps.add(Caps.GLSL100);
+        }
+
+        GLES20.glGetIntegerv(GLES20.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, intBuf16);
+        vertexTextureUnits = intBuf16.get(0);
+        logger.info("VTF Units: " + vertexTextureUnits);
+        if (vertexTextureUnits > 0)
+            caps.add(Caps.VertexTextureFetch);
+
+        GLES20.glGetIntegerv(GLES20.GL_MAX_TEXTURE_IMAGE_UNITS, intBuf16);
+        fragTextureUnits = intBuf16.get(0);
+        logger.info("Texture Units: " + fragTextureUnits);
+/*
+        GLES20.glGetIntegerv(GLES20.GL_MAX_VERTEX_UNIFORM_COMPONENTS, intBuf16);
+        vertexUniforms = intBuf16.get(0);
+        logger.log(Level.FINER, "Vertex Uniforms: {0}", vertexUniforms);
+
+        GLES20.glGetIntegerv(GLES20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, intBuf16);
+        fragUniforms = intBuf16.get(0);
+        logger.log(Level.FINER, "Fragment Uniforms: {0}", fragUniforms);
+*/
+
+        GLES20.glGetIntegerv(GLES20.GL_MAX_VERTEX_ATTRIBS, intBuf16);
+        vertexAttribs = intBuf16.get(0);
+        logger.info("Vertex Attributes: " + vertexAttribs);
+
+/*
+        GLES20.glGetIntegerv(GLES20.GL_MAX_VARYING_FLOATS, intBuf16);
+        int varyingFloats = intBuf16.get(0);
+        logger.log(Level.FINER, "Varying Floats: {0}", varyingFloats);
+*/
+
+        GLES20.glGetIntegerv(GLES20.GL_SUBPIXEL_BITS, intBuf16);
+        int subpixelBits  = intBuf16.get(0);
+        logger.info("Subpixel Bits: " + subpixelBits);
+/*
+        GLES20.glGetIntegerv(GLES20.GL_MAX_ELEMENTS_VERTICES, intBuf16);
+        maxVertCount = intBuf16.get(0);
+        logger.log(Level.FINER, "Preferred Batch Vertex Count: {0}", maxVertCount);
+
+        GLES20.glGetIntegerv(GLES20.GL_MAX_ELEMENTS_INDICES, intBuf16);
+        maxTriCount = intBuf16.get(0);
+        logger.log(Level.FINER, "Preferred Batch Index Count: {0}", maxTriCount);
+*/
+        GLES20.glGetIntegerv(GLES20.GL_MAX_TEXTURE_SIZE, intBuf16);
+        maxTexSize = intBuf16.get(0);
+        logger.info("Maximum Texture Resolution: " + maxTexSize);
+
+        GLES20.glGetIntegerv(GLES20.GL_MAX_CUBE_MAP_TEXTURE_SIZE, intBuf16);
+        maxCubeTexSize = intBuf16.get(0);
+        logger.info("Maximum CubeMap Resolution: " + maxCubeTexSize);
+
+
+/*
+        if (ctxCaps.GL_ARB_color_buffer_float){
+            // XXX: Require both 16 and 32 bit float support for FloatColorBuffer.
+            if (ctxCaps.GL_ARB_half_float_pixel){
+                caps.add(Caps.FloatColorBuffer);
+            }
+        }
+
+        if (ctxCaps.GL_ARB_depth_buffer_float){
+            caps.add(Caps.FloatDepthBuffer);
+        }
+
+        if (ctxCaps.GL_ARB_draw_instanced)
+            caps.add(Caps.MeshInstancing);
+
+        if (ctxCaps.GL_ARB_fragment_program)
+            caps.add(Caps.ARBprogram);
+
+        if (ctxCaps.GL_ARB_texture_buffer_object)
+            caps.add(Caps.TextureBuffer);
+
+        if (ctxCaps.GL_ARB_texture_float){
+            if (ctxCaps.GL_ARB_half_float_pixel){
+                caps.add(Caps.FloatTexture);
+            }
+        }
+
+        if (ctxCaps.GL_ARB_vertex_array_object)
+            caps.add(Caps.VertexBufferArray);
+
+        boolean latc = ctxCaps.GL_EXT_texture_compression_latc;
+        boolean atdc = ctxCaps.GL_ATI_texture_compression_3dc;
+        if (latc || atdc){
+            caps.add(Caps.TextureCompressionLATC);
+            if (atdc && !latc){
+                tdc = true;
+            }
+        }
+
+        if (ctxCaps.GL_EXT_packed_float){
+            caps.add(Caps.PackedFloatColorBuffer);
+            if (ctxCaps.GL_ARB_half_float_pixel){
+                // because textures are usually uploaded as RGB16F
+                // need half-float pixel
+                caps.add(Caps.PackedFloatTexture);
+            }
+        }
+
+        if (ctxCaps.GL_EXT_texture_array)
+            caps.add(Caps.TextureArray);
+
+        if (ctxCaps.GL_EXT_texture_shared_exponent)
+            caps.add(Caps.SharedExponentTexture);
+
+        if (ctxCaps.GL_EXT_framebuffer_object){
+            caps.add(Caps.FrameBuffer);
+
+            glGetInteger(GL_MAX_RENDERBUFFER_SIZE_EXT, intBuf16);
+            maxRBSize = intBuf16.get(0);
+            logger.log(Level.FINER, "FBO RB Max Size: {0}", maxRBSize);
+
+            glGetInteger(GL_MAX_COLOR_ATTACHMENTS_EXT, intBuf16);
+            maxFBOAttachs = intBuf16.get(0);
+            logger.log(Level.FINER, "FBO Max renderbuffers: {0}", maxFBOAttachs);
+
+            if (ctxCaps.GL_EXT_framebuffer_multisample){
+                caps.add(Caps.FrameBufferMultisample);
+
+                glGetInteger(GL_MAX_SAMPLES_EXT, intBuf16);
+                maxFBOSamples = intBuf16.get(0);
+                logger.log(Level.FINER, "FBO Max Samples: {0}", maxFBOSamples);
+            }
+
+            if (ctxCaps.GL_ARB_draw_buffers){
+                caps.add(Caps.FrameBufferMRT);
+                glGetInteger(ARBDrawBuffers.GL_MAX_DRAW_BUFFERS_ARB, intBuf16);
+                maxMRTFBOAttachs = intBuf16.get(0);
+                logger.log(Level.FINER, "FBO Max MRT renderbuffers: {0}", maxMRTFBOAttachs);
+            }
+        }
+
+        if (ctxCaps.GL_ARB_multisample){
+            glGetInteger(ARBMultisample.GL_SAMPLE_BUFFERS_ARB, intBuf16);
+            boolean available = intBuf16.get(0) != 0;
+            glGetInteger(ARBMultisample.GL_SAMPLES_ARB, intBuf16);
+            int samples = intBuf16.get(0);
+            logger.log(Level.FINER, "Samples: {0}", samples);
+            boolean enabled = glIsEnabled(ARBMultisample.GL_MULTISAMPLE_ARB);
+            if (samples > 0 && available && !enabled){
+                glEnable(ARBMultisample.GL_MULTISAMPLE_ARB);
+            }
+        }
+*/
+
+        String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS);
+
+	logger.info("GL_EXTENSIONS: " + extensions);
+
+        if (extensions.contains("GL_OES_texture_npot"))
+            powerOf2 = true;
+        
+        applyRenderState(RenderState.DEFAULT);
+//        GLES20.glClearDepthf(1.0f);
+
+	if (verboseLogging)
+		logger.info("GLES20.glDisable(GL10.GL_DITHER)");
+
+        GLES20.glDisable(GL10.GL_DITHER);
+
+	checkGLError();
+
+	if (verboseLogging)
+		logger.info("GLES20.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST)");
+
+        GLES20.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
+
+//	checkGLError();
+
+        logger.log(Level.INFO, "Caps: " + caps);
+    }
+
+    public void resetGLObjects(){
+        objManager.resetObjects();
+        statistics.clearMemory();
+        boundShader = null;
+        lastFb = null;
+        context.reset();
+    }
+
+    public void cleanup(){
+        objManager.deleteAllObjects(this);
+        statistics.clearMemory();
+    }
+
+    private void checkCap(Caps cap){
+        if (!caps.contains(cap))
+            throw new UnsupportedOperationException("Required capability missing: "+cap.name());
+    }
+
+    /*********************************************************************\
+    |* Render State                                                      *|
+    \*********************************************************************/
+    public void setDepthRange(float start, float end){
+
+	if (verboseLogging)
+		logger.info("GLES20.glDepthRangef(" + start + ", " + end + ")");
+        GLES20.glDepthRangef(start, end);
+	checkGLError();
+    }
+
+    public void clearBuffers(boolean color, boolean depth, boolean stencil){
+        int bits = 0;
+        if (color) bits = GLES20.GL_COLOR_BUFFER_BIT;
+        if (depth) bits |= GLES20.GL_DEPTH_BUFFER_BIT;
+        if (stencil) bits |= GLES20.GL_STENCIL_BUFFER_BIT;
+        if (bits != 0) {
+		if (verboseLogging)
+			logger.info("GLES20.glClear(color=" + color + ", depth=" + depth + ", stencil=" + stencil + ")");
+		GLES20.glClear(bits); checkGLError();
+	}
+    }
+
+    public void setBackgroundColor(ColorRGBA color){
+	if (verboseLogging)
+		logger.info("GLES20.glClearColor(" + color.r + ", " + color.g + ", " + color.b + ", " + color.a + ")");
+        GLES20.glClearColor(color.r, color.g, color.b, color.a);
+	checkGLError();
+    }
+
+    public void applyRenderState(RenderState state){
+/*
+        if (state.isWireframe() && !context.wireframe){
+            GLES20.glPolygonMode(GLES20.GL_FRONT_AND_BACK, GLES20.GL_LINE);
+            context.wireframe = true;
+        }else if (!state.isWireframe() && context.wireframe){
+            GLES20.glPolygonMode(GLES20.GL_FRONT_AND_BACK, GLES20.GL_FILL);
+            context.wireframe = false;
+        }
+*/
+        if (state.isDepthTest() && !context.depthTestEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glEnable(GLES20.GL_DEPTH_TEST)");
+            GLES20.glEnable(GLES20.GL_DEPTH_TEST);
+		checkGLError();
+		if (verboseLogging)
+			logger.info("GLES20.glDepthFunc(GLES20.GL_LEQUAL)");
+            GLES20.glDepthFunc(GLES20.GL_LEQUAL);
+		checkGLError();
+            context.depthTestEnabled = true;
+        }else if (!state.isDepthTest() && context.depthTestEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glDisable(GLES20.GL_DEPTH_TEST)");
+            GLES20.glDisable(GLES20.GL_DEPTH_TEST);
+		checkGLError();
+            context.depthTestEnabled = false;
+        }
+        if (state.isAlphaTest() && !context.alphaTestEnabled){
+//            GLES20.glEnable(GLES20.GL_ALPHA_TEST);
+//           GLES20.glAlphaFunc(GLES20.GL_GREATER, state.getAlphaFallOff());
+            context.alphaTestEnabled = true;
+        }else if (!state.isAlphaTest() && context.alphaTestEnabled){
+//            GLES20.glDisable(GLES20.GL_ALPHA_TEST);
+            context.alphaTestEnabled = false;
+        }
+        if (state.isDepthWrite() && !context.depthWriteEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glDepthMask(true)");
+            GLES20.glDepthMask(true);
+		checkGLError();
+            context.depthWriteEnabled = true;
+        }else if (!state.isDepthWrite() && context.depthWriteEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glDepthMask(false)");
+            GLES20.glDepthMask(false);
+		checkGLError();
+            context.depthWriteEnabled = false;
+        }
+        if (state.isColorWrite() && !context.colorWriteEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glColorMask(true, true, true, true)");
+            GLES20.glColorMask(true,true,true,true);
+		checkGLError();
+            context.colorWriteEnabled = true;
+        }else if (!state.isColorWrite() && context.colorWriteEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glColorMask(false, false, false, false)");
+            GLES20.glColorMask(false,false,false,false);
+		checkGLError();
+            context.colorWriteEnabled = false;
+        }
+        if (state.isPointSprite() && !context.pointSprite){
+//            GLES20.glEnable(GLES20.GL_POINT_SPRITE);
+//            GLES20.glTexEnvi(GLES20.GL_POINT_SPRITE, GLES20.GL_COORD_REPLACE, GLES20.GL_TRUE);
+//            GLES20.glEnable(GLES20.GL_VERTEX_PROGRAM_POINT_SIZE);
+//            GLES20.glPointParameterf(GLES20.GL_POINT_SIZE_MIN, 1.0f);
+        }else if (!state.isPointSprite() && context.pointSprite){
+//            GLES20.glDisable(GLES20.GL_POINT_SPRITE);
+        }
+
+        if (state.isPolyOffset()){
+            if (!context.polyOffsetEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glEnable(GLES20.GL_POLYGON_OFFSET_FILL)");
+                GLES20.glEnable(GLES20.GL_POLYGON_OFFSET_FILL);
+		checkGLError();
+		if (verboseLogging)
+			logger.info("GLES20.glPolygonOffset(" + state.getPolyOffsetFactor() + ", " + state.getPolyOffsetUnits() + ")");
+                GLES20.glPolygonOffset(state.getPolyOffsetFactor(),
+                                state.getPolyOffsetUnits());
+		checkGLError();
+                context.polyOffsetEnabled = true;
+                context.polyOffsetFactor = state.getPolyOffsetFactor();
+                context.polyOffsetUnits = state.getPolyOffsetUnits();
+            }else{
+                if (state.getPolyOffsetFactor() != context.polyOffsetFactor
+                 || state.getPolyOffsetUnits() != context.polyOffsetUnits){
+			if (verboseLogging)
+				logger.info("GLES20.glPolygonOffset(" + state.getPolyOffsetFactor() + ", " + state.getPolyOffsetUnits() + ")");
+                    GLES20.glPolygonOffset(state.getPolyOffsetFactor(),
+                                    state.getPolyOffsetUnits());
+			checkGLError();
+                    context.polyOffsetFactor = state.getPolyOffsetFactor();
+                    context.polyOffsetUnits = state.getPolyOffsetUnits();
+                }
+            }
+        }else{
+            if (context.polyOffsetEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glDisable(GLES20.GL_POLYGON_OFFSET_FILL)");
+                GLES20.glDisable(GLES20.GL_POLYGON_OFFSET_FILL);
+		checkGLError();
+                context.polyOffsetEnabled = false;
+                context.polyOffsetFactor = 0;
+                context.polyOffsetUnits = 0;
+            }
+        }
+        if (state.getFaceCullMode() != context.cullMode){
+            if (state.getFaceCullMode() == RenderState.FaceCullMode.Off) {
+		if (verboseLogging)
+			logger.info("GLES20.glDisable(GLES20.GL_CULL_FACE)");
+                GLES20.glDisable(GLES20.GL_CULL_FACE);
+            } else {
+		if (verboseLogging)
+			logger.info("GLES20.glEnable(GLES20.GL_CULL_FACE)");
+                GLES20.glEnable(GLES20.GL_CULL_FACE);
+		}
+
+	checkGLError();
+
+            switch (state.getFaceCullMode()){
+                case Off:
+                    break;
+                case Back:
+			if (verboseLogging)
+				logger.info("GLES20.glCullFace(GLES20.GL_BACK)");
+                    GLES20.glCullFace(GLES20.GL_BACK);
+                    break;
+                case Front:
+			if (verboseLogging)
+				logger.info("GLES20.glCullFace(GLES20.GL_FRONT)");
+                    GLES20.glCullFace(GLES20.GL_FRONT);
+                    break;
+                case FrontAndBack:
+			if (verboseLogging)
+				logger.info("GLES20.glCullFace(GLES20.GL_FRONT_AND_BACK)");
+                    GLES20.glCullFace(GLES20.GL_FRONT_AND_BACK);
+                    break;
+                default:
+                    throw new UnsupportedOperationException("Unrecognized face cull mode: "+
+                                                            state.getFaceCullMode());
+            }
+
+		checkGLError();
+
+            context.cullMode = state.getFaceCullMode();
+        }
+
+        if (state.getBlendMode() != context.blendMode){
+            if (state.getBlendMode() == RenderState.BlendMode.Off){
+			if (verboseLogging)
+				logger.info("GLES20.glDisable(GLES20.GL_BLEND)");
+                GLES20.glDisable(GLES20.GL_BLEND);
+            } else {
+			if (verboseLogging)
+				logger.info("GLES20.glEnable(GLES20.GL_BLEND)");
+                GLES20.glEnable(GLES20.GL_BLEND);
+                switch (state.getBlendMode()){
+                    case Off:
+                        break;
+                    case Additive:
+			if (verboseLogging)
+				logger.info("GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE)");
+                        GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE);
+                        break;
+                    case AlphaAdditive:
+			if (verboseLogging)
+				logger.info("GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE)");
+                        GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE);
+                        break;
+                    case Color:
+			if (verboseLogging)
+			logger.info("GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_COLOR)");
+                	        GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_COLOR);
+                        break;
+                    case Alpha:
+			if (verboseLogging)
+				logger.info("GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA)");
+                        GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
+                        break;
+                    case PremultAlpha:
+			if (verboseLogging)
+				logger.info("GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA)");
+                        GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA);
+                        break;
+                    case Modulate:
+			if (verboseLogging)
+				logger.info("GLES20.glBlendFunc(GLES20.GL_DST_COLOR, GLES20.GL_ZERO)");
+                        GLES20.glBlendFunc(GLES20.GL_DST_COLOR, GLES20.GL_ZERO);
+                        break;
+                    case ModulateX2:
+			if (verboseLogging)
+				logger.info("GLES20.glBlendFunc(GLES20.GL_DST_COLOR, GLES20.GL_SRC_COLOR)");
+                        GLES20.glBlendFunc(GLES20.GL_DST_COLOR, GLES20.GL_SRC_COLOR);
+                        break;
+                    default:
+                        throw new UnsupportedOperationException("Unrecognized blend mode: "+
+                                                                state.getBlendMode());
+                }
+            }
+
+		checkGLError();
+
+            context.blendMode = state.getBlendMode();
+        }
+    }
+
+    /*********************************************************************\
+    |* Camera and World transforms                                       *|
+    \*********************************************************************/
+    public void setViewPort(int x, int y, int w, int h){
+        if (x != vpX || vpY != y || vpW != w || vpH != h){
+		if (verboseLogging)
+			logger.info("GLES20.glViewport(" + x + ", " + y + ", " + w + ", " + h + ")");
+		GLES20.glViewport(x, y, w, h);
+		checkGLError();
+            vpX = x;
+            vpY = y;
+            vpW = w;
+            vpH = h;
+        }
+    }
+
+    public void setClipRect(int x, int y, int width, int height){
+        if (!context.clipRectEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glEnable(GLES20.GL_SCISSOR_TEST)");
+            GLES20.glEnable(GLES20.GL_SCISSOR_TEST);
+		checkGLError();
+            context.clipRectEnabled = true;
+        }
+        if (clipX != x || clipY != y || clipW != width || clipH != height){
+		if (verboseLogging)
+			logger.info("GLES20.glScissor(" + x + ", " + y + ", " + width + ", " + height + ")");
+            GLES20.glScissor(x, y, width, height);
+            clipX = x;
+            clipY = y;
+            clipW = width;
+            clipH = height;
+		checkGLError();
+        }
+    }
+
+    public void clearClipRect(){
+        if (context.clipRectEnabled){
+		if (verboseLogging)
+			logger.info("GLES20.glDisable(GLES20.GL_SCISSOR_TEST)");
+            GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
+		checkGLError();
+            context.clipRectEnabled = false;
+
+            clipX = 0;
+            clipY = 0;
+            clipW = 0;
+            clipH = 0;
+        }
+    }
+
+    public void onFrame(){
+        objManager.deleteUnused(this);
+//        statistics.clearFrame();
+    }
+    
+    public void setWorldMatrix(Matrix4f worldMatrix){
+    }
+
+    public void setViewProjectionMatrices(Matrix4f viewMatrix, Matrix4f projMatrix){
+    }
+
+    /*********************************************************************\
+    |* Shaders                                                           *|
+    \*********************************************************************/
+
+    protected void updateUniformLocation(Shader shader, Uniform uniform){
+        stringBuf.setLength(0);
+        stringBuf.append(uniform.getName()).append('\0');
+        updateNameBuffer();
+		if (verboseLogging)
+			logger.info("GLES20.glGetUniformLocation(" + shader.getId() + ", " + uniform.getName() + ")");
+        int loc = GLES20.glGetUniformLocation(shader.getId(), uniform.getName());
+		checkGLError();
+        if (loc < 0){
+            uniform.setLocation(-1);
+            // uniform is not declared in shader
+		if (verboseLogging)
+			logger.warning("Uniform [" + uniform.getName() + "] is not declared in shader.");
+        }else{
+            uniform.setLocation(loc);
+        }
+    }
+
+    protected void updateUniform(Shader shader, Uniform uniform){
+        int shaderId = shader.getId();
+
+        assert uniform.getName() != null;
+        assert shader.getId() > 0;
+        
+        if (context.boundShaderProgram != shaderId){
+		if (verboseLogging)
+			logger.info("GLES20.glUseProgram(" + shaderId + ")");
+            GLES20.glUseProgram(shaderId);
+		checkGLError();
+            statistics.onShaderUse(shader, true);
+            boundShader = shader;
+            context.boundShaderProgram = shaderId;
+        }else{
+            statistics.onShaderUse(shader, false);
+        }
+
+        int loc = uniform.getLocation();
+        if (loc == -1) {
+		if (verboseLogging)
+			logger.warning("no location for uniform [" + uniform.getName() + "]");
+            return;
+        }
+
+        if (loc == -2){
+            // get uniform location
+            updateUniformLocation(shader, uniform);
+            if (uniform.getLocation() == -1){
+                // not declared, ignore
+
+		if (verboseLogging)
+			logger.warning("not declared uniform: [" + uniform.getName() + "]");
+
+                uniform.clearUpdateNeeded();
+                return;
+            }
+            loc = uniform.getLocation();
+        }
+
+        if (uniform.getVarType() == null) {
+		logger.warning("value is not set yet.");
+            return; // value not set yet..
+	}
+
+        statistics.onUniformSet();
+
+        uniform.clearUpdateNeeded();
+        FloatBuffer fb;
+        switch (uniform.getVarType()){
+            case Float:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform1f set Float. " + uniform.getName());
+                Float f = (Float)uniform.getValue();
+                GLES20.glUniform1f(loc, f.floatValue());
+                break;
+            case Vector2:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform2f set Vector2. " + uniform.getName());
+                Vector2f v2 = (Vector2f)uniform.getValue();
+                GLES20.glUniform2f(loc, v2.getX(), v2.getY());
+                break;
+            case Vector3:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform3f set Vector3. " + uniform.getName());
+                Vector3f v3 = (Vector3f)uniform.getValue();
+                GLES20.glUniform3f(loc, v3.getX(), v3.getY(), v3.getZ());
+                break;
+            case Vector4:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform4f set Vector4." + uniform.getName());
+                Object val = uniform.getValue();
+                if (val instanceof ColorRGBA){
+                    ColorRGBA c = (ColorRGBA) val;
+                    GLES20.glUniform4f(loc, c.r, c.g, c.b, c.a);
+                }else{
+                    Quaternion c = (Quaternion)uniform.getValue();
+                    GLES20.glUniform4f(loc, c.getX(), c.getY(), c.getZ(), c.getW());
+                }
+                break;
+            case Boolean:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform1i set Boolean." + uniform.getName());
+                Boolean b = (Boolean)uniform.getValue();
+                GLES20.glUniform1i(loc, b.booleanValue() ? GLES20.GL_TRUE : GLES20.GL_FALSE);
+                break;
+            case Matrix3:
+		if (verboseLogging)
+			logger.info("GLES20.glUniformMatrix3fv set Matrix3." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                assert fb.remaining() == 9;
+                GLES20.glUniformMatrix3fv(loc, 1, false, fb);
+                break;
+            case Matrix4:
+		if (verboseLogging)
+			logger.info("GLES20.glUniformMatrix4fv set Matrix4." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                assert fb.remaining() == 16;
+                GLES20.glUniformMatrix4fv(loc, 1, false, fb);
+                break;
+            case FloatArray:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform1fv set FloatArray." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                GLES20.glUniform1fv(loc, 1, fb);
+                break;
+            case Vector2Array:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform2fv set Vector2Array." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                GLES20.glUniform2fv(loc, 1, fb);
+                break;
+            case Vector3Array:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform3fv set Vector3Array." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                GLES20.glUniform3fv(loc, 1, fb);
+                break;
+            case Vector4Array:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform4fv set Vector4Array." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                GLES20.glUniform4fv(loc, 1, fb);
+                break;
+            case Matrix4Array:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform4fv set Matrix4Array." + uniform.getName());
+                fb = (FloatBuffer)uniform.getValue();
+                GLES20.glUniformMatrix4fv(loc, 1, false, fb);
+                break;
+            case Int:
+		if (verboseLogging)
+			logger.info("GLES20.glUniform1i set Int." + uniform.getName());
+                Integer i = (Integer)uniform.getValue();
+                GLES20.glUniform1i(loc, i.intValue());
+                break;
+            default:
+                throw new UnsupportedOperationException("Unsupported uniform type: "+uniform.getVarType());
+        }
+	checkGLError();
+    }
+
+    protected void updateShaderUniforms(Shader shader){
+        ListMap<String, Uniform> uniforms = shader.getUniformMap();
+//        for (Uniform uniform : shader.getUniforms()){
+        for (int i = 0; i < uniforms.size(); i++){
+            Uniform uniform = uniforms.getValue(i);
+            if (uniform.isUpdateNeeded())
+                updateUniform(shader, uniform);
+        }
+    }
+
+
+    protected void resetUniformLocations(Shader shader){
+        ListMap<String, Uniform> uniforms = shader.getUniformMap();
+//        for (Uniform uniform : shader.getUniforms()){
+        for (int i = 0; i < uniforms.size(); i++){
+            Uniform uniform = uniforms.getValue(i);
+            uniform.reset(); // e.g check location again
+        }
+    }
+
+    /*
+     * (Non-javadoc)
+     * Only used for fixed-function. Ignored.
+     */
+    public void setLighting(LightList list){
+    }
+    
+    public int convertShaderType(ShaderType type){
+        switch (type){
+            case Fragment:
+                return GLES20.GL_FRAGMENT_SHADER;
+            case Vertex:
+                return GLES20.GL_VERTEX_SHADER;
+//            case Geometry:
+//                return ARBGeometryShader4.GL_GEOMETRY_SHADER_ARB;
+            default:
+                throw new RuntimeException("Unrecognized shader type.");
+        }
+    }
+
+    public void updateShaderSourceData(ShaderSource source, String language){
+        int id = source.getId();
+        if (id == -1){
+            // create id
+		if (verboseLogging)
+			logger.info("GLES20.glCreateShader(" + source.getType() + ")");
+            id = GLES20.glCreateShader(convertShaderType(source.getType()));
+		checkGLError();
+            if (id <= 0)
+                throw new RendererException("Invalid ID received when trying to create shader.");
+
+            source.setId(id);
+        }
+
+        // upload shader source
+        // merge the defines and source code
+        byte[] versionData = new byte[]{};//"#version 140\n".getBytes();
+//        versionData = "#define INSTANCING 1\n".getBytes();
+        byte[] definesCodeData = source.getDefines().getBytes();
+        byte[] sourceCodeData = source.getSource().getBytes();
+        ByteBuffer codeBuf = BufferUtils.createByteBuffer(versionData.length
+                                                        + definesCodeData.length
+                                                        + sourceCodeData.length);
+        codeBuf.put(versionData);
+        codeBuf.put(definesCodeData);
+        codeBuf.put(sourceCodeData);
+        codeBuf.flip();
+
+	if (verboseLogging)
+		logger.info("GLES20.glShaderSource("+ id + ")");
+
+        GLES20.glShaderSource(
+		id,
+		"precision mediump float;\n" +
+		source.getDefines() +
+		source.getSource()
+	);
+
+	checkGLError();
+
+	if (verboseLogging)
+		logger.info("GLES20.glCompileShader(" + id + ")");
+
+        GLES20.glCompileShader(id);
+
+	checkGLError();
+
+	if (verboseLogging)
+		logger.info("GLES20.glGetShaderiv(" + id + ", GLES20.GL_COMPILE_STATUS)");
+
+        GLES20.glGetShaderiv(id, GLES20.GL_COMPILE_STATUS, intBuf1);
+
+	checkGLError();
+
+        boolean compiledOK = intBuf1.get(0) == GLES20.GL_TRUE;
+        String infoLog = null;
+
+        if (VALIDATE_SHADER || !compiledOK){
+            // even if compile succeeded, check
+            // log for warnings
+		if (verboseLogging)
+			logger.info("GLES20.glGetShaderiv()");
+            GLES20.glGetShaderiv(id, GLES20.GL_INFO_LOG_LENGTH, intBuf1);
+		checkGLError();
+            int length = intBuf1.get(0);
+            if (length > 3){
+                // get infos
+                ByteBuffer logBuf = BufferUtils.createByteBuffer(length);
+		if (verboseLogging)
+			logger.info("GLES20.glGetShaderInfoLog(" + id + ")");
+                infoLog = GLES20.glGetShaderInfoLog(id);
+            }
+        }
+
+        if (compiledOK){
+            if (infoLog != null){
+                logger.log(Level.INFO, "compile success: " + source.getName() + ", " + infoLog);
+            }else{
+                logger.log(Level.FINE, "compile success: " + source.getName());
+            }
+        }else{
+            if (infoLog != null){
+                logger.log(Level.WARNING, "compile error: " + source.getName() + ", " + infoLog);
+            }else{
+                logger.log(Level.WARNING, "compile error: " + source.getName());
+            }
+            logger.log(Level.WARNING, source.getDefines() + "\n" + source.getSource());
+        }
+
+        source.clearUpdateNeeded();
+        // only usable if compiled
+        source.setUsable(compiledOK);
+        if (!compiledOK){
+            // make sure to dispose id cause all program's
+            // shaders will be cleared later.
+		if (verboseLogging)
+			logger.info("GLES20.glDeleteShader(" + id + ")");
+            GLES20.glDeleteShader(id);
+		checkGLError();
+        }else{
+            // register for cleanup since the ID is usable
+            objManager.registerForCleanup(source);
+        }
+    }
+
+    public void updateShaderData(Shader shader){
+        int id = shader.getId();
+        boolean needRegister = false;
+        if (id == -1){
+            // create program
+
+		if (verboseLogging)
+			logger.info("GLES20.glCreateProgram()");
+
+		id = GLES20.glCreateProgram();
+
+            if (id <= 0)
+                throw new RendererException("Invalid ID received when trying to create shader program.");
+
+            shader.setId(id);
+            needRegister = true;
+        }
+
+        for (ShaderSource source : shader.getSources()){
+            if (source.isUpdateNeeded()){
+                updateShaderSourceData(source, shader.getLanguage());
+                // shader has been compiled here
+            }
+
+            if (!source.isUsable()){
+                // it's useless.. just forget about everything..
+                shader.setUsable(false);
+                shader.clearUpdateNeeded();
+                return;
+            }
+		if (verboseLogging)
+			logger.info("GLES20.glAttachShader(" + id + ", " + source.getId() + ")");
+
+		GLES20.glAttachShader(id, source.getId());
+        }
+
+        // link shaders to program
+	if (verboseLogging)
+		logger.info("GLES20.glLinkProgram(" + id + ")");
+
+        GLES20.glLinkProgram(id);
+
+
+	if (verboseLogging)
+		logger.info("GLES20.glGetProgramiv(" + id + ")");
+
+        GLES20.glGetProgramiv(id, GLES20.GL_LINK_STATUS, intBuf1);
+
+        boolean linkOK = intBuf1.get(0) == GLES20.GL_TRUE;
+        String infoLog = null;
+        
+        if (VALIDATE_SHADER || !linkOK){
+		if (verboseLogging)
+			logger.info("GLES20.glGetProgramiv(" + id + ", GLES20.GL_INFO_LOG_LENGTH, buffer)");
+
+            GLES20.glGetProgramiv(id, GLES20.GL_INFO_LOG_LENGTH, intBuf1);
+
+            int length = intBuf1.get(0);
+            if (length > 3){
+                // get infos
+
+		if (verboseLogging)
+			logger.info("GLES20.glGetProgramInfoLog(" + id + ")");
+
+                infoLog = GLES20.glGetProgramInfoLog(id);
+            }
+        }
+
+        if (linkOK){
+            if (infoLog != null){
+                logger.log(Level.INFO, "shader link success. \n{0}", infoLog);
+            }else{
+                logger.fine("shader link success");
+            }
+        }else{
+            if (infoLog != null){
+                logger.log(Level.WARNING, "shader link failure. \n{0}", infoLog);
+            }else{
+                logger.warning("shader link failure");
+            }
+        }
+
+        shader.clearUpdateNeeded();
+        if (!linkOK){
+            // failure.. forget about everything
+            shader.resetSources();
+            shader.setUsable(false);
+            deleteShader(shader);
+        }else{
+            shader.setUsable(true);
+            if (needRegister){
+                objManager.registerForCleanup(shader);
+                statistics.onNewShader();
+            }else{
+                // OpenGL spec: uniform locations may change after re-link
+                resetUniformLocations(shader);
+            }
+        }
+    }
+
+    public void setShader(Shader shader){
+	if (verboseLogging)
+		logger.info("setShader(" + shader + ")");
+
+        if (shader == null){
+            if (context.boundShaderProgram > 0){
+
+		if (verboseLogging)
+			logger.info("GLES20.glUseProgram(0)");
+
+                GLES20.glUseProgram(0);
+
+                statistics.onShaderUse(null, true);
+                context.boundShaderProgram = 0;
+                boundShader = null;
+            }
+        } else {
+            if (shader.isUpdateNeeded())
+                updateShaderData(shader);
+            
+            // NOTE: might want to check if any of the 
+            // sources need an update?
+            
+            if (!shader.isUsable()) {
+		logger.warning("shader is not usable.");
+                return;
+		}
+
+            assert shader.getId() > 0;
+
+            updateShaderUniforms(shader);
+            if (context.boundShaderProgram != shader.getId()){
+                if (VALIDATE_SHADER){
+                    // check if shader can be used
+                    // with current state
+			if (verboseLogging)
+				logger.info("GLES20.glValidateProgram(" + shader.getId() + ")");
+
+                    GLES20.glValidateProgram(shader.getId());
+
+			if (verboseLogging)
+				logger.info("GLES20.glGetProgramiv(" + shader.getId() + ", GLES20.GL_VALIDATE_STATUS, buffer)");
+
+                    GLES20.glGetProgramiv(shader.getId(), GLES20.GL_VALIDATE_STATUS, intBuf1);
+
+                    boolean validateOK = intBuf1.get(0) == GLES20.GL_TRUE;
+
+                    if (validateOK){
+                        logger.fine("shader validate success");
+                    }else{
+                        logger.warning("shader validate failure");
+                    }
+                }
+
+		if (verboseLogging)
+			logger.info("GLES20.glUseProgram(" + shader.getId() + ")");
+
+                GLES20.glUseProgram(shader.getId());
+
+                statistics.onShaderUse(shader, true);
+                context.boundShaderProgram = shader.getId();
+                boundShader = shader;
+            }else{
+                statistics.onShaderUse(shader, false);
+            }
+        }
+    }
+
+    public void deleteShaderSource(ShaderSource source){
+        if (source.getId() < 0){
+            logger.warning("Shader source is not uploaded to GPU, cannot delete.");
+            return;
+        }
+        source.setUsable(false);
+        source.clearUpdateNeeded();
+
+	if (verboseLogging)
+		logger.info("GLES20.glDeleteShader(" + source.getId() + ")");
+
+        GLES20.glDeleteShader(source.getId());
+        source.resetObject();
+    }
+
+    public void deleteShader(Shader shader){
+        if (shader.getId() == -1){
+            logger.warning("Shader is not uploaded to GPU, cannot delete.");
+            return;
+        }
+        for (ShaderSource source : shader.getSources()){
+            if (source.getId() != -1){
+
+		if (verboseLogging)
+			logger.info("GLES20.glDetachShader(" + shader.getId() + ", " + source.getId() + ")");
+
+                GLES20.glDetachShader(shader.getId(), source.getId());
+                // the next part is done by the GLObjectManager automatically
+//                glDeleteShader(source.getId());
+            }
+        }
+        // kill all references so sources can be collected
+        // if needed.
+        shader.resetSources();
+
+	if (verboseLogging)
+		logger.info("GLES20.glDeleteProgram(" + shader.getId() + ")");
+
+        GLES20.glDeleteProgram(shader.getId());
+
+        statistics.onDeleteShader();
+    }
+
+    /*********************************************************************\
+    |* Framebuffers                                                      *|
+    \*********************************************************************/
+
+    public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst){
+	logger.warning("copyFrameBuffer is not supported.");
+    }
+/*
+    public void copyFrameBuffer(FrameBuffer src, FrameBuffer dst){
+        if (GLContext.getCapabilities().GL_EXT_framebuffer_blit){
+            int srcW = 0;
+            int srcH = 0;
+            int dstW = 0;
+            int dstH = 0;
+            int prevFBO = context.boundFBO;
+
+            if (src != null && src.isUpdateNeeded())
+                updateFrameBuffer(src);
+
+            if (dst != null && dst.isUpdateNeeded())
+                updateFrameBuffer(dst);
+
+            if (src == null){
+                glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
+//                srcW = viewWidth;
+//                srcH = viewHeight;
+            }else{  
+                glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, src.getId());
+                srcW = src.getWidth();
+                srcH = src.getHeight();
+            }
+            if (dst == null){
+                glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
+//                dstW = viewWidth;
+//                dstH = viewHeight;
+            }else{
+                glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, dst.getId());
+                dstW = dst.getWidth();
+                dstH = dst.getHeight();
+            }
+            glBlitFramebufferEXT(0, 0, srcW, srcH,
+                                 0, 0, dstW, dstH,
+                                 GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT,
+                                 GL_NEAREST);
+            
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, prevFBO);
+            try {
+                checkFrameBufferError();
+            } catch (IllegalStateException ex){
+                logger.log(Level.SEVERE, "Source FBO:\n{0}", src);
+                logger.log(Level.SEVERE, "Dest FBO:\n{0}", dst);
+                throw ex;
+            }
+        }else{
+            throw new UnsupportedOperationException("EXT_framebuffer_blit required.");
+              // TODO: support non-blit copies?
+        }
+    }
+*/
+    private void checkFrameBufferError() {
+	logger.warning("checkFrameBufferError is not supported.");
+    }
+/*
+    private void checkFrameBufferError() {
+        int status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+        switch (status) {
+            case GL_FRAMEBUFFER_COMPLETE_EXT:
+                break;
+            case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
+                //Choose different formats
+                throw new IllegalStateException("Framebuffer object format is " +
+                                                "unsupported by the video hardware.");
+            case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
+                throw new IllegalStateException("Framebuffer has erronous attachment.");
+            case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
+                throw new IllegalStateException("Framebuffer is missing required attachment.");
+            case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
+                throw new IllegalStateException("Framebuffer attachments must have same dimensions.");
+            case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
+                throw new IllegalStateException("Framebuffer attachments must have same formats.");
+            case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
+                throw new IllegalStateException("Incomplete draw buffer.");
+            case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
+                throw new IllegalStateException("Incomplete read buffer.");
+            case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
+                throw new IllegalStateException("Incomplete multisample buffer.");
+            default:
+                //Programming error; will fail on all hardware
+                throw new IllegalStateException("Some video driver error " +
+                                                "or programming error occured. " +
+                                                "Framebuffer object status is invalid. ");
+        }
+    }
+*/
+    private void updateRenderBuffer(FrameBuffer fb, RenderBuffer rb){
+	logger.warning("updateRenderBuffer is not supported.");
+    }
+/*
+    private void updateRenderBuffer(FrameBuffer fb, RenderBuffer rb){
+        int id = rb.getId();
+        if (id == -1){
+            glGenRenderbuffersEXT(intBuf1);
+            id = intBuf1.get(0);
+            rb.setId(id);
+        }
+
+        if (context.boundRB != id){
+            glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, id);
+            context.boundRB = id;
+        }
+
+        if (fb.getWidth() > maxRBSize || fb.getHeight() > maxRBSize)
+            throw new UnsupportedOperationException("Resolution "+fb.getWidth()+
+                                                    ":"+fb.getHeight()+" is not supported.");
+       
+        if (fb.getSamples() > 0 && GLContext.getCapabilities().GL_EXT_framebuffer_multisample){
+            int samples = fb.getSamples();
+            if (maxFBOSamples < samples){
+                samples = maxFBOSamples;
+            }
+            glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT,
+                                                samples,
+                                                TextureUtil.convertTextureFormat(rb.getFormat()),
+                                                fb.getWidth(),
+                                                fb.getHeight());
+        }else{
+            glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
+                                     TextureUtil.convertTextureFormat(rb.getFormat()),
+                                     fb.getWidth(),
+                                     fb.getHeight());
+        }
+    }
+*/
+    private int convertAttachmentSlot(int attachmentSlot){
+	logger.warning("convertAttachmentSlot is not supported.");
+	return -1;
+    }
+/*
+    private int convertAttachmentSlot(int attachmentSlot){
+        // can also add support for stencil here
+        if (attachmentSlot == -100){
+            return GL_DEPTH_ATTACHMENT_EXT;
+        }else if (attachmentSlot < 0 || attachmentSlot >= 16){
+            throw new UnsupportedOperationException("Invalid FBO attachment slot: "+attachmentSlot);
+        }
+
+        return GL_COLOR_ATTACHMENT0_EXT + attachmentSlot;
+    }
+*/
+
+    public void updateRenderTexture(FrameBuffer fb, RenderBuffer rb){
+	logger.warning("updateRenderTexture is not supported.");
+    }
+/*
+    public void updateRenderTexture(FrameBuffer fb, RenderBuffer rb){
+        Texture tex = rb.getTexture();
+        Image image = tex.getImage();
+        if (image.isUpdateNeeded())
+            updateTexImageData(image, tex.getType(), tex.getMinFilter().usesMipMapLevels());
+
+        glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
+                                  convertAttachmentSlot(rb.getSlot()),
+                                  convertTextureType(tex.getType()),
+                                  image.getId(),
+                                  0);
+    }
+*/
+    public void updateFrameBufferAttachment(FrameBuffer fb, RenderBuffer rb){
+	logger.warning("updateFrameBufferAttachment is not supported.");
+    }
+/*
+    public void updateFrameBufferAttachment(FrameBuffer fb, RenderBuffer rb){
+        boolean needAttach;
+        if (rb.getTexture() == null){
+            // if it hasn't been created yet, then attach is required.
+            needAttach = rb.getId() == -1;
+            updateRenderBuffer(fb, rb);
+        }else{
+            needAttach = false;
+            updateRenderTexture(fb, rb);
+        }
+        if (needAttach){
+            glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
+                                         convertAttachmentSlot(rb.getSlot()),
+                                         GL_RENDERBUFFER_EXT,
+                                         rb.getId());
+        }
+    }
+*/
+    public void updateFrameBuffer(FrameBuffer fb) {
+	logger.warning("updateFrameBuffer is not supported.");
+    }
+/*
+    public void updateFrameBuffer(FrameBuffer fb) {
+        int id = fb.getId();
+        if (id == -1){
+            // create FBO
+            glGenFramebuffersEXT(intBuf1);
+            id = intBuf1.get(0);
+            fb.setId(id);
+            objManager.registerForCleanup(fb);
+
+            statistics.onNewFrameBuffer();
+        }
+
+        if (context.boundFBO != id){
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id);
+            // binding an FBO automatically sets draw buf to GL_COLOR_ATTACHMENT0
+            context.boundDrawBuf = 0;
+            context.boundFBO = id;
+        }
+
+        FrameBuffer.RenderBuffer depthBuf = fb.getDepthBuffer();
+        if (depthBuf != null){
+            updateFrameBufferAttachment(fb, depthBuf);
+        }
+
+        for (int i = 0; i < fb.getNumColorBuffers(); i++){
+            FrameBuffer.RenderBuffer colorBuf = fb.getColorBuffer(i);
+            updateFrameBufferAttachment(fb, colorBuf);
+        }
+
+        fb.clearUpdateNeeded();
+    }
+*/
+    public void setFrameBuffer(FrameBuffer fb) {
+	if (verboseLogging)
+		logger.warning("setFrameBuffer is not supported.");
+    }
+/*
+    public void setFrameBuffer(FrameBuffer fb) {
+        if (lastFb == fb)
+            return;
+
+        // generate mipmaps for last FB if needed
+        if (lastFb != null){
+           for (int i = 0; i < lastFb.getNumColorBuffers(); i++){
+               RenderBuffer rb = lastFb.getColorBuffer(i);
+               Texture tex = rb.getTexture();
+               if (tex != null
+                && tex.getMinFilter().usesMipMapLevels()){
+                   setTexture(0, rb.getTexture());
+                   glGenerateMipmapEXT(convertTextureType(tex.getType()));
+               }
+           }
+        }
+
+        
+        if (fb == null){
+            // unbind any fbos
+            if (context.boundFBO != 0){
+                glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+                statistics.onFrameBufferUse(null, true);
+
+                context.boundFBO = 0;
+            }
+            // select back buffer
+            if (context.boundDrawBuf != -1){
+                glDrawBuffer(initialDrawBuf);
+                context.boundDrawBuf = -1;
+            }
+            if (context.boundReadBuf != -1){
+                glReadBuffer(initialReadBuf);
+                context.boundReadBuf = -1;
+            }
+
+            lastFb = null;
+        }else{
+            if (fb.isUpdateNeeded())
+               updateFrameBuffer(fb);
+
+            if (context.boundFBO != fb.getId()){
+                glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb.getId());
+                statistics.onFrameBufferUse(fb, true);
+                
+                // update viewport to reflect framebuffer's resolution
+                setViewPort(0, 0, fb.getWidth(), fb.getHeight());
+
+                context.boundFBO = fb.getId();
+            }else{
+                statistics.onFrameBufferUse(fb, false);
+            }
+            if (fb.getNumColorBuffers() == 0){
+                // make sure to select NONE as draw buf
+                // no color buffer attached. select NONE
+                if (context.boundDrawBuf != -2){
+                    glDrawBuffer(GL_NONE);
+                    context.boundDrawBuf = -2;
+                }
+                if (context.boundReadBuf != -2){
+                    glReadBuffer(GL_NONE);
+                    context.boundReadBuf = -2;
+                }
+            }else{
+                if (fb.isMultiTarget()){
+                    if (fb.getNumColorBuffers() > maxMRTFBOAttachs)
+                        throw new UnsupportedOperationException("Framebuffer has more"
+                                                              + " targets than are supported"
+                                                              + " on the system!");
+
+                    if (context.boundDrawBuf != 100 + fb.getNumColorBuffers()){
+                        intBuf16.clear();
+                        for (int i = 0; i < fb.getNumColorBuffers(); i++)
+                            intBuf16.put( GL_COLOR_ATTACHMENT0_EXT + i );
+
+                        intBuf16.flip();
+                        glDrawBuffers(intBuf16);
+                        context.boundDrawBuf = 100 + fb.getNumColorBuffers();
+                    }
+                }else{
+                    RenderBuffer rb = fb.getColorBuffer(fb.getTargetIndex());
+                    // select this draw buffer
+                    if (context.boundDrawBuf != rb.getSlot()){
+                        glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + rb.getSlot());
+                        context.boundDrawBuf = rb.getSlot();
+                    }
+                }
+            }
+
+            assert fb.getId() >= 0;
+            assert context.boundFBO == fb.getId();
+            lastFb = fb;
+        }
+
+        try {
+            checkFrameBufferError();
+        } catch (IllegalStateException ex){
+            logger.log(Level.SEVERE, "Problem FBO:\n{0}", fb);
+            throw ex;
+        }
+    }
+*/
+    public void readFrameBuffer(FrameBuffer fb, ByteBuffer byteBuf){
+	logger.warning("readFrameBuffer is not supported.");
+    }
+/*
+    public void readFrameBuffer(FrameBuffer fb, ByteBuffer byteBuf){
+        if (fb != null){
+            RenderBuffer rb = fb.getColorBuffer();
+            if (rb == null)
+                throw new IllegalArgumentException("Specified framebuffer" +
+                                                   " does not have a colorbuffer");
+
+            setFrameBuffer(fb);
+            if (context.boundReadBuf != rb.getSlot()){
+                glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + rb.getSlot());
+                context.boundReadBuf = rb.getSlot();
+            }
+        }else{
+            setFrameBuffer(null);
+        }
+
+        glReadPixels(vpX, vpY, vpW, vpH, GL_RGBA GL_BGRA, GL_UNSIGNED_BYTE, byteBuf);
+    }
+*/
+    private void deleteRenderBuffer(FrameBuffer fb, RenderBuffer rb){
+	logger.warning("deleteRenderBuffer is not supported.");
+    }
+/*
+    private void deleteRenderBuffer(FrameBuffer fb, RenderBuffer rb){
+        intBuf1.put(0, rb.getId());
+        glDeleteRenderbuffersEXT(intBuf1);
+    }
+*/
+    public void deleteFrameBuffer(FrameBuffer fb) {
+	logger.warning("deleteFrameBuffer is not supported.");
+    }
+/*
+    public void deleteFrameBuffer(FrameBuffer fb) {
+        if (fb.getId() != -1){
+            if (context.boundFBO == fb.getId()){
+                glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+                context.boundFBO = 0;
+            }
+            
+            if (fb.getDepthBuffer() != null){
+                deleteRenderBuffer(fb, fb.getDepthBuffer());
+            }
+            if (fb.getColorBuffer() != null){
+                deleteRenderBuffer(fb, fb.getColorBuffer());
+            }
+
+            intBuf1.put(0, fb.getId());
+            glDeleteFramebuffersEXT(intBuf1);
+            fb.resetObject();
+
+            statistics.onDeleteFrameBuffer();
+        }
+    }
+*/
+
+    /*********************************************************************\
+    |* Textures                                                          *|
+    \*********************************************************************/
+    private int convertTextureType(Texture.Type type){
+        switch (type){
+            case TwoDimensional:
+                return GLES20.GL_TEXTURE_2D;
+    //        case TwoDimensionalArray:
+    //            return EXTTextureArray.GL_TEXTURE_2D_ARRAY_EXT;
+//            case ThreeDimensional:
+ //               return GLES20.GL_TEXTURE_3D;
+            case CubeMap:
+                return GLES20.GL_TEXTURE_CUBE_MAP;
+            default:
+                throw new UnsupportedOperationException("Unknown texture type: "+type);
+        }
+    }
+
+    private int convertMagFilter(Texture.MagFilter filter){
+        switch (filter){
+            case Bilinear:
+                return GLES20.GL_LINEAR;
+            case Nearest:
+                return GLES20.GL_NEAREST;
+            default:
+                throw new UnsupportedOperationException("Unknown mag filter: "+filter);
+        }
+    }
+
+    private int convertMinFilter(Texture.MinFilter filter){
+        switch (filter){
+            case Trilinear:
+                return GLES20.GL_LINEAR_MIPMAP_LINEAR;
+            case BilinearNearestMipMap:
+                return GLES20.GL_LINEAR_MIPMAP_NEAREST;
+            case NearestLinearMipMap:
+                return GLES20.GL_NEAREST_MIPMAP_LINEAR;
+            case NearestNearestMipMap:
+                return GLES20.GL_NEAREST_MIPMAP_NEAREST;
+            case BilinearNoMipMaps:
+                return GLES20.GL_LINEAR;
+            case NearestNoMipMaps:
+                return GLES20.GL_NEAREST;
+            default:
+                throw new UnsupportedOperationException("Unknown min filter: "+filter);
+        }
+    }
+
+    private int convertWrapMode(Texture.WrapMode mode){
+        switch (mode){
+//            case BorderClamp:
+//                return GLES20.GL_CLAMP_TO_BORDER;
+//            case Clamp:
+//                return GLES20.GL_CLAMP;
+            case EdgeClamp:
+                return GLES20.GL_CLAMP_TO_EDGE;
+            case Repeat:
+                return GLES20.GL_REPEAT;
+            case MirroredRepeat:
+                return GLES20.GL_MIRRORED_REPEAT;
+            default:
+                throw new UnsupportedOperationException("Unknown wrap mode: "+mode);
+        }
+    }
+
+    private void setupTextureParams(Texture tex){
+        int target = convertTextureType(tex.getType());
+
+        // filter things
+        int minFilter = convertMinFilter(tex.getMinFilter());
+        int magFilter = convertMagFilter(tex.getMagFilter());
+
+	if (verboseLogging)
+		logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_MIN_FILTER, " + minFilter + ")");
+
+        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_MIN_FILTER, minFilter);
+
+	if (verboseLogging)
+		logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_MAG_FILTER, " + magFilter + ")");
+
+        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_MAG_FILTER, magFilter);
+
+        if (tex.getAnisotropicFilter() > 1){
+/*
+            if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic){
+                glTexParameterf(target,
+                                EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
+                                tex.getAnisotropicFilter());
+            }
+*/
+        }
+        // repeat modes
+
+        switch (tex.getType()){
+            case ThreeDimensional:
+            case CubeMap: // cubemaps use 3D coords
+//                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_R, convertWrapMode(tex.getWrap(WrapAxis.R)));
+            case TwoDimensional:
+            case TwoDimensionalArray:
+
+		if (verboseLogging)
+			logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_WRAP_T, " + convertWrapMode(tex.getWrap(WrapAxis.T)));
+
+                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));
+                // fall down here is intentional..
+//            case OneDimensional:
+
+		if (verboseLogging)
+			logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_WRAP_S, " + convertWrapMode(tex.getWrap(WrapAxis.S)));
+
+                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
+                break;
+            default:
+                throw new UnsupportedOperationException("Unknown texture type: "+tex.getType());
+        }
+
+        // R to Texture compare mode
+/*
+        if (tex.getShadowCompareMode() != Texture.ShadowCompareMode.Off){
+            GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_MODE, GLES20.GL_COMPARE_R_TO_TEXTURE);
+            GLES20.glTexParameteri(target, GLES20.GL_DEPTH_TEXTURE_MODE, GLES20.GL_INTENSITY);
+            if (tex.getShadowCompareMode() == Texture.ShadowCompareMode.GreaterOrEqual){
+                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_FUNC, GLES20.GL_GEQUAL);
+            }else{
+                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_FUNC, GLES20.GL_LEQUAL);
+            }
+        }
+*/
+    }
+
+    public void updateTexImageData(Image img, Texture.Type type, boolean mips){
+        int texId = img.getId();
+        if (texId == -1){
+            // create texture
+
+		if (verboseLogging)
+			logger.info("GLES20.glGenTexture(1, buffer)");
+
+            GLES20.glGenTextures(1, intBuf1);
+            texId = intBuf1.get(0);
+            img.setId(texId);
+            objManager.registerForCleanup(img);
+
+            statistics.onNewTexture();
+        }
+
+        // bind texture
+        int target = convertTextureType(type);
+        if (context.boundTextures[0] != img){
+            if (context.boundTextureUnit != 0){
+
+		if (verboseLogging)
+			logger.info("GLES20.glActiveTexture(GLES20.GL_TEXTURE0)");
+
+                GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
+                context.boundTextureUnit = 0;
+            }
+
+		if (verboseLogging)
+			logger.info("GLES20.glBindTexture(" + target + ", " + texId + ")");
+
+            GLES20.glBindTexture(target, texId);
+            context.boundTextures[0] = img;
+        }
+
+        if (!img.hasMipmaps() && mips){
+            // No pregenerated mips available,
+            // generate from base level if required
+//          if (!GLContext.getCapabilities().GL_EXT_framebuffer_multisample){
+
+		if (verboseLogging)
+			logger.info("GLES20.glTexParameteri(" + target + "GLES11.GL_GENERATE_MIMAP, GLES20.GL_TRUE)");
+
+            GLES20.glTexParameteri(target, GLES11.GL_GENERATE_MIPMAP, GLES20.GL_TRUE);
+//          }
+        }else{
+//          glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, 0 );
+            if (img.getMipMapSizes() != null){
+//               GLES20.glTexParameteri(target, GLES11.GL_TEXTURE_MAX_LEVEL,  img.getMipMapSizes().length );
+            }
+        }
+
+
+        if (target == GLES20.GL_TEXTURE_CUBE_MAP){
+            List<ByteBuffer> data = img.getData();
+            if (data.size() != 6){
+                logger.log(Level.WARNING, "Invalid texture: {0}\n"
+                        + "Cubemap textures must contain 6 data units.", img);
+                return;
+            }
+            for (int i = 0; i < 6; i++){
+                TextureUtil.uploadTexture(gl, img, GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, i, 0, tdc, true, powerOf2);
+            }
+        }/*else if (target == EXTTextureArray.GL_TEXTURE_2D_ARRAY_EXT){
+            List<ByteBuffer> data = img.getData();
+            // -1 index specifies prepare data for 2D Array
+            TextureUtil.uploadTexture(img, target, -1, 0, tdc);
+            for (int i = 0; i < data.size(); i++){
+                // upload each slice of 2D array in turn
+                // this time with the appropriate index
+                 TextureUtil.uploadTexture(img, target, i, 0, tdc);
+            }
+        }*/else{
+            TextureUtil.uploadTexture(gl, img, target, 0, 0, tdc, true, powerOf2);
+
+		if (verboseLogging)
+			logger.info("GLES20.glTexParameteri(" + target + "GLES11.GL_GENERATE_MIMAP, GLES20.GL_TRUE)");
+
+		GLES20.glTexParameteri(target, GLES11.GL_GENERATE_MIPMAP, GLES20.GL_TRUE);
+        }
+            
+//            if (GLContext.getCapabilities().GL_EXT_framebuffer_multisample){
+//                glGenerateMipmapEXT(target);
+//            }
+        
+        img.clearUpdateNeeded();
+    }
+
+    public void setTexture(int unit, Texture tex){
+        Image image = tex.getImage();
+         if (image.isUpdateNeeded()){
+            updateTexImageData(image, tex.getType(), tex.getMinFilter().usesMipMapLevels());
+        }
+
+         int texId = image.getId();
+         assert texId != -1;
+
+	if (texId == -1) {
+		logger.warning("error: texture image has -1 id");
+	}
+
+         Image[] textures = context.boundTextures;
+
+         int type = convertTextureType(tex.getType());
+         if (!context.textureIndexList.moveToNew(unit)){
+//             if (context.boundTextureUnit != unit){
+//                glActiveTexture(GL_TEXTURE0 + unit);
+//                context.boundTextureUnit = unit;
+//             }
+//             glEnable(type);
+         }
+
+         if (textures[unit] != image){
+             if (context.boundTextureUnit != unit){
+		if (verboseLogging)
+			logger.info("GLES20.glActiveTexture(GLES20.GL_TEXTURE0 + " + unit + ")");
+                GLES20.glActiveTexture(GLES20.GL_TEXTURE0 + unit);
+                context.boundTextureUnit = unit;
+             }
+
+		if (verboseLogging)
+			logger.info("GLES20.glBindTexture(" + type + ", " + texId + ")");
+
+             GLES20.glBindTexture(type, texId);
+             textures[unit] = image;
+
+             statistics.onTextureUse(tex.getImage(), true);
+         }else{
+             statistics.onTextureUse(tex.getImage(), false);
+         }
+
+         setupTextureParams(tex);
+    }
+
+    public void clearTextureUnits(){
+        IDList textureList = context.textureIndexList;
+        Image[] textures = context.boundTextures;
+        for (int i = 0; i < textureList.oldLen; i++){
+            int idx = textureList.oldList[i];
+//            if (context.boundTextureUnit != idx){
+//                glActiveTexture(GL_TEXTURE0 + idx);
+//                context.boundTextureUnit = idx;
+//            }
+//            glDisable(convertTextureType(textures[idx].getType()));
+            textures[idx] = null;
+        }
+        context.textureIndexList.copyNewToOld();
+    }
+
+    public void deleteImage(Image image){
+        int texId = image.getId();
+        if (texId != -1){
+            intBuf1.put(0, texId);
+            intBuf1.position(0).limit(1);
+
+		if (verboseLogging)
+			logger.info("GLES20.glDeleteTexture(1, buffer)");
+
+            GLES20.glDeleteTextures(1, intBuf1);
+            image.resetObject();
+
+            statistics.onDeleteTexture();
+        }
+    }
+
+    /*********************************************************************\
+    |* Vertex Buffers and Attributes                                     *|
+    \*********************************************************************/
+    private int convertUsage(Usage usage){
+        switch (usage){
+            case Static:
+                return GLES20.GL_STATIC_DRAW;
+            case Dynamic:
+                return GLES20.GL_DYNAMIC_DRAW;
+            case Stream:
+                return GLES20.GL_STREAM_DRAW;
+            default:
+                throw new RuntimeException("Unknown usage type.");
+        }
+    }
+
+    private int convertFormat(Format format){
+        switch (format){
+            case Byte:
+                return GLES20.GL_BYTE;
+            case UnsignedByte:
+                return GLES20.GL_UNSIGNED_BYTE;
+            case Short:
+                return GLES20.GL_SHORT;
+            case UnsignedShort:
+                return GLES20.GL_UNSIGNED_SHORT;
+            case Int:
+                return GLES20.GL_INT;
+            case UnsignedInt:
+                return GLES20.GL_UNSIGNED_INT;
+/*
+            case Half:
+                return NVHalfFloat.GL_HALF_FLOAT_NV;
+//                return ARBHalfFloatVertex.GL_HALF_FLOAT;
+*/
+            case Float:
+                return GLES20.GL_FLOAT;
+//            case Double:
+//                return GLES20.GL_DOUBLE;
+            default:
+                throw new RuntimeException("Unknown buffer format.");
+
+        }
+    }
+
+    public void updateBufferData(VertexBuffer vb){
+
+	if (verboseLogging)
+		logger.info("updateBufferData(" + vb + ")");
+
+        int bufId = vb.getId();
+        boolean created = false;
+        if (bufId == -1){
+            // create buffer
+
+		if (verboseLogging)
+			logger.info("GLES20.glGenBuffers(" + 1 + ", buffer)");
+
+            GLES20.glGenBuffers(1, intBuf1);
+            bufId = intBuf1.get(0);
+            vb.setId(bufId);
+            objManager.registerForCleanup(vb);
+
+            created = true;
+        }
+
+        // bind buffer
+        int target;
+        if (vb.getBufferType() == VertexBuffer.Type.Index){
+            target = GLES20.GL_ELEMENT_ARRAY_BUFFER;
+
+		if (verboseLogging)
+			logger.info("vb.getBufferType() == VertexBuffer.Type.Index");
+
+            if (context.boundElementArrayVBO != bufId){
+
+		if (verboseLogging)
+			logger.info("GLES20.glBindBuffer(" + target + ", " + bufId + ")");
+
+                GLES20.glBindBuffer(target, bufId);
+                context.boundElementArrayVBO = bufId;
+            }
+        }else{
+		if (verboseLogging)
+			logger.info("vb.getBufferType() != VertexBuffer.Type.Index");
+
+            target = GLES20.GL_ARRAY_BUFFER;
+
+            if (context.boundArrayVBO != bufId){
+
+		if (verboseLogging)
+			logger.info("GLES20.glBindBuffer(" + target + ", " + bufId + ")");
+
+                GLES20.glBindBuffer(target, bufId);
+                context.boundArrayVBO = bufId;
+            }
+        }
+
+        int usage = convertUsage(vb.getUsage());
+        vb.getData().clear();
+
+        if (created || vb.hasDataSizeChanged()){
+            // upload data based on format
+		int size = vb.getData().capacity() * vb.getFormat().getComponentSize();
+
+            switch (vb.getFormat()){
+                case Byte:
+                case UnsignedByte:
+
+			if (verboseLogging)
+				logger.info("GLES20.glBufferData(" + target + ", " + size + ", (data), " + usage + ")");
+
+                    GLES20.glBufferData(target, size, (ByteBuffer) vb.getData(), usage);
+                    break;
+    //            case Half:
+                case Short:
+                case UnsignedShort:
+
+			if (verboseLogging)
+				logger.info("GLES20.glBufferData(" + target + ", " + size + ", (data), " + usage + ")");
+
+                    GLES20.glBufferData(target, size, (ShortBuffer) vb.getData(), usage);
+                    break;
+                case Int:
+                case UnsignedInt:
+
+			if (verboseLogging)
+				logger.info("GLES20.glBufferData(" + target + ", " + size + ", (data), " + usage + ")");
+
+                    GLES20.glBufferData(target, size, (IntBuffer) vb.getData(), usage);
+                    break;
+                case Float:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferData(" + target + ", " + size + ", (data), " + usage + ")");
+
+                    GLES20.glBufferData(target, size, (FloatBuffer) vb.getData(), usage);
+                    break;
+                case Double:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferData(" + target + ", " + size + ", (data), " + usage + ")");
+
+                    GLES20.glBufferData(target, size, (DoubleBuffer) vb.getData(), usage);
+                    break;
+                default:
+                    throw new RuntimeException("Unknown buffer format.");
+            }
+        }else{
+		int size = vb.getData().capacity() * vb.getFormat().getComponentSize();
+
+            switch (vb.getFormat()){
+                case Byte:
+                case UnsignedByte:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferSubData(" + target + ", 0, " + size + ", (data))");
+
+                    GLES20.glBufferSubData(target, 0, size, (ByteBuffer) vb.getData());
+                    break;
+                case Short:
+                case UnsignedShort:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferSubData(" + target + ", 0, " + size + ", (data))");
+
+                    GLES20.glBufferSubData(target, 0, size, (ShortBuffer) vb.getData());
+                    break;
+                case Int:
+                case UnsignedInt:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferSubData(" + target + ", 0, " + size + ", (data))");
+
+                    GLES20.glBufferSubData(target, 0, size, (IntBuffer) vb.getData());
+                    break;
+                case Float:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferSubData(" + target + ", 0, " + size + ", (data))");
+
+                    GLES20.glBufferSubData(target, 0, size, (FloatBuffer) vb.getData());
+                    break;
+                case Double:
+			if (verboseLogging)
+				logger.info("GLES20.glBufferSubData(" + target + ", 0, " + size + ", (data))");
+
+                    GLES20.glBufferSubData(target, 0, size, (DoubleBuffer) vb.getData());
+                    break;
+                default:
+                    throw new RuntimeException("Unknown buffer format.");
+            }
+        }
+//        }else{
+//            if (created || vb.hasDataSizeChanged()){
+//                glBufferData(target, vb.getData().capacity() * vb.getFormat().getComponentSize(), usage);
+//            }
+//
+//            ByteBuffer buf = glMapBuffer(target,
+//                                         GL_WRITE_ONLY,
+//                                         vb.getMappedData());
+//
+//            if (buf != vb.getMappedData()){
+//                buf = buf.order(ByteOrder.nativeOrder());
+//                vb.setMappedData(buf);
+//            }
+//
+//            buf.clear();
+//
+//            switch (vb.getFormat()){
+//                case Byte:
+//                case UnsignedByte:
+//                    buf.put( (ByteBuffer) vb.getData() );
+//                    break;
+//                case Short:
+//                case UnsignedShort:
+//                    buf.asShortBuffer().put( (ShortBuffer) vb.getData() );
+//                    break;
+//                case Int:
+//                case UnsignedInt:
+//                    buf.asIntBuffer().put( (IntBuffer) vb.getData() );
+//                    break;
+//                case Float:
+//                    buf.asFloatBuffer().put( (FloatBuffer) vb.getData() );
+//                    break;
+//                case Double:
+//                    break;
+//                default:
+//                    throw new RuntimeException("Unknown buffer format.");
+//            }
+//
+//            glUnmapBuffer(target);
+//        }
+
+        vb.clearUpdateNeeded();
+    }
+
+    public void deleteBuffer(VertexBuffer vb) {
+        int bufId = vb.getId();
+        if (bufId != -1){
+            // delete buffer
+            intBuf1.put(0, bufId);
+            intBuf1.position(0).limit(1);
+		if (verboseLogging)
+			logger.info("GLES20.glDeleteBuffers(1, buffer)");
+
+            GLES20.glDeleteBuffers(1, intBuf1);
+            vb.resetObject();
+        }
+    }
+
+    public void clearVertexAttribs(){
+        IDList attribList = context.attribIndexList;
+        for (int i = 0; i < attribList.oldLen; i++){
+            int idx = attribList.oldList[i];
+
+		if (verboseLogging)
+			logger.info("GLES20.glDisableVertexAttribArray(" + idx + ")");
+
+            GLES20.glDisableVertexAttribArray(idx);
+            context.boundAttribs[idx] = null;
+        }
+        context.attribIndexList.copyNewToOld();
+    }
+
+    public void setVertexAttrib(VertexBuffer vb, VertexBuffer idb){
+	if (verboseLogging)
+		logger.info("setVertexAttrib(" + vb + ", " + idb + ")");
+
+        if (vb.getBufferType() == VertexBuffer.Type.Index)
+            throw new IllegalArgumentException("Index buffers not allowed to be set to vertex attrib");
+
+        if (vb.isUpdateNeeded() && idb == null)
+            updateBufferData(vb);
+
+        int programId = context.boundShaderProgram;
+        if (programId > 0){
+            Attribute attrib = boundShader.getAttribute(vb.getBufferType().name());
+            int loc = attrib.getLocation();
+            if (loc == -1) {
+
+		if (verboseLogging)
+			logger.warning("location is invalid for attrib: [" + vb.getBufferType().name() + "]");
+
+                return; // not defined
+		}
+
+            if (loc == -2){
+//                stringBuf.setLength(0);
+//                stringBuf.append("in").append(vb.getBufferType().name()).append('\0');
+//                updateNameBuffer();
+
+		String attributeName = "in" + vb.getBufferType().name();
+
+		if (verboseLogging)
+			logger.info("GLES20.glGetAttribLocation(" + programId + ", " + attributeName + ")");
+
+                loc = GLES20.glGetAttribLocation(programId, attributeName);
+
+                // not really the name of it in the shader (inPosition\0) but
+                // the internal name of the enum (Position).
+                if (loc < 0){
+                    attrib.setLocation(-1);
+
+			if (verboseLogging)
+				logger.warning("attribute is invalid in shader: [" + vb.getBufferType().name() + "]");
+
+                    return; // not available in shader.
+                }else{
+                    attrib.setLocation(loc);
+                }
+            }
+
+            VertexBuffer[] attribs = context.boundAttribs;
+            if (!context.attribIndexList.moveToNew(loc)){
+		if (verboseLogging)
+			logger.info("GLES20.glEnableVertexAttribArray(" + loc + ")");
+
+                GLES20.glEnableVertexAttribArray(loc);
+                //System.out.println("Enabled ATTRIB IDX: "+loc);
+            }
+            if (attribs[loc] != vb){
+                // NOTE: Use id from interleaved buffer if specified
+                int bufId = idb != null ? idb.getId() : vb.getId();
+                assert bufId != -1;
+
+		if (bufId == -1) {
+			logger.warning("invalid buffer id");
+		}
+
+                if (context.boundArrayVBO != bufId){
+			if (verboseLogging)
+				logger.info("GLES20.glBindBuffer(" + GLES20.GL_ARRAY_BUFFER + ", " + bufId+ ")");
+                    GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, bufId);
+                    context.boundArrayVBO = bufId;
+                }
+
+		vb.getData().clear();
+
+		if (verboseLogging)
+			logger.info("GLES20.glVertexAttribPointer(" +
+				"location=" + loc + ", " +
+				"numComponents=" + vb.getNumComponents() + ", " +
+				"format=" + vb.getFormat() + ", " +
+				"isNormalized=" + vb.isNormalized() + ", " +
+				"stride=" + vb.getStride() + ", " +
+				"data.capacity=" + vb.getData().capacity() + ")"
+			);
+
+                GLES20.glVertexAttribPointer(loc,
+                                      vb.getNumComponents(),
+                                      convertFormat(vb.getFormat()),
+                                      vb.isNormalized(),
+                                      vb.getStride(),
+                                      vb.getData());
+
+                attribs[loc] = vb;
+            }
+        }else{
+            throw new IllegalStateException("Cannot render mesh without shader bound");
+        }
+    }
+
+    public void setVertexAttrib(VertexBuffer vb){
+        setVertexAttrib(vb, null);
+    }
+
+    public void drawTriangleArray(Mesh.Mode mode, int count, int vertCount){
+/*        if (count > 1){
+            ARBDrawInstanced.glDrawArraysInstancedARB(convertElementMode(mode), 0,
+                                                      vertCount, count);
+        }else{*/
+		if (verboseLogging)
+			logger.info("GLES20.glDrawArrays(" + vertCount + ")");
+
+            GLES20.glDrawArrays(convertElementMode(mode), 0, vertCount);
+/*
+        }*/
+    }
+
+    public void drawTriangleList(VertexBuffer indexBuf, Mesh mesh, int count){
+
+	if (verboseLogging)
+		logger.info("drawTriangleList(" + count + ")");
+
+        if (indexBuf.getBufferType() != VertexBuffer.Type.Index)
+            throw new IllegalArgumentException("Only index buffers are allowed as triangle lists.");
+
+        if (indexBuf.isUpdateNeeded()) {
+		if (verboseLogging)
+			logger.info("updateBufferData for indexBuf.");
+            updateBufferData(indexBuf);
+	}
+
+        int bufId = indexBuf.getId();
+        assert bufId != -1;
+
+	if (bufId == -1) {
+		logger.info("invalid buffer id!");
+	}
+
+        if (context.boundElementArrayVBO != bufId){
+		if (verboseLogging)
+			logger.info("GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, " + bufId + ")");
+
+            GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, bufId);
+            context.boundElementArrayVBO = bufId;
+        }
+
+        int vertCount = mesh.getVertexCount();
+        boolean useInstancing = count > 1 && caps.contains(Caps.MeshInstancing);
+
+        Buffer indexData = indexBuf.getData();
+
+        if (mesh.getMode() == Mode.Hybrid){
+            int[] modeStart      = mesh.getModeStart();
+            int[] elementLengths = mesh.getElementLengths();
+            
+            int elMode = convertElementMode(Mode.Triangles);
+            int fmt    = convertFormat(indexBuf.getFormat());
+            int elSize = indexBuf.getFormat().getComponentSize();
+            int listStart = modeStart[0];
+            int stripStart = modeStart[1];
+            int fanStart = modeStart[2];
+            int curOffset = 0;
+            for (int i = 0; i < elementLengths.length; i++){
+                if (i == stripStart){
+                    elMode = convertElementMode(Mode.TriangleStrip);
+                }else if (i == fanStart){
+                    elMode = convertElementMode(Mode.TriangleStrip);
+                }
+                int elementLength = elementLengths[i];
+
+                if (useInstancing){
+                    //ARBDrawInstanced.
+			throw new IllegalArgumentException("instancing is not supported.");
+/*
+                    GLES20.glDrawElementsInstancedARB(elMode,
+                                               elementLength,
+                                               fmt,
+                                               curOffset,
+                                               count);
+*/
+                }else{
+			indexBuf.getData().position(curOffset);
+			if (verboseLogging)
+				logger.info("glDrawElements(): " + elementLength + ", " + curOffset);
+
+			GLES20.glDrawElements(elMode, elementLength, fmt, indexBuf.getData());
+/*
+                    glDrawRangeElements(elMode,
+                                        0,
+                                        vertCount,
+                                        elementLength,
+                                        fmt,
+                                        curOffset);
+*/
+                }
+
+                curOffset += elementLength * elSize;
+            }
+        }else{
+            if (useInstancing){
+			throw new IllegalArgumentException("instancing is not supported.");
+                //ARBDrawInstanced.
+/*
+                GLES20.glDrawElementsInstancedARB(convertElementMode(mesh.getMode()),
+                                           indexBuf.getData().capacity(),
+                                           convertFormat(indexBuf.getFormat()),
+                                           0,
+                                           count);
+*/
+            }else{
+       			indexData.clear();
+
+			if (verboseLogging)
+				logger.info("glDrawElements(), indexBuf.capacity (" + indexBuf.getData().capacity() + "), vertCount (" + vertCount + ")");
+
+			GLES11.glDrawElements(
+				convertElementMode(mesh.getMode()),
+				indexBuf.getData().capacity(),
+				convertFormat(indexBuf.getFormat()),
+				0
+			);
+            }
+        }
+    }
+
+    /*********************************************************************\
+    |* Render Calls                                                      *|
+    \*********************************************************************/
+    public int convertElementMode(Mesh.Mode mode){
+        switch (mode){
+            case Points:
+                return GLES20.GL_POINTS;
+            case Lines:
+                return GLES20.GL_LINES;
+            case LineLoop:
+                return GLES20.GL_LINE_LOOP;
+            case LineStrip:
+                return GLES20.GL_LINE_STRIP;
+            case Triangles:
+                return GLES20.GL_TRIANGLES;
+            case TriangleFan:
+                return GLES20.GL_TRIANGLE_FAN;
+            case TriangleStrip:
+                return GLES20.GL_TRIANGLE_STRIP;
+            default:
+                throw new UnsupportedOperationException("Unrecognized mesh mode: "+mode);
+        }
+    }
+
+    public void updateVertexArray(Mesh mesh){
+	logger.info("updateVertexArray(" + mesh + ")");
+        int id = mesh.getId();
+/*
+        if (id == -1){
+            IntBuffer temp = intBuf1;
+      //      ARBVertexArrayObject.glGenVertexArrays(temp);
+            GLES20.glGenVertexArrays(temp);
+            id = temp.get(0);
+            mesh.setId(id);
+        }
+
+        if (context.boundVertexArray != id){
+       //     ARBVertexArrayObject.glBindVertexArray(id);
+            GLES20.glBindVertexArray(id);
+            context.boundVertexArray = id;
+        }
+*/
+        VertexBuffer interleavedData = mesh.getBuffer(Type.InterleavedData);
+        if (interleavedData != null && interleavedData.isUpdateNeeded()){
+            updateBufferData(interleavedData);
+        }
+
+        IntMap<VertexBuffer> buffers = mesh.getBuffers();
+        for (Entry<VertexBuffer> entry : buffers){
+            VertexBuffer vb = entry.getValue();
+
+            if (vb.getBufferType() == Type.InterleavedData
+             || vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers
+             || vb.getBufferType() == Type.Index)
+                continue;
+
+            if (vb.getStride() == 0){
+                // not interleaved
+                setVertexAttrib(vb);
+            }else{
+                // interleaved
+                setVertexAttrib(vb, interleavedData);
+            }
+        }
+    }
+
+  
+     /**
+      * renderMeshVertexArray renders a mesh using vertex arrays
+      * @param mesh
+      * @param lod
+      * @param count
+      */
+     private void renderMeshVertexArray(Mesh mesh, int lod, int count)
+     {
+         if (verboseLogging)
+             logger.info("renderMeshVertexArray");
+ 
+         IntMap<VertexBuffer> buffers = mesh.getBuffers();
+         for (Entry<VertexBuffer> entry : buffers){
+             VertexBuffer vb = entry.getValue();
+ 
+             if (vb.getBufferType() == Type.InterleavedData
+                     || vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers
+                     || vb.getBufferType() == Type.Index)
+                 continue;
+ 
+             if (vb.getStride() == 0){
+                 // not interleaved
+                 setVertexAttrib_Array(vb);
+             }else{
+                 // interleaved
+                 VertexBuffer interleavedData = mesh.getBuffer(Type.InterleavedData);
+                 setVertexAttrib_Array(vb, interleavedData);
+             }
+         }
+ 
+         VertexBuffer indices = null;
+         if (mesh.getNumLodLevels() > 0)
+         {
+             indices = mesh.getLodLevel(lod);
+         }
+         else
+         {
+             indices = buffers.get(Type.Index.ordinal());
+          }
+         if (indices != null)
+         {
+             drawTriangleList_Array(indices, mesh, count);
+         }
+         else
+         {
+             if (verboseLogging)
+                 logger.info("GLES20.glDrawArrays(" + mesh.getMode() + ", " + 0 + ", " + mesh.getVertexCount() + ")");
+ 
+             GLES20.glDrawArrays(convertElementMode(mesh.getMode()), 0, mesh.getVertexCount());
+         }
+        clearVertexAttribs();
+        clearTextureUnits();
+    }
+
+
+    private void renderMeshDefault(Mesh mesh, int lod, int count){
+	if (verboseLogging)
+		logger.info("renderMeshDefault(" + mesh + ", " + lod + ", " + count + ")");
+        VertexBuffer indices = null;
+
+        VertexBuffer interleavedData = mesh.getBuffer(Type.InterleavedData);
+        if (interleavedData != null && interleavedData.isUpdateNeeded()){
+            updateBufferData(interleavedData);
+        }
+
+        IntMap<VertexBuffer> buffers = mesh.getBuffers();
+        if (mesh.getNumLodLevels() > 0){
+            indices = mesh.getLodLevel(lod);
+        }else{
+            indices = buffers.get(Type.Index.ordinal());
+        }
+        for (Entry<VertexBuffer> entry : buffers){
+            VertexBuffer vb = entry.getValue();
+            
+            if (vb.getBufferType() == Type.InterleavedData 
+             || vb.getUsage() == Usage.CpuOnly // ignore cpu-only buffers
+             || vb.getBufferType() == Type.Index)
+                continue;
+
+            if (vb.getStride() == 0){
+                // not interleaved
+                setVertexAttrib(vb);
+            }else{
+                // interleaved
+                setVertexAttrib(vb, interleavedData);
+            }
+        }
+        if (indices != null){
+            drawTriangleList(indices, mesh, count);
+        }else{
+//            throw new UnsupportedOperationException("Cannot render without index buffer");
+		if (verboseLogging)
+			logger.info("GLES20.glDrawArrays(" + convertElementMode(mesh.getMode()) + ", 0, " + mesh.getVertexCount() + ")");
+
+            GLES20.glDrawArrays(convertElementMode(mesh.getMode()), 0, mesh.getVertexCount());
+       }
+        clearVertexAttribs();
+        clearTextureUnits();
+    }
+
+    public void renderMesh(Mesh mesh, int lod, int count) {
+        if (context.pointSize != mesh.getPointSize()){
+
+		if (verboseLogging)
+			logger.info("GLES10.glPointSize(" + mesh.getPointSize() + ")");
+
+            GLES10.glPointSize(mesh.getPointSize());
+            context.pointSize = mesh.getPointSize();
+        }
+        if (context.lineWidth != mesh.getLineWidth()){
+
+		if (verboseLogging)
+			logger.info("GLES20.glLineWidth(" + mesh.getLineWidth() + ")");
+
+            GLES20.glLineWidth(mesh.getLineWidth());
+            context.lineWidth = mesh.getLineWidth();
+        }
+
+        statistics.onMeshDrawn(mesh, lod);
+//        if (GLContext.getCapabilities().GL_ARB_vertex_array_object){
+//            renderMeshVertexArray(mesh, lod, count);
+//        }else{
+
+		if (useVBO) {
+			if (verboseLogging)
+				logger.info("RENDERING A MESH USING VertexBufferObject");
+
+			renderMeshDefault(mesh, lod, count);
+		} else {
+			if (verboseLogging)
+				logger.info("RENDERING A MESH USING VertexArray");
+
+			renderMeshVertexArray(mesh, lod, count);
+		}
+
+//        }
+    }
+
+	private void checkGLError() {
+		int error;
+		while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
+			logger.warning("glError " + error);
+		//	throw new RuntimeException("glError " + error);
+		}
+	}
+
+	private boolean log(String message) {
+		logger.info(message);
+		return true;
+	}
+
+   /**
+    * drawTriangleList_Array uses Vertex Array
+    * @param indexBuf
+    * @param mesh
+    * @param count
+    */
+   public void drawTriangleList_Array(VertexBuffer indexBuf, Mesh mesh, int count)
+   {
+       if (verboseLogging)
+           logger.info("drawTriangleList_Array(Count = " + count + ")");
+
+       if (indexBuf.getBufferType() != VertexBuffer.Type.Index)
+           throw new IllegalArgumentException("Only index buffers are allowed as triangle lists.");
+
+       boolean useInstancing = count > 1 && caps.contains(Caps.MeshInstancing);
+       if (useInstancing)
+       {
+           throw new IllegalArgumentException("Caps.MeshInstancing is not supported.");
+       }
+
+       int vertCount = mesh.getVertexCount();
+       Buffer indexData = indexBuf.getData();
+       indexData.clear();
+
+       if (mesh.getMode() == Mode.Hybrid)
+       {
+           int[] modeStart      = mesh.getModeStart();
+           int[] elementLengths = mesh.getElementLengths();
+
+           int elMode = convertElementMode(Mode.Triangles);
+           int fmt    = convertFormat(indexBuf.getFormat());
+           int elSize = indexBuf.getFormat().getComponentSize();
+           int listStart = modeStart[0];
+           int stripStart = modeStart[1];
+           int fanStart = modeStart[2];
+           int curOffset = 0;
+           for (int i = 0; i < elementLengths.length; i++)
+           {
+               if (i == stripStart)
+               {
+                   elMode = convertElementMode(Mode.TriangleStrip);
+               }
+               else if (i == fanStart)
+               {
+                   elMode = convertElementMode(Mode.TriangleStrip);
+               }
+               int elementLength = elementLengths[i];
+
+               indexBuf.getData().position(curOffset);
+               if (verboseLogging)
+                   logger.info("glDrawElements(): " + elementLength + ", " + curOffset);
+
+               GLES20.glDrawElements(elMode, elementLength, fmt, indexBuf.getData());
+
+               curOffset += elementLength * elSize;
+           }
+       }
+       else    //if (mesh.getMode() == Mode.Hybrid)
+       {
+           if (verboseLogging)
+               logger.info("glDrawElements(), indexBuf.capacity (" + indexBuf.getData().capacity() + "), vertCount (" + vertCount + ")");
+
+           GLES20.glDrawElements(
+                   convertElementMode(mesh.getMode()),
+                   indexBuf.getData().capacity(),
+                   convertFormat(indexBuf.getFormat()),
+                   indexBuf.getData()
+           );
+       }
+   }
+
+   /**
+    * setVertexAttrib_Array uses Vertex Array
+    * @param vb
+    * @param idb
+    */
+   public void setVertexAttrib_Array(VertexBuffer vb, VertexBuffer idb)
+   {
+       if (verboseLogging)
+           logger.info("setVertexAttrib_Array(" + vb + ", " + idb + ")");
+
+       if (vb.getBufferType() == VertexBuffer.Type.Index)
+           throw new IllegalArgumentException("Index buffers not allowed to be set to vertex attrib");
+
+       // Get shader
+       int programId = context.boundShaderProgram;
+       if (programId > 0)
+       {
+           VertexBuffer[] attribs = context.boundAttribs;
+
+           Attribute attrib = boundShader.getAttribute(vb.getBufferType().name());
+           int loc = attrib.getLocation();
+           if (loc == -1)
+           {
+               //throw new IllegalArgumentException("Location is invalid for attrib: [" + vb.getBufferType().name() + "]");
+               if (verboseLogging)
+                   logger.warning("attribute is invalid in shader: [" + vb.getBufferType().name() + "]");
+               return;
+           }
+           else if (loc == -2)
+           {
+               String attributeName = "in" + vb.getBufferType().name();
+
+               if (verboseLogging)
+                   logger.info("GLES20.glGetAttribLocation(" + programId + ", " + attributeName + ")");
+
+               loc = GLES20.glGetAttribLocation(programId, attributeName);
+               if (loc < 0)
+               {
+                   attrib.setLocation(-1);
+                   if (verboseLogging)
+                       logger.warning("attribute is invalid in shader: [" + vb.getBufferType().name() + "]");
+                   return; // not available in shader.
+               }
+               else
+               {
+                   attrib.setLocation(loc);
+               }
+
+           }  // if (loc == -2)
+
+           if ((attribs[loc] != vb) || vb.isUpdateNeeded())
+           {
+               // NOTE: Use data from interleaved buffer if specified
+               VertexBuffer avb = idb != null ? idb : vb;
+               avb.getData().clear();
+               avb.getData().position(vb.getOffset());
+
+               if (verboseLogging)
+                   logger.info("GLES20.glVertexAttribPointer(" +
+                           "location=" + loc + ", " +
+                           "numComponents=" + vb.getNumComponents() + ", " +
+                           "format=" + vb.getFormat() + ", " +
+                           "isNormalized=" + vb.isNormalized() + ", " +
+                           "stride=" + vb.getStride() + ", " +
+                           "data.capacity=" + avb.getData().capacity() + ")"
+                   );
+
+
+               // Upload attribute data
+               GLES20.glVertexAttribPointer(loc,
+                       vb.getNumComponents(),
+                       convertFormat(vb.getFormat()),
+                       vb.isNormalized(),
+                       vb.getStride(),
+                       avb.getData());
+               checkGLError();
+
+               GLES20.glEnableVertexAttribArray(loc);
+
+               attribs[loc] = vb;
+           } // if (attribs[loc] != vb)
+       }
+       else
+       {
+           throw new IllegalStateException("Cannot render mesh without shader bound");
+       }
+   }
+
+   /**
+    * setVertexAttrib_Array uses Vertex Array
+    * @param vb
+    */
+   public void setVertexAttrib_Array(VertexBuffer vb)
+   {
+       setVertexAttrib_Array(vb, null);
+   }
+
+   public void setAlphaToCoverage(boolean value)
+   {
+       // TODO Auto-generated method stub
+   }
+}

Some files were not shown because too many files changed in this diff