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/build-jogl.xml | |
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/build-jogl.xml')
-rw-r--r-- | make/build-jogl.xml | 94 |
1 files changed, 74 insertions, 20 deletions
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}" |