diff options
author | Sven Gothel <[email protected]> | 2019-06-23 08:03:04 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-06-23 08:03:04 +0200 |
commit | bba73bc096250a3c7fc036d84b1ea054d1b70b06 (patch) | |
tree | ed02575eac2a46bd49627444dcce972946ae8d2e /make | |
parent | 154e91978498d8b6db9ce34a1f06b298bcf4c361 (diff) |
iOS: Initial working commit supporting iOS (ipad pro 11)
using our OpenJFK 9 x86_64 and arm64 build.
Test demo class is 'com.jogamp.opengl.demos.ios.Hello',
residing in the new demo folder 'src/demos/com/jogamp/opengl/demos/ios/Hello.java'.
This commit does not yet include a working NEWT
specialization for iOS, but it shall followup soon.
Instead this commit demonstrates JOGL operating on
native UIWindow, UIView and CAEAGLLayer as provided by
Nativewindow's IOSUtil.
Test Video https://www.youtube.com/watch?v=Z4lUQNFTGMI
+++
Notable bug: The FBO used and sharing the COLORBUFFER RENDERBUFFER
memory resources with CAEAGLLayer to be displayed in the UIView
seemingly cannot handle GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24
or GL_DEPTH_COMPONENT32 depth buffer - none at all (Device + Simulation).
Therefor the default demo GLEventListener chosen here
don't require a depth buffer ;-)
This issue can hopefully be mitigated with other means
than using a flat FBO sink similar to FBO multisampling.
Diffstat (limited to 'make')
25 files changed, 506 insertions, 64 deletions
diff --git a/make/build-common.xml b/make/build-common.xml index 7ba8f74fc..84a2e3014 100644 --- a/make/build-common.xml +++ b/make/build-common.xml @@ -93,16 +93,22 @@ <property name="archive.name" value="jogl-${jogl.version}-${os.and.arch}" /> <property name="archive" value="${build}/${archive.name}" /> + <condition property="setup.noAWT"> + <or> + <istrue value="${isIOS}" /> + </or> + </condition> <condition property="setup.noNativeAWT"> <or> <isset property="setup.noAWT"/> - <isset property="isAndroid"/> + <istrue value="${isAndroid}" /> </or> </condition> <condition property="setup.noNativeDesktop"> <or> - <isset property="isAndroid"/> + <istrue value="${isAndroid}" /> + <istrue value="${isIOS}" /> </or> </condition> @@ -140,13 +146,12 @@ <istrue value="${isLinuxX86}" /> <!-- no more supported since SWT 4.10 --> </condition> <condition property="swt.jar" value="${project.root}/make/lib/swt/gtk-linux-x86_64/swt.jar"> - <istrue value="${isLinuxARM64}" /> <!-- FIXME JAU .. hack --> - </condition> - <condition property="swt.jar" value="${project.root}/make/lib/swt/gtk-linux-x86_64/swt.jar"> - <istrue value="${isLinuxARMv6}" /> <!-- FIXME JAU .. hack --> - </condition> - <condition property="swt.jar" value="${project.root}/make/lib/swt/gtk-linux-x86_64/swt.jar"> - <istrue value="${isAndroid}" /> <!-- FIXME JAU .. hack --> + <or> + <istrue value="${isLinuxARM64}" /> <!-- FIXME JAU .. hack --> + <istrue value="${isLinuxARMv6}" /> <!-- FIXME JAU .. hack --> + <istrue value="${isAndroid}" /> <!-- FIXME JAU .. hack --> + <istrue value="${isIOS}" /> <!-- FIXME JAU .. hack --> + </or> </condition> <property name="swt-cocoa-macosx-x86_64.jar" value="${project.root}/make/lib/swt/cocoa-macosx-x86_64/swt.jar"/> <condition property="swt.jar" value="${swt-cocoa-macosx-x86_64.jar}"> @@ -252,6 +257,7 @@ <property name="results.test" value="${build}/test/results" /> <property name="build.test" value="${build}/test/build" /> <property name="obj.test" value="${build.test}/obj"/> + <property name="build.demos" value="${build}/demos/build" /> <condition property="obj.custom" value="${custom.libdir}${path.separator}" else=""> <isset property="custom.libdir"/> @@ -282,6 +288,7 @@ <property name="nativewindow-os-x11.jar" value="${build.nativewindow}/nativewindow-os-x11.jar" /> <property name="nativewindow-os-win.jar" value="${build.nativewindow}/nativewindow-os-win.jar" /> <property name="nativewindow-os-osx.jar" value="${build.nativewindow}/nativewindow-os-osx.jar" /> + <property name="nativewindow-os-ios.jar" value="${build.nativewindow}/nativewindow-os-ios.jar" /> <path id="nativewindow_all_atoms.classpath"> <pathelement location="${nativewindow.jar}" /> @@ -289,12 +296,14 @@ <pathelement location="${nativewindow-os-x11.jar}" /> <pathelement location="${nativewindow-os-win.jar}" /> <pathelement location="${nativewindow-os-osx.jar}" /> + <pathelement location="${nativewindow-os-ios.jar}" /> </path> <path id="nativewindow_all-noawt_atoms.classpath"> <pathelement location="${nativewindow.jar}" /> <pathelement location="${nativewindow-os-x11.jar}" /> <pathelement location="${nativewindow-os-win.jar}" /> <pathelement location="${nativewindow-os-osx.jar}" /> + <pathelement location="${nativewindow-os-ios.jar}" /> </path> <path id="nativewindow_core_atoms.classpath"> <pathelement location="${nativewindow.jar}" /> @@ -314,6 +323,7 @@ <property name="jogl-os-x11.jar" value="${build.jogl}/jogl-os-x11.jar" /> <property name="jogl-os-win.jar" value="${build.jogl}/jogl-os-win.jar" /> <property name="jogl-os-osx.jar" value="${build.jogl}/jogl-os-osx.jar" /> + <property name="jogl-os-ios.jar" value="${build.jogl}/jogl-os-ios.jar" /> <property name="jogl-os-android.jar" value="${build.jogl}/jogl-os-android.jar" /> <property name="jogl-gldesktop.jar" value="${build.jogl}/jogl-gldesktop.jar" /> <property name="jogl-gldesktop-dbg.jar" value="${build.jogl}/jogl-gldesktop-dbg.jar" /> @@ -337,6 +347,7 @@ <pathelement location="${jogl-os-x11.jar}" /> <pathelement location="${jogl-os-win.jar}" /> <pathelement location="${jogl-os-osx.jar}" /> + <pathelement location="${jogl-os-ios.jar}" /> <pathelement location="${jogl-gldesktop.jar}" /> <pathelement location="${jogl-gldesktop-dbg.jar}" /> <pathelement location="${jogl-glu.jar}" /> @@ -355,6 +366,7 @@ <pathelement location="${jogl-os-x11.jar}" /> <pathelement location="${jogl-os-win.jar}" /> <pathelement location="${jogl-os-osx.jar}" /> + <pathelement location="${jogl-os-ios.jar}" /> <pathelement location="${jogl-gldesktop.jar}" /> <pathelement location="${jogl-gldesktop-dbg.jar}" /> <pathelement location="${jogl-glu.jar}" /> @@ -371,6 +383,7 @@ <pathelement location="${jogl-glu.jar}" /> <pathelement location="${jogl-util-fixedfuncemu.jar}" /> <pathelement location="${jogl-os-x11.jar}" /> + <pathelement location="${jogl-os-ios.jar}" /> <pathelement location="${jogl-omx.jar}" /> </path> <path id="jogl_all-android_atoms.classpath"> @@ -397,6 +410,7 @@ <property name="newt-driver-x11.jar" value="${build.newt}/newt-driver-x11.jar" /> <property name="newt-driver-win.jar" value="${build.newt}/newt-driver-win.jar" /> <property name="newt-driver-osx.jar" value="${build.newt}/newt-driver-osx.jar" /> + <property name="newt-driver-ios.jar" value="${build.newt}/newt-driver-ios.jar" /> <property name="newt-driver-android.jar" value="${build.newt}/newt-driver-android.jar" /> <!-- excluded from all --> <property name="newt-driver-kd.jar" value="${build.newt}/newt-driver-kd.jar" /> <!-- excluded from all --> <property name="newt-driver-intelgdl.jar" value="${build.newt}/newt-driver-intelgdl.jar" /> <!-- excluded from all --> @@ -412,6 +426,7 @@ <pathelement location="${newt-driver-x11.jar}" /> <pathelement location="${newt-driver-win.jar}" /> <pathelement location="${newt-driver-osx.jar}" /> + <pathelement location="${newt-driver-ios.jar}" /> <pathelement location="${newt-driver-bcm-vc.jar}" /> </path> <path id="newt_all-noawt_atoms.classpath"> @@ -421,6 +436,7 @@ <pathelement location="${newt-driver-x11.jar}" /> <pathelement location="${newt-driver-win.jar}" /> <pathelement location="${newt-driver-osx.jar}" /> + <pathelement location="${newt-driver-ios.jar}" /> <pathelement location="${newt-driver-bcm-vc.jar}" /> </path> <path id="newt_all-mobile_atoms.classpath"> @@ -429,6 +445,7 @@ <pathelement location="${newt-driver-linux.jar}" /> <pathelement location="${newt-driver-x11.jar}" /> <pathelement location="${newt-driver-win.jar}" /> + <pathelement location="${newt-driver-ios.jar}" /> <pathelement location="${newt-driver-bcm-vc.jar}" /> </path> <path id="newt_all-android_atoms.classpath"> @@ -449,6 +466,7 @@ <property name="jogl-test.jar" value="${jar}/jogl-test.jar"/> <property name="jogl-test-android.jar" value="${jar}/jogl-test-android.jar"/> <property name="jogl-test-android.apk" value="${jar}/jogl-test-android.apk"/> + <property name="jogl-demos-mobile.jar" value="${jar}/jogl-demos-mobile.jar"/> <!-- JavaSE combinations . AWT --> <property name="jogl-all.jar" value="${jar}/jogl-all.jar" /> diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 1d867c56b..db80c298c 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -113,15 +113,18 @@ <property name="java.part.sdk" value="com/jogamp/opengl/util/glsl/sdk/**"/> - <property name="java.part.glx" + <property name="java.part.x11.glx" value="jogamp/opengl/x11/glx/*"/> - <property name="java.part.wgl" + <property name="java.part.win.wgl" value="jogamp/opengl/windows/wgl/*"/> - <property name="java.part.cgl" + <property name="java.part.osx.cgl" value="jogamp/opengl/macosx/cgl/*"/> + <property name="java.part.ios.eagl" + value="jogamp/opengl/ios/eagl/*"/> + <property name="java.part.android" value="jogamp/opengl/android/**"/> @@ -188,9 +191,6 @@ <property name="java.part.nonjava" value="${java.part.core.shadercode} ${java.part.util.shadercode} ${java.part.util.fixedfuncemu.shadercode} ${java.part.util.graph.shadercode} ${java.part.util.graph.fonts}"/> - <property name="java.part.all-desktop" - value="${java.part.sdk} ${java.part.glx} ${java.part.wgl} ${java.part.cgl} ${java.part.gldesktop} ${java.part.glu.gldesktop} ${java.part.util.gldesktop}"/> - <!-- condition excludes --> <condition property="java.excludes.awt" @@ -347,6 +347,7 @@ <mkdir dir="${src.generated.java}" /> <mkdir dir="${src.generated.c}" /> <mkdir dir="${src.generated.c}/MacOSX" /> + <mkdir dir="${src.generated.c}/iOS" /> <mkdir dir="${src.generated.c}/Windows" /> <mkdir dir="${src.generated.c}/X11" /> <mkdir dir="${src.generated.c.openmax}" /> @@ -709,7 +710,7 @@ </gluegen> </target> - <target name="java.generate.platform.glext"> + <target name="java.generate.platform.glext" if="glext.platform.cfg"> <echo message="Generating platform-specific OpenGL extension class: ${window.os.system}" /> <antcall target="java.generate.copy2temp" inheritRefs="true" /> <gluegen src="${glext.platform.header}" @@ -862,6 +863,13 @@ <param name="glext.platform.header" value="${stub.includes}/macosx/cglext.c" /> </antcall> + <antcall target="java.generate.gl.platforms" inheritRefs="true"> + <param name="window.os.system" value="ios"/> + <param name="window.os1.cfg" value="${config.jogl}/eagl-ios.cfg" /> + <!-- param name="glext.platform.cfg" value="${config.jogl}/eagl-ext.cfg" /--> + <!-- param name="glext.platform.header" value="${stub.includes}/ios/eagl-ext.c" /--> + </antcall> + <!-- Generate GLU class --> <antcall target="java.generate.glu.base" inheritrefs="true" /> <antcall target="java.generate.glu.GL2ES1" inheritrefs="true" /> @@ -1280,6 +1288,26 @@ <linkerarg value="Cg"/> </linker--> + <linker id="linker.cfg.ios.amd64.jogl" extends="linker.cfg.ios.amd64"> + <!-- linkerarg value="-v" / --> + <linkerarg value="-weak_framework" /> + <linkerarg value="UIKit" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="QuartzCore" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="OpenGLES" /> + </linker> + + <linker id="linker.cfg.ios.arm64.jogl" extends="linker.cfg.ios.arm64"> + <!-- linkerarg value="-v" / --> + <linkerarg value="-weak_framework" /> + <linkerarg value="UIKit" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="QuartzCore" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="OpenGLES" /> + </linker> + <linker id="linker.cfg.hpux.jogl" extends="linker.cfg.hpux"> <syslibset dir="/opt/graphics/OpenGL/lib" libs="GL, GLU"/> <syslibset dir="/usr/lib" libs="X11"/> @@ -1426,8 +1454,18 @@ <property name="compiler.cfg.id" value="compiler.cfg.macosx" /> <property name="linker.cfg.id.os" value="linker.cfg.macosx.jogl" /> </target> + + <target name="c.configure.ios.amd64" if="isIOSAmd64"> + <property name="compiler.cfg.id" value="compiler.cfg.ios.amd64" /> + <property name="linker.cfg.id.os" value="linker.cfg.ios.amd64.jogl" /> + </target> + + <target name="c.configure.ios.arm64" if="isIOSArm64"> + <property name="compiler.cfg.id" value="compiler.cfg.ios.arm64" /> + <property name="linker.cfg.id.os" value="linker.cfg.ios.arm64.jogl" /> + </target> - <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" /> + <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.ios.amd64, c.configure.ios.arm64, c.configure.freebsd,c.configure.hpux" /> <target name="c.configure" depends="c.configure.1,c.configure.2" /> @@ -1467,12 +1505,11 @@ <fileset dir="${project.root}" includes="${rootrel.src.c.libav}/*"/> </sourcefiles> <targetfiles> - <fileset dir="${obj.joglsub}" includes="lib@{output.lib.name}.so"/> - <fileset dir="${obj.joglsub}" includes="@{output.lib.name}.dll"/> - <fileset dir="${obj.joglsub}" includes="lib@{output.lib.name}.dylib"/> + <fileset dir="${obj.joglsub}" includes="${native.library.prefix}@{output.lib.name}.${native.library.suffix}"/> </targetfiles> <sequential> - <cc outtype="shared" + <cc outtype="${output.lib.type}" + usehighleveltool="true" objdir="${obj.joglsub}" outfile="${obj.joglsub}/@{output.lib.name}" optimize="${c.compiler.optimise}" @@ -1502,6 +1539,9 @@ <linker extends="@{linker.cfg.id}"> </linker> </cc> + <gluegen.make.libsymbols builddir="${build}" + nativelib="${obj.joglsub}/${native.library.prefix}@{output.lib.name}.${native.library.suffix}" + symbolsfile="${obj.joglsub}/${native.library.prefix}@{output.lib.name}.symbols"/> </sequential> </outofdate> </sequential> @@ -1529,15 +1569,17 @@ </patternset> <patternset id="c.src.files.jogl.desktop"> + <include name="${rootrel.src.c}/JVM_JNI8.c"/> <include name="${rootrel.src.c}/JoglCommon.c"/> <include name="${rootrel.src.c}/GLContext.c"/> <include name="${rootrel.src.c}/EGLContext.c"/> <include name="${rootrel.src.c}/GLDebugMessageHandler.c"/> - <include name="${rootrel.src.c}/timespec.c" if="isOSX"/> <!-- currently only used for OSX --> + <include name="${rootrel.src.c}/timespec.c" if="isOSX"/> <!-- currently only used for OSX, iOS --> <include name="${rootrel.src.c}/macosx/MacOSXCustomCGLCode.c" if="isOSX"/> <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/> <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface-calayer.m" if="isOSX"/> <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/> + <!-- include name="${rootrel.src.c}/ios/lalalala.m" if="isIOS"/ --> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> <!-- FIXME: the Mixer should be moved to another library --> <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/--> @@ -1556,11 +1598,14 @@ </patternset> <patternset id="c.src.files.jogl.mobile"> + <include name="${rootrel.src.c}/JVM_JNI8.c"/> <include name="${rootrel.src.c}/JoglCommon.c"/> <include name="${rootrel.src.c}/GLContext.c"/> <include name="${rootrel.src.c}/EGLContext.c"/> <include name="${rootrel.src.c}/GLDebugMessageHandler.c"/> <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/> + <include name="${rootrel.src.c}/timespec.c" if="isIOS"/> <!-- currently only used for OSX, iOS --> + <include name="${rootrel.src.c}/ios/IOSWindowSystemInterface.m" if="isIOS"/> <include name="${rootrel.src.c.libav}/ffmpeg_static.c"/> <include name="${rootrel.src.c.libav}/ffmpeg_dshow.c"/> <include name="${rootrel.src.c.openmax}/omx_tool.c" if="setup.addNativeOpenMAX"/> @@ -1573,6 +1618,7 @@ <include name="${rootrel.generated.c.jogl}/es1/GLES1Impl_JNI.c"/> <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY --> <!--include name="${rootrel.generated.c.jogl}/es1/GLUes1_JNI.c" EMPTY /--> + <include name="${rootrel.generated.c.jogl}/iOS/*.c" if="isIOS"/> </patternset> <patternset id="c.src.files.cg"> @@ -1589,12 +1635,11 @@ <fileset dir="${obj.joglsub}" includes="*jogl_ffmpegv08*, *jogl_ffmpegv09*, *jogl_ffmpegv10*"/> <!-- requires linkage --> </sourcefiles> <targetfiles> - <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.so"/> - <fileset dir="${obj.jogl}" includes="@{output.lib.name}.dll"/> - <fileset dir="${obj.jogl}" includes="lib@{output.lib.name}.dylib"/> + <fileset dir="${obj.jogl}" includes="${native.library.prefix}@{output.lib.name}.${native.library.suffix}"/> </targetfiles> <sequential> - <cc outtype="shared" + <cc outtype="${output.lib.type}" + usehighleveltool="true" objdir="${obj.joglsub}" outfile="${obj.jogl}/@{output.lib.name}" optimize="${c.compiler.optimise}" @@ -1621,9 +1666,11 @@ <!-- This is for the generated headers for handwritten C code --> <includepath path="${src.c}"/> <includepath path="${nativewindow.src.c}/macosx" if="isOSX"/> + <includepath path="${nativewindow.src.c}/ios" if="isIOS"/> <includepath path="${src.generated.c}" /> <includepath path="${src.generated.c}/X11" if="isX11"/> <includepath path="${src.generated.c}/MacOSX" if="isOSX"/> + <includepath path="${src.generated.c}/iOS" if="isIOS"/> <includepath path="${src.generated.c}/Windows" if="isWindows"/> <includepath path="${src.generated.c.libav}" /> <includepath path="${src.generated.c.openmax}" if="setup.addNativeOpenMAX"/> @@ -1645,6 +1692,10 @@ <param name="dest" value="${obj.jogl}/@{output.lib.name}.dll" /> </antcall> + <gluegen.make.libsymbols builddir="${build}" + nativelib="${obj.jogl}/${native.library.prefix}@{output.lib.name}.${native.library.suffix}" + symbolsfile="${obj.jogl}/${native.library.prefix}@{output.lib.name}.symbols"/> + <!-- this stripping may be called more than once on the same library dir, but that should cause no harm, and doing it here inside outofdate prevents the JARs from always being rebuilt even if no source code changes --> @@ -1771,13 +1822,13 @@ <target name="build-jars-os-desktop-javase" depends="setup-manifestfile"> <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl-os-x11.jar}" filesonly="true"> - <fileset dir="${classes}" includes="${java.part.glx}"/> + <fileset dir="${classes}" includes="${java.part.x11.glx}"/> </jar> <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl-os-win.jar}" filesonly="true"> - <fileset dir="${classes}" includes="${java.part.wgl}" /> + <fileset dir="${classes}" includes="${java.part.win.wgl}" /> </jar> <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl-os-osx.jar}" filesonly="true"> - <fileset dir="${classes}" includes="${java.part.cgl}"/> + <fileset dir="${classes}" includes="${java.part.osx.cgl}"/> </jar> </target> @@ -1788,6 +1839,9 @@ </target> <target name="build-jars-mobile-javase" depends="setup-manifestfile"> + <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl-os-ios.jar}" filesonly="true"> + <fileset dir="${classes}" includes="${java.part.ios.eagl}"/> + </jar> <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl-glmobile.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.egl} ${java.part.es1} ${java.part.es2es3}" diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml index d13ca09b8..1f40f3535 100644 --- a/make/build-nativewindow.xml +++ b/make/build-nativewindow.xml @@ -81,10 +81,12 @@ <property name="java.part.macosx" value="com/jogamp/nativewindow/macosx/* jogamp/nativewindow/macosx/*" /> + <property name="java.part.ios" + value="com/jogamp/nativewindow/ios/* jogamp/nativewindow/ios/*" /> + <!-- condition excludes --> - <condition property="java.excludes.awt" - value="${java.part.awt}"> + <condition property="java.excludes.awt" value="${java.part.awt}"> <isset property="setup.noAWT"/> </condition> @@ -170,6 +172,7 @@ <mkdir dir="${src.generated.java}" /> <mkdir dir="${src.generated.c}" /> <mkdir dir="${src.generated.c}/MacOSX" /> + <mkdir dir="${src.generated.c}/iOS" /> <mkdir dir="${src.generated.c}/Windows" /> <mkdir dir="${src.generated.c}/X11" /> <mkdir dir="${classes}" /> @@ -235,7 +238,8 @@ </gluegen> </target> - <target name="java.generate.jawt" unless="setup.noAWT"> + <!-- target name="java.generate.jawt" unless="setup.noAWT" --> + <target name="java.generate.jawt" if="jawt.cfg" unless="setup.noAWT"> <!-- NOTE: the "literalInclude" in this GlueGen call is simply to - get around the fact that neither FileSet nor DirSet can - handle different drives in an effective manner. --> @@ -259,6 +263,7 @@ <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes}/${window.os.system}/** ${stub.includes.gluegen}/gluegen/** ${stub.includes}/khr/**" /> <antcall target="java.generate.windowlib" inheritRefs="true" /> <antcall target="java.generate.jawt" inheritRefs="true" /> + <antcall target="java.generate.copy2temp" inheritRefs="true" /> </target> <!-- @@ -298,6 +303,14 @@ <param name="jni.platform.sub" value="macosx" /> </antcall> + <echo message="Generating platform-specifics: iOS (nop)" /> <!-- actually nothing gets generated --> + <antcall target="java.generate.platforms" inheritRefs="true"> + <param name="window.os.system" value="ios"/> + <!-- param name="jawt.cfg" value="${config.nativewindow}/jawt-ios.cfg" / --> <!-- n/a --> + <!-- param name="jawt.platform.header" value="${stub.includes.gluegen}/jni/ios/jawt_md.h" / --> <!-- n/a --> + <!-- param name="jni.platform.sub" value="ios" / --> <!-- n/a --> + </antcall> + <!-- Inform the user that the generators have successfully created - the necessary Java files --> <echo message="" /> @@ -371,6 +384,14 @@ <compiler id="compiler.cfg.macosx.nativewindow" extends="compiler.cfg.macosx"> </compiler> + <compiler id="compiler.cfg.ios.amd64.nativewindow" extends="compiler.cfg.ios.amd64"> + <!-- compilerarg value="-v" / --> + </compiler> + + <compiler id="compiler.cfg.ios.arm64.nativewindow" extends="compiler.cfg.ios.arm64"> + <!-- compilerarg value="-v" / --> + </compiler> + <!-- linker configuration --> <linker id="linker.cfg.freebsd.nativewindow.x11" extends="linker.cfg.freebsd"> @@ -461,6 +482,26 @@ <linkerarg value="Cocoa" /> </linker> + <linker id="linker.cfg.ios.amd64.nativewindow" extends="linker.cfg.ios.amd64"> + <!-- linkerarg value="-v" / --> + <linkerarg value="-weak_framework" /> + <linkerarg value="UIKit" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="QuartzCore" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="OpenGLES" /> <!-- hack to inject CAEAGLLayer.self into UIView's layerClass --> + </linker> + + <linker id="linker.cfg.ios.arm64.nativewindow" extends="linker.cfg.ios.arm64"> + <!-- linkerarg value="-v" / --> + <linkerarg value="-weak_framework" /> + <linkerarg value="UIKit" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="QuartzCore" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="OpenGLES" /> <!-- hack to inject CAEAGLLayer.self into UIView's layerClass --> + </linker> + <linker id="linker.cfg.hpux.nativewindow" extends="linker.cfg.hpux"> <syslibset dir="/usr/lib" libs="X11"/> <syslibset dir="/usr/lib" libs="Xrender"/> @@ -608,7 +649,17 @@ <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.nativewindow" /> </target> - <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" /> + <target name="c.configure.ios.amd64" if="isIOSAmd64"> + <property name="compiler.cfg.id" value="compiler.cfg.ios.amd64.nativewindow" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.ios.amd64.nativewindow" /> + </target> + + <target name="c.configure.ios.arm64" if="isIOSArm64"> + <property name="compiler.cfg.id" value="compiler.cfg.ios.arm64.nativewindow" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.ios.arm64.nativewindow" /> + </target> + + <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.ios.amd64,c.configure.ios.arm64,c.configure.freebsd,c.configure.hpux" /> <target name="c.configure" depends="c.configure.1,c.configure.2" /> @@ -658,6 +709,7 @@ <include name="${rootrel.src.c}/x11/Xmisc.c"/> <include name="${rootrel.src.c}/x11/XineramaHelper.c"/> <include name="${rootrel.src.c}/NativewindowCommon.c"/> + <include name="${rootrel.src.c}/JVM_JNI8.c"/> </patternset> <patternset id="c.src.files.windows"> @@ -665,11 +717,20 @@ <include name="${rootrel.src.c}/win32/GDImisc.c"/> <include name="${rootrel.src.c}/win32/WindowsDWM.c"/> <include name="${rootrel.src.c}/NativewindowCommon.c"/> + <include name="${rootrel.src.c}/JVM_JNI8.c"/> </patternset> <patternset id="c.src.files.macosx"> <include name="${rootrel.src.c}/macosx/OSXmisc.m"/> <include name="${rootrel.src.c}/NativewindowCommon.c"/> + <include name="${rootrel.src.c}/JVM_JNI8.c"/> + </patternset> + + <patternset id="c.src.files.ios"> + <include name="${rootrel.src.c}/ios/CAEAGLLayered.m"/> + <include name="${rootrel.src.c}/ios/IOSmisc.m"/> + <include name="${rootrel.src.c}/NativewindowCommon.c"/> + <include name="${rootrel.src.c}/JVM_JNI8.c"/> </patternset> <echo message="Compiling @{output.lib.name}" /> @@ -682,12 +743,11 @@ <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset> </sourcefiles> <targetfiles> - <fileset dir="${obj.nativewindow}" includes="lib@{output.lib.name}.so"/> - <fileset dir="${obj.nativewindow}" includes="@{output.lib.name}.dll"/> - <fileset dir="${obj.nativewindow}" includes="lib@{output.lib.name}.dylib"/> + <fileset dir="${obj.nativewindow}" includes="${native.library.prefix}@{output.lib.name}.${native.library.suffix}"/> </targetfiles> <sequential> - <cc outtype="shared" + <cc outtype="${output.lib.type}" + usehighleveltool="true" objdir="${obj.nativewindow}" outfile="${obj.nativewindow}/@{output.lib.name}" optimize="${c.compiler.optimise}" @@ -706,10 +766,12 @@ <includepath path="${src.generated.c}" /> <includepath path="${src.generated.c}/X11" if="isX11"/> <includepath path="${src.generated.c}/MacOSX" if="isOSX"/> + <includepath path="${src.generated.c}/iOS" if="isIOS"/> <includepath path="stub_includes/win32" if="isWindows"/> <includepath path="${src.generated.c}/Windows" if="isWindows"/> <includepath path="${src.c}/x11" if="isX11"/> <includepath path="${src.c}/macosx" if="isOSX"/> + <includepath path="${src.c}/ios" if="isIOS"/> <includepath path="${src.c}/win32" if="isWindows"/> <includepath path="${src.c}"/> @@ -730,6 +792,10 @@ <param name="dest" value="${obj.nativewindow}/@{output.lib.name}.dll" /> </antcall> + <gluegen.make.libsymbols builddir="${build}" + nativelib="${obj.nativewindow}/${native.library.prefix}@{output.lib.name}.${native.library.suffix}" + symbolsfile="${obj.nativewindow}/${native.library.prefix}@{output.lib.name}.symbols"/> + <!-- this stripping may be called more than once on the same library dir, but that should cause no harm, and doing it here inside outofdate prevents the JARs from always being rebuilt even if no source code changes --> @@ -777,7 +843,16 @@ linker.cfg.id="${linker.cfg.id.oswin}"/> </target> - <target name="c.build.nativewindow.windowlib" depends="c.build.nativewindow.windowlib.x11, c.build.nativewindow.windowlib.windows, c.build.nativewindow.windowlib.macosx"/> + <target name="c.build.nativewindow.windowlib.ios" if="isIOS"> + <javah destdir="${src.generated.c}/iOS" classpath="${javah.classpath}" class="jogamp.nativewindow.ios.IOSUtil" /> + + <c.build c.compiler.src.files="c.src.files.ios" + output.lib.name="nativewindow_ios" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="${linker.cfg.id.oswin}"/> + </target> + + <target name="c.build.nativewindow.windowlib" depends="c.build.nativewindow.windowlib.x11, c.build.nativewindow.windowlib.windows, c.build.nativewindow.windowlib.macosx, c.build.nativewindow.windowlib.ios"/> <target name="c.manifest" if="isVC8Family"> <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> @@ -852,7 +927,14 @@ </jar> </target> - <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-windows,build-jars-macosx"> + <target name="build-jars-ios" depends="setup-manifestfile"> + <jar manifest="${build.nativewindow}/manifest.mf" destfile="${nativewindow-os-ios.jar}" filesonly="true"> + <fileset dir="${classes}" + includes="${java.part.ios}" /> + </jar> + </target> + + <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-windows,build-jars-macosx,build-jars-ios"> <jar manifest="${build.nativewindow}/manifest.mf" destfile="${nativewindow.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.core}" diff --git a/make/build-newt.xml b/make/build-newt.xml index d0dfdcf32..6c2defaca 100644 --- a/make/build-newt.xml +++ b/make/build-newt.xml @@ -79,6 +79,7 @@ <and> <isfalse value="${isWindows}" /> <isfalse value="${isOSX}" /> + <isfalse value="${isIOS}" /> <isfalse value="${isX11}" /> <isfalse value="${isAndroid}" /> <isfalse value="${setup.addNativeKD}" /> @@ -90,6 +91,7 @@ <echo message="setup.noOpenGL: ${setup.noOpenGL}" /> <echo message="isWindows: ${isWindows}" /> <echo message="isOSX: ${isOSX}" /> + <echo message="isIOS: ${isIOS}" /> <echo message="isX11: ${isX11}" /> <echo message="isAndroid: ${isAndroid}" /> <echo message="setup.addNativeKD: ${setup.addNativeKD}" /> @@ -132,6 +134,9 @@ <property name="java.part.driver.macosx" value="jogamp/newt/driver/macosx/**"/> + <property name="java.part.driver.ios" + value="jogamp/newt/driver/ios/**"/> + <property name="java.part.driver.kd" value="jogamp/newt/driver/kd/**"/> @@ -226,6 +231,7 @@ <mkdir dir="${src.generated.c}/Android" /> <mkdir dir="${src.generated.c}/X11" /> <mkdir dir="${src.generated.c}/MacOSX" /> + <mkdir dir="${src.generated.c}/iOS" /> <mkdir dir="${src.generated.c}/Windows" /> <mkdir dir="${src.generated.c}/KD" /> <mkdir dir="${src.generated.c}/IntelGDL" /> @@ -418,6 +424,26 @@ <linkerarg value="Cocoa" /> </linker> + <linker id="linker.cfg.ios.amd64.newt" extends="linker.cfg.ios.amd64"> + <!-- linkerarg value="-v" / --> + <linkerarg value="-weak_framework" /> + <linkerarg value="UIKit" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="QuartzCore" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="OpenGLES" /> <!-- hack to get the CAEAGL in .. --> + </linker> + + <linker id="linker.cfg.ios.arm64.newt" extends="linker.cfg.ios.arm64"> + <!-- linkerarg value="-v" / --> + <linkerarg value="-weak_framework" /> + <linkerarg value="UIKit" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="QuartzCore" /> + <linkerarg value="-weak_framework" /> + <linkerarg value="OpenGLES" /> <!-- hack to get the CAEAGL in .. --> + </linker> + <linker id="linker.cfg.hpux.newt" extends="linker.cfg.hpux"> <syslibset dir="/usr/lib" libs="X11"/> </linker> @@ -612,7 +638,17 @@ <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.newt" /> </target> - <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" /> + <target name="c.configure.ios.amd64" if="isIOSAmd64"> + <property name="compiler.cfg.id" value="compiler.cfg.ios.amd64" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.ios.amd64.newt" /> + </target> + + <target name="c.configure.ios.arm64" if="isIOSArm64"> + <property name="compiler.cfg.id" value="compiler.cfg.ios.arm64" /> + <property name="linker.cfg.id.oswin" value="linker.cfg.ios.arm64.newt" /> + </target> + + <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.ios.amd64,c.configure.ios.arm64,c.configure.freebsd,c.configure.hpux" /> <target name="c.configure" depends="c.configure.1,c.configure.2" /> @@ -637,12 +673,15 @@ <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> <patternset id="c.src.files.newt"> + <include name="${rootrel.src.c}/JVM_JNI8.c" /> <include name="${rootrel.src.c}/NewtCommon.c" /> <!-- include name="${rootrel.src.c}/timespec.c" /--> <!-- currently used for X11 and OSX with special PERF DEBUG MODE--> <include name="${rootrel.src.c}/WindowsWindow.c" if="isWindows"/> <include name="${rootrel.src.c}/WindowsEDID.c" if="isWindows"/> <include name="${rootrel.src.c}/MacWindow.m" if="isOSX"/> <include name="${rootrel.src.c}/NewtMacWindow.m" if="isOSX"/> + <include name="${rootrel.src.c}/IOSUIWindow.m" if="isIOS"/> + <include name="${rootrel.src.c}/IOSNewtUIWindow.m" if="isIOS"/> <include name="${rootrel.src.c}/AndroidWindow.c" if="isAndroid"/> <include name="${rootrel.src.c}/X11Display.c" if="isX11"/> <!-- include name="${rootrel.src.c}/X11Event.c" if="isX11"/--> @@ -666,12 +705,11 @@ <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset> </sourcefiles> <targetfiles> - <fileset dir="${obj.newt}" includes="lib@{output.lib.name}.so"/> - <fileset dir="${obj.newt}" includes="@{output.lib.name}.dll"/> - <fileset dir="${obj.newt}" includes="lib@{output.lib.name}.dylib"/> + <fileset dir="${obj.newt}" includes="${native.library.prefix}@{output.lib.name}.${native.library.suffix}"/> </targetfiles> <sequential> - <cc outtype="shared" + <cc outtype="${output.lib.type}" + usehighleveltool="true" objdir="${obj.newt}" outfile="${obj.newt}/@{output.lib.name}" optimize="${c.compiler.optimise}" @@ -695,6 +733,7 @@ <includepath path="${src.generated.c}/Android" if="isAndroid"/> <includepath path="${src.generated.c}/X11" if="isX11"/> <includepath path="${src.generated.c}/MacOSX" if="isOSX"/> + <includepath path="${src.generated.c}/iOS" if="isIOS"/> <includepath path="${src.generated.c}/Windows" if="isWindows"/> <includepath path="${src.generated.c}/KD" if="setup.addNativeKD" /> <includepath path="${src.generated.c}/IntelGDL" if="setup.addNativeIntelGDL" /> @@ -719,6 +758,10 @@ <param name="dest" value="${obj.newt}/@{output.lib.name}.dll" /> </antcall> + <gluegen.make.libsymbols builddir="${build}" + nativelib="${obj.newt}/${native.library.prefix}@{output.lib.name}.${native.library.suffix}" + symbolsfile="${obj.newt}/${native.library.prefix}@{output.lib.name}.symbols"/> + <!-- this stripping may be called more than once on the same library dir, but that should cause no harm, and doing it here inside outofdate prevents the JARs from always being rebuilt even if no source code changes --> @@ -741,6 +784,7 @@ <javah destdir="${src.generated.c}/Windows" classpath="${javah.classpath}" class="jogamp.newt.driver.windows.WindowDriver, jogamp.newt.driver.windows.ScreenDriver, jogamp.newt.driver.windows.DisplayDriver" /> <javah destdir="${src.generated.c}/MacOSX" classpath="${javah.classpath}" class="jogamp.newt.driver.macosx.WindowDriver, jogamp.newt.driver.macosx.ScreenDriver, jogamp.newt.driver.macosx.DisplayDriver" /> + <javah destdir="${src.generated.c}/iOS" classpath="${javah.classpath}" class="jogamp.newt.driver.ios.WindowDriver, jogamp.newt.driver.ios.ScreenDriver, jogamp.newt.driver.ios.DisplayDriver" /> <javah destdir="${src.generated.c}/X11" classpath="${javah.classpath}" class="jogamp.newt.driver.x11.WindowDriver, jogamp.newt.driver.x11.ScreenDriver, jogamp.newt.driver.x11.RandR11, jogamp.newt.driver.x11.RandR13, jogamp.newt.driver.x11.DisplayDriver" /> </target> @@ -844,6 +888,10 @@ <fileset dir="${classes}" includes="${java.part.driver.macosx}"/> </jar> + <jar manifest="${build.newt}/manifest.mf" destfile="${newt-driver-ios.jar}" filesonly="true"> + <fileset dir="${classes}" + includes="${java.part.driver.ios}"/> + </jar> <jar manifest="${build.newt}/manifest.mf" destfile="${newt-driver-kd.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.driver.kd}"/> diff --git a/make/build-test.xml b/make/build-test.xml index eed264e6b..547a0d8d1 100644 --- a/make/build-test.xml +++ b/make/build-test.xml @@ -22,11 +22,13 @@ <target name="declare.common" description="Declare properties" depends="common.init"> <property name="rootrel.src.test" value="src/test" /> <property name="src.test" value="${project.root}/${rootrel.src.test}" /> + <property name="src.demos" value="${project.root}/src/demos" /> <property name="classes" value="${build.test}/classes" /> <property name="classes.path" location="${classes}"/> <!-- absolute path --> + <property name="classes.demos" value="${build.demos}/classes" /> - <property name="java.part.test.all" value="com/jogamp/** jogamp/**"/> + <property name="java.part.demo.mobile" value="com/jogamp/opengl/demos/demos/**"/> <property name="java.part.test.android" value="com/jogamp/opengl/test/android/**"/> <property name="java.part.test.oculusvr" value="com/jogamp/opengl/test/junit/jogl/stereo/ovr/**"/> <property name="java.dir.test" value="com/jogamp/opengl/test"/> @@ -49,6 +51,7 @@ <target name="clean" description="Remove all build products" depends="declare.common"> <delete includeEmptyDirs="true" quiet="true"> <fileset dir="${build.test}" /> + <fileset dir="${build.demos}" /> <fileset dir="." includes="*.ps" /> <fileset dir="." includes="*.pdf" /> <fileset dir="." includes="*.png" /> @@ -56,6 +59,7 @@ <fileset dir="." includes="*.tga" /> <fileset dir="." includes="hs_err_pid*.log" /> <fileset file="${jogl-test.jar}" /> + <fileset file="${jogl-demos-mobile.jar}" /> </delete> </target> @@ -64,7 +68,44 @@ - Build/run tests/junit. --> - <target name="test.compile.javase.generic"> + <target name="make.demos.mobile"> + <javac destdir="${classes.demos}" + fork="yes" + includeAntRuntime="false" + memoryMaximumSize="${javac.memorymax}" + encoding="UTF-8" + source="${target.sourcelevel}" + target="${target.targetlevel}" + bootclasspath="${target.rt.jar}" + debug="${javacdebug}" debuglevel="${javacdebuglevel}"> + <classpath refid="junit_jogl_newt.compile.classpath"/> + <src path="${src.demos}" /> + </javac> + <copy file="joglversion-test" + tofile="${build.test}/manifest-demo-mobile.mf" + overwrite="true"> + <filterset> + <filter token="VERSION" value="${jogamp.version}"/> + <filter token="BUILD_VERSION" value="${jogl.version}"/> + <filter token="SCM_BRANCH" value="${jogl.build.branch}"/> + <filter token="SCM_COMMIT" value="${jogl.build.commit}"/> + <filter token="BASEVERSION" value="${jogamp.version.base}"/> + <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/> + </filterset> + </copy> + <!-- include any resource files that tests may require --> + <copy todir="${classes.demos}"> + <fileset dir="${src.demos}"> + <exclude name="**/*.java"/> + </fileset> + </copy> + <jar manifest="${build.test}/manifest-demo-mobile.mf" destfile="${jogl-demos-mobile.jar}" filesonly="true"> + <fileset dir="${classes.demos}" + includes="**"/> + <fileset dir="resources/assets-test" includes="**" /> + </jar> + </target> + <target name="test.compile.javase.generic" unless="setup.noAWT"> <javac destdir="${classes}" excludes="${java.part.test.android} ${java.part.test.oculusvr}" fork="yes" @@ -95,7 +136,7 @@ <src path="${src.test}" /> </javac> </target> - <target name="test.compile.javase" depends="test.compile.javase.generic, test.compile.javase.oculusvr"> + <target name="test.compile.javase" depends="test.compile.javase.generic, test.compile.javase.oculusvr" unless="setup.noAWT"> <copy file="joglversion-test" tofile="${build.test}/manifest-test.mf" overwrite="true"> @@ -120,7 +161,7 @@ </jar> </target> - <target name="test.compile.android" if="android-jars.available"> + <target name="test.compile.android" if="android-jars.available" unless="setup.noAWT"> <!-- Perform the junit pass Java Android compile --> <javac destdir="${classes}" excludes="${java.part.test.oculusvr}" @@ -157,7 +198,7 @@ </jar> </target> - <target name="test.package.android" depends="test.compile.android" if="isAndroid"> + <target name="test.package.android" depends="test.compile.android" if="isAndroid" unless="setup.noAWT"> <aapt.signed assetsdir="resources/assets-test" jarsrcdir="${src}/test" @@ -176,6 +217,7 @@ <!-- Create the required output directories. --> <mkdir dir="${obj.test}" /> <mkdir dir="${classes}" /> + <mkdir dir="${classes.demos}" /> <property name="jogl-test.jar.path" location="${jogl-test.jar}"/> <!-- absolute path --> <echo message="jogl-test.jar ${jogl-test.jar.path}"/> @@ -198,6 +240,7 @@ <exclude name="**/*.java"/> </fileset> </copy> + <antcall target="make.demos.mobile" inheritRefs="true" inheritAll="true"/> <antcall target="test.compile.javase" inheritRefs="true" inheritAll="true"/> <antcall target="test.package.android" inheritRefs="true" inheritAll="true"/> </target> diff --git a/make/build.xml b/make/build.xml index 14c1a3c09..876d8be60 100644 --- a/make/build.xml +++ b/make/build.xml @@ -20,15 +20,15 @@ <ant antfile="build-test.xml" target="test.compile" inheritRefs="true" inheritAll="true"/> </target> - <target name="test.auto.run" description="Run automated tests (junit and others) in nativewindow, jogl and newt projects"> + <target name="test.auto.run" description="Run automated tests (junit and others) in nativewindow, jogl and newt projects" if="${build.dynamiclibs}"> <ant antfile="build-test.xml" target="test.auto.run" inheritRefs="true" inheritAll="true"/> </target> - <target name="junit.run" description="Run automated junit tests in nativewindow, jogl and newt projects"> + <target name="junit.run" description="Run automated junit tests in nativewindow, jogl and newt projects" if="${build.dynamiclibs}"> <ant antfile="build-test.xml" target="junit.run" inheritRefs="true" inheritAll="true"/> </target> - <target name="test.manual.run" description="Run manual operated tests in nativewindow, jogl and newt projects"> + <target name="test.manual.run" description="Run manual operated tests in nativewindow, jogl and newt projects" if="${build.dynamiclibs}"> <ant antfile="build-test.xml" target="test.manual.run" inheritRefs="true" inheritAll="true"/> </target> @@ -53,6 +53,7 @@ <ant antfile="build-test.xml" target="clean" inheritRefs="true" inheritAll="true"/> <delete includeEmptyDirs="true" quiet="true" failonerror="false"> <fileset dir="${build}" /> + <fileset dir="${project.root}/build-temp" /> <fileset dir="." includes="*.tga" /> </delete> <delete includeEmptyDirs="true" quiet="true" dir="${jar}" failonerror="false" /> @@ -141,7 +142,7 @@ </jar> </target> - <target name="one.jar.dir" depends="one.jar.dir.prep,one.jar.dir.android" unless="one.dir.skip"> + <target name="one.jar.dir.awt" unless="setup.noAWT"> <jar manifest="${build}/manifest-all.mf" destfile="${jogl-all.jar}" filesonly="true" excludes="META-INF/*"> <archives> <zips> @@ -152,6 +153,9 @@ </zips> </archives> </jar> + </target> + <target name="one.jar.dir" depends="one.jar.dir.prep,one.jar.dir.android" unless="one.dir.skip"> + <antcall target="one.jar.dir.awt" inheritRefs="true" inheritAll="true"/> <jar manifest="${build}/manifest-all.mf" destfile="${jogl-all-noawt.jar}" filesonly="true" excludes="META-INF/*"> <archives> <zips> @@ -259,7 +263,7 @@ - This must be called after all of the build targets complete. --> - <target name="developer-src-zip" depends="init"> + <target name="developer-src-zip" depends="init" if="build.archiveon"> <!--delete includeEmptyDirs="true" quiet="true" failonerror="false"> <fileset dir="${build}" includes="jogl-java-src.zip" /> </delete--> diff --git a/make/config/jogl/eagl-ios.cfg b/make/config/jogl/eagl-ios.cfg new file mode 100644 index 000000000..2714cb6a3 --- /dev/null +++ b/make/config/jogl/eagl-ios.cfg @@ -0,0 +1,43 @@ +# This .cfg file is used to generate the interface to the CGL routines +# used internally by the MacOSXGLContext implementation. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/jogl/iOS + +# For easier debugging of GLSemHeader, i.e. less debug output +#DropAllGLDocHeader true + +Package jogamp.opengl.ios.eagl +JavaClass EAGL +Style AllStatic +Include gl-common.cfg +Include gl-common-extensions.cfg +Include gl-desktop.cfg + +# Only NIO direct function, no arrays .. +NIOOnly __ALL__ +NIODirectOnly __ALL__ + +GLSemHeader OpenGLES/EAGL.h + +Opaque long void * + +# Opaque directives for low-level CGL binding (for Java2D/JOGL bridge) +Opaque long EAGLContext * +Opaque long EAGLSharegroup * +Opaque long EAGLDrawable * + +Opaque long CALayer * +Opaque long CAEAGLLayer * +Opaque long UIView * + +CustomCCode #include <machine/types.h> +CustomCCode #include "ios-window-system.h" + +#IncludeAs CustomJavaCode EAGL eagl-ios-CustomJavaCode.java + +# Implement the first argument to getProcAddress as String instead +# of byte[] +ArgumentIsString getProcAddress 0 + +Import com.jogamp.common.util.Function +Import jogamp.nativewindow.ios.IOSUtil diff --git a/make/scripts/make.jogl.all.ios.amd64.sh b/make/scripts/make.jogl.all.ios.amd64.sh new file mode 100755 index 000000000..8ea91b984 --- /dev/null +++ b/make/scripts/make.jogl.all.ios.amd64.sh @@ -0,0 +1,35 @@ +#! /bin/sh + +if [ -e /opt-share/etc/profile.ant ] ; then + . /opt-share/etc/profile.ant +fi + +# -Dc.compiler.debug=true +# +# -Dtarget.sourcelevel=1.6 \ +# -Dtarget.targetlevel=1.6 \ +# -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \ + +# Force OSX SDK 10.6, if desired +# export SDKROOT=macosx10.6 + +export SDKROOT=iphonesimulator12.2 +xcrun --show-sdk-path + +JAVA_HOME=`/usr/libexec/java_home -version 1.8` +PATH=$JAVA_HOME/bin:$PATH +export JAVA_HOME PATH +which java +java -version + +export SOURCE_LEVEL=1.6 +export TARGET_LEVEL=1.6 +export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar + +#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org" +export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet" + +ant \ + -Drootrel.build=build-ios-amd64 \ + -DisIOSAmd64=true \ + $* 2>&1 | tee make.jogl.all.ios-amd64.log diff --git a/make/scripts/make.jogl.all.ios.arm64.sh b/make/scripts/make.jogl.all.ios.arm64.sh new file mode 100755 index 000000000..8a101adf2 --- /dev/null +++ b/make/scripts/make.jogl.all.ios.arm64.sh @@ -0,0 +1,35 @@ +#! /bin/sh + +if [ -e /opt-share/etc/profile.ant ] ; then + . /opt-share/etc/profile.ant +fi + +# -Dc.compiler.debug=true +# +# -Dtarget.sourcelevel=1.6 \ +# -Dtarget.targetlevel=1.6 \ +# -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \ + +# Force OSX SDK 10.6, if desired +# export SDKROOT=macosx10.6 + +export SDKROOT=iphoneos12.2 +xcrun --show-sdk-path + +JAVA_HOME=`/usr/libexec/java_home -version 1.8` +PATH=$JAVA_HOME/bin:$PATH +export JAVA_HOME PATH +which java +java -version + +export SOURCE_LEVEL=1.6 +export TARGET_LEVEL=1.6 +export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar + +#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org" +export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet" + +ant \ + -Drootrel.build=build-ios-arm64 \ + -DisIOSArm64=true \ + $* 2>&1 | tee make.jogl.all.ios-arm64.log diff --git a/make/scripts/make.jogl.all.macosx.sh b/make/scripts/make.jogl.all.macosx.sh index 94b7f13b3..d9db72045 100755 --- a/make/scripts/make.jogl.all.macosx.sh +++ b/make/scripts/make.jogl.all.macosx.sh @@ -7,8 +7,8 @@ fi # Force OSX SDK 10.6, if desired # export SDKROOT=macosx10.6 -JAVA_HOME=`/usr/libexec/java_home` -#JAVA_HOME=`/usr/libexec/java_home -version 1.8` +#JAVA_HOME=`/usr/libexec/java_home` +JAVA_HOME=`/usr/libexec/java_home -version 1.8` #JAVA_HOME=`/usr/libexec/java_home -version 1.7` #JAVA_HOME=`/usr/libexec/java_home -version 1.6` PATH=$JAVA_HOME/bin:$PATH diff --git a/make/scripts/setenv-jogl.sh b/make/scripts/setenv-jogl.sh index 79db4f9b1..cbc85760d 100755 --- a/make/scripts/setenv-jogl.sh +++ b/make/scripts/setenv-jogl.sh @@ -72,9 +72,7 @@ fi JOAL_DIR=`dirname $joalpf` JOAL_BUILDDIR="$JOAL_DIR"/"$JOGL_BUILDDIR_BASE" if [ ! -e "$JOAL_BUILDDIR" ] ; then - echo JOAL_BUILDDIR "$JOAL_BUILDDIR" does not exist - print_usage - exit + echo JOAL_BUILDDIR "$JOAL_BUILDDIR" does not exist \(warning\) fi JOAL_JAR="$JOAL_BUILDDIR"/jar/joal.jar diff --git a/make/scripts/tests-osx-x64.sh b/make/scripts/tests-osx-x64.sh index f0d8ffacf..949adc045 100755 --- a/make/scripts/tests-osx-x64.sh +++ b/make/scripts/tests-osx-x64.sh @@ -4,8 +4,8 @@ #export DYLD_LIBRARY_PATH=$HOME/ffmpeg-2.2.3/lib:$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=/usr/local/Cellar/ffmpeg/2.8/lib:$DYLD_LIBRARY_PATH -JAVA_HOME=`/usr/libexec/java_home` -#JAVA_HOME=`/usr/libexec/java_home -version 1.8` +#JAVA_HOME=`/usr/libexec/java_home` +JAVA_HOME=`/usr/libexec/java_home -version 1.8` #JAVA_HOME=`/usr/libexec/java_home -version 1.7` #JAVA_HOME=`/usr/libexec/java_home -version 1.7.0_25` #JAVA_HOME=`/usr/libexec/java_home -version 1.6.0` diff --git a/make/scripts/tests-x64.sh b/make/scripts/tests-x64.sh index 52216502f..e7301aef5 100755 --- a/make/scripts/tests-x64.sh +++ b/make/scripts/tests-x64.sh @@ -1,5 +1,7 @@ #! /bin/bash +#set -x + SDIR=`dirname $0` #export LD_LIBRARY_PATH=$HOME/libav-0.8/lib:$LD_LIBRARY_PATH diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index bad31647a..0342f7da3 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -5,6 +5,8 @@ if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then exit 0 fi +#set -x + javaexe="$1" shift javaxargs=$1 @@ -97,6 +99,7 @@ function jrun() { swton=$1 shift + D_ARGS="-Djogl.debug.GLProfile" #D_ARGS="-Djogl.debug.DebugGL" #D_ARGS="-Djogl.debug.TraceGL" #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL" @@ -435,7 +438,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLVersionParsing00NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLCanvasAWT $* -#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile00NEWT $* +testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile00NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile02NEWTNoARBCtx $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile03NEWTOffscreen $* @@ -754,7 +757,7 @@ function testawtswt() { #testawt com.jogamp.opengl.test.bugs.Bug735Inv2AppletAWT $* #testawt com.jogamp.opengl.test.bugs.Bug735Inv3AppletAWT $* #testawt com.jogamp.opengl.test.bugs.Bug735Inv4AWT $* - +# # # SWT (testswt) # @@ -762,7 +765,7 @@ function testawtswt() { #testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor02NewtGLWindow $* #testswt com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn $* #testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTJOGLGLCanvas01GLn $* -testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $* +#testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $* #testswt com.jogamp.opengl.test.junit.jogl.demos.es2.swt.TestGearsES2SWT $* #testswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTEclipseGLCanvas01GLn $* #testswt com.jogamp.opengl.test.junit.jogl.swt.TestBug672NewtCanvasSWTSashForm $* diff --git a/make/stub_includes/ios/OpenGLES/EAGL.h b/make/stub_includes/ios/OpenGLES/EAGL.h new file mode 100644 index 000000000..050843a99 --- /dev/null +++ b/make/stub_includes/ios/OpenGLES/EAGL.h @@ -0,0 +1,13 @@ +typedef struct _EAGLContext EAGLContext; +typedef struct _EAGLSharegroup EAGLSharegroup; +typedef struct _EAGLDrawable EAGLDrawable; + +typedef enum _EAGLRenderingAPI +{ + kEAGLRenderingAPIOpenGLES1 = 1, + kEAGLRenderingAPIOpenGLES2 = 2, + kEAGLRenderingAPIOpenGLES3 = 3, +} EAGLRenderingAPI; + +void EAGLGetVersion(unsigned int* major, unsigned int* minor); + diff --git a/make/stub_includes/ios/OpenGLES/EAGLDrawable.h b/make/stub_includes/ios/OpenGLES/EAGLDrawable.h new file mode 100644 index 000000000..6282c155e --- /dev/null +++ b/make/stub_includes/ios/OpenGLES/EAGLDrawable.h @@ -0,0 +1,2 @@ +typedef struct _EAGLDrawable EAGLDrawable; + diff --git a/make/stub_includes/ios/QuartzCore/CAEAGLLayer.h b/make/stub_includes/ios/QuartzCore/CAEAGLLayer.h new file mode 100644 index 000000000..67f2a53c4 --- /dev/null +++ b/make/stub_includes/ios/QuartzCore/CAEAGLLayer.h @@ -0,0 +1 @@ +typedef struct _CAEAGLLayer CAEAGLLayer; diff --git a/make/stub_includes/ios/QuartzCore/CALayer.h b/make/stub_includes/ios/QuartzCore/CALayer.h new file mode 100644 index 000000000..a5a6579a6 --- /dev/null +++ b/make/stub_includes/ios/QuartzCore/CALayer.h @@ -0,0 +1 @@ +typedef struct _CALayer CALayer; diff --git a/make/stub_includes/ios/UIKit/UIKit.h b/make/stub_includes/ios/UIKit/UIKit.h new file mode 100644 index 000000000..155fdc932 --- /dev/null +++ b/make/stub_includes/ios/UIKit/UIKit.h @@ -0,0 +1 @@ +typedef struct _UIView UIView; diff --git a/make/stub_includes/ios/window-system1.c b/make/stub_includes/ios/window-system1.c new file mode 100644 index 000000000..d53c9e27d --- /dev/null +++ b/make/stub_includes/ios/window-system1.c @@ -0,0 +1,2 @@ +#include "ios-window-system.h" + diff --git a/make/stub_includes/macosx/UIKit/NSOpenGL.h b/make/stub_includes/macosx/UIKit/NSOpenGL.h new file mode 100644 index 000000000..1b7656dc1 --- /dev/null +++ b/make/stub_includes/macosx/UIKit/NSOpenGL.h @@ -0,0 +1,3 @@ +typedef struct _NSOpenGLPixelFormat NSOpenGLPixelFormat; +typedef struct _NSOpenGLContext NSOpenGLContext; +typedef struct _NSOpenGLPixelBuffer NSOpenGLPixelBuffer; diff --git a/make/stub_includes/macosx/UIKit/NSOpenGLLayer.h b/make/stub_includes/macosx/UIKit/NSOpenGLLayer.h new file mode 100644 index 000000000..2e5e81a68 --- /dev/null +++ b/make/stub_includes/macosx/UIKit/NSOpenGLLayer.h @@ -0,0 +1 @@ +typedef struct _NSOpenGLLayer NSOpenGLLayer; diff --git a/make/stub_includes/macosx/UIKit/NSOpenGLView.h b/make/stub_includes/macosx/UIKit/NSOpenGLView.h new file mode 100644 index 000000000..6492287df --- /dev/null +++ b/make/stub_includes/macosx/UIKit/NSOpenGLView.h @@ -0,0 +1 @@ +typedef struct _NSOpenGLView NSOpenGLView; diff --git a/make/stub_includes/macosx/UIKit/UIView.h b/make/stub_includes/macosx/UIKit/UIView.h new file mode 100644 index 000000000..5d3acf658 --- /dev/null +++ b/make/stub_includes/macosx/UIKit/UIView.h @@ -0,0 +1 @@ +typedef struct _NSView NSView; diff --git a/make/stub_includes/opengl/ios-window-system.h b/make/stub_includes/opengl/ios-window-system.h new file mode 100644 index 000000000..ae4f1884d --- /dev/null +++ b/make/stub_includes/opengl/ios-window-system.h @@ -0,0 +1,51 @@ +/** + * Copyright 2019 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``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 JogAmp Community 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 views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ +#include <UIKit/UIKit.h> +#include <OpenGLES/EAGLDrawable.h> +#include <QuartzCore/CAEAGLLayer.h> +#include <OpenGLES/EAGL.h> +#include <gluegen_stdint.h> + +typedef int Bool; + +EAGLContext * eaglCreateContext(EAGLRenderingAPI api); +EAGLContext * eaglCreateContextShared(EAGLRenderingAPI api, EAGLSharegroup* sharegroup); +Bool eaglDeleteContext(EAGLContext *ctx, Bool releaseOnMainThread); + +EAGLRenderingAPI eaglGetRenderingAPI(EAGLContext* ctx); +EAGLSharegroup * eaglGetSharegroup(EAGLContext *ctx); +Bool eaglIsContextMultiThreaded(EAGLContext* ctx); +void eaglSetContextMultiThreaded(EAGLContext* ctx, Bool v); /* spawn off load to new GL worker thread if true */ + +EAGLContext* eaglGetCurrentContext(void); +Bool eaglMakeCurrentContext(EAGLContext* ctx); + +Bool eaglBindDrawableStorageToRenderbuffer(EAGLContext* ctx, int renderbufferTarget, CAEAGLLayer /* EAGLDrawable */ * drawable); +Bool eaglPresentRenderbuffer(EAGLContext* ctx, int renderbufferTarget); + +void* getProcAddress(const char *procName); |