This post was updated on .
Hello everyone. I am currently porting Matúš Chochlík's OGLPlus C++ framework over to Java using of course, JOGL. http://oglplus.orgI'm currently moving forward sucessfully in my implementation in this repository in case anyone's interested: https://github.com/jjzazuet/jglWhat I'd like to mention in this discussion is that my project is using the Gradle build system and I'm finding that it has been a real help in regards to keeping my code clean and organized. I have also created a provisional, personal Maven repository for JOGL's atomic jar dependencies and I though it would also be useful to have these dependencies on Maven Central, mostly for code minimalism's sake. https://github.com/jjzazuet/mvn-repo/tree/master/repo/org/jogampWith this Gradle+Maven structure I've been able to narrow down JOGL's minimal jar dependencies (including natives) to the following (expressed of course, in a Gradle script) for Linux and Windows, x86 and x64: compile 'org.jogamp.gluegen:gluegen-rt:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-core:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-gldesktop:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-gldesktop-dbg:2.0.2-rc12' // for troubleshooting... compile 'org.jogamp.jogl:jogl-swt:2.0.2-rc12' // I also use the SWT Canvas classes. compile 'org.jogamp.nativewindow:nativewindow-core:2.0.2-rc12' if (isWindows) { compile 'org.jogamp.jogl:jogl-os-win:2.0.2-rc12' compile 'org.jogamp.nativewindow:nativewindow-os-win:2.0.2-rc12' if (is64bit) { compile 'org.jogamp.gluegen:gluegen-rt-natives-windows-amd64:2.0.2-rc12' compile 'org.jogamp.nativewindow:nativewindow-natives-windows-amd64:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-natives-windows-amd64:2.0.2-rc12' } else if (is32bit) { compile 'org.jogamp.gluegen:gluegen-rt-natives-windows-i586:2.0.2-rc12' compile 'org.jogamp.nativewindow:nativewindow-natives-windows-i586:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-natives-windows-i586:2.0.2-rc12' } else { throw new TaskExecutionException(unsupportedOs) } } else if (isLinux) { compile 'org.jogamp.jogl:jogl-os-x11:2.0.2-rc12' compile 'org.jogamp.nativewindow:nativewindow-os-x11:2.0.2-rc12' if (is64bit) { compile 'org.jogamp.gluegen:gluegen-rt-natives-linux-amd64:2.0.2-rc12' compile 'org.jogamp.nativewindow:nativewindow-natives-linux-amd64:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-natives-linux-amd64:2.0.2-rc12' } else if (is32bit) { compile 'org.jogamp.gluegen:gluegen-rt-natives-linux-i586:2.0.2-rc12' compile 'org.jogamp.nativewindow:nativewindow-natives-linux-i586:2.0.2-rc12' compile 'org.jogamp.jogl:jogl-natives-linux-i586:2.0.2-rc12' } else { throw new TaskExecutionException(unsupportedOs) } } else { throw new TaskExecutionException(unsupportedOs) } This setup produces an executable bundle of about 2MB for me, which is pretty slick in my opinion. Does anyone think it would be useful to publish JOGL's atomic artifacts on Maven central as well? Furthermore, would there be any added value if JOGAMP started using Gradle instead of ANT for compiling? I mean, I know of course it's not a trivial thing to do but, having used it in other very large projects in the past, I can definitely see more benefit to using a more recent build environment. I thank you for your time and help! |
I tested your jgl project. it looks like you got some steam having converted ~25 of the ~60 http://www.oglplus.org/oglplus/html/examples.html already!
Setup was a breeze with gradle "installed". git clone https://github.com/jjzazuet/jgl cd jgl ../gradle-1.6/bin/gradle tasks ../gradle-1.6/bin/gradle test #and observe GLTestShell launch the nice T025RecursiveTexture example. ../gradle-1.6/bin/gradle eclipse #and get a correctly setup eclipse project to import and play in. The other 24 examples can be run by tweaking org.jgl.swt.test.GLTestShell I would be happy if the default build of jgl focused on portability by using the current gluegen-rt-main and jogl-all-main version 2.0.2-rc12 from maven central; ideally make jgl run on all platforms JogAmp support. It is good that jgl initially focus on GL3 core profile since it enable minimal changes in order to become both desktop and mobile portable by adapting the code for GL2ES2 profile. Switching SWT with NEWT would also improve portability and allow jgl use on mobile platforms such as Android. Surely the minimal atomic deployment is cool to reduce footprint. Keep that as an option in gradle for minimal footprint deployments targeting a single platform. IMHO atomic deployment is mostly useful for targeted deployment inside application stores/embedded systems when you know on forehand that the application will only be deployed on a specific os, abi and arch. Have you considered a license for jgl or do you intend to release it under public domain? If you like send a short summary and a reference image that we may use on the JOGL page to promote your project: http://jogamp.org/jogl/www/ |
Administrator
|
On 07/10/2013 11:28 PM, Xerxes Rånby [via jogamp] wrote:
> I tested your jgl project. it looks like you got some steam having converted > ~25 of the ~60 http://www.oglplus.org/oglplus/html/examples.html already! > Setup was a breeze with gradle "installed". > KUDOS 'datSilencer' (?). ... > > > I would be happy if the default build of jgl focused on portability by using > the current gluegen-rt-main and jogl-all-main version 2.0.2-rc12 from maven > central; ideally make jgl run on all platforms JogAmp support. It is good that > jgl initially focus on GL3 core profile since it enable minimal changes in > order to become both desktop and mobile portable by adapting the code for > GL2ES2 profile. Switching SWT with NEWT would also improve portability and > allow jgl use on mobile platforms such as Android. > > Surely the minimal atomic deployment is cool to reduce footprint. Keep that as > an option in gradle for minimal footprint deployments targeting a single > platform. IMHO atomic deployment is mostly useful for targeted deployment > inside application stores/embedded systems when you know on forehand that the > application will only be deployed on a specific os, abi and arch. and made accessible if you use one of our official binaries. This would ease compatibility .. etc, and may also end up in adapting to our upcoming changes. You may also consider adding NApplet or Webstart launching capabilities of the demos, using our signed JARs as reference. See <http://jogamp.org/deployment/jogamp-current/jogl-test-applets.html> > > Have you considered a license for jgl or do you intend to release it under > public domain? .. or BSD 2-clause license (As we use it). > > If you like send a short summary and a reference image that we may use on the > JOGL page to promote your project: http://jogamp.org/jogl/www/ We might want to add this project to our Wiki/Tutorial, since it seems to be a source of some great examples ? If the demos are able to be launched as NApplet and/or Webstart, we surely should add them at a public place to be seen. Keep up the great work. ~Sven signature.asc (911 bytes) Download Attachment |
KUDOS Jesús Zazueta ! Nice portfolio: http://unsungstories.net/portfolio/
|
Well I certainly didn't think JGL could serve as a good starting point for tutorials/examples lol. :P
I have to admit that even though I got a good bunch of examples ready, the code is still in diapers. However, what I can do is to (as you guys suggest) switch to NEWT and do some code cleanup. I still intend to use the NEWT-SWT classes since my main project involves mixing in SWT widgets, but that's still a bit far down the road :P. I'll also try to reference JOGAMP's Maven repository in my Gradle build instead. And finally, I'll setup a small project page in case you guys might want to reference this project on the jogamp.org site. I'll keep you posted. ;) Sven, a couple questions: 1) Can I find JOGL's atomic jars in JOGAMP's Maven repo as well? I tried looking in Maven central but the only artifact I could find was 'jogl-all'. Ideally, a Maven repo (either central or JOGAMP's) should also allow to select the atomic artifacts as well. Take a look at this Gist, where I split the jars in jogamp-all-platforms.7z (./jar/atomic) and basically uploaded gluegen and the bare minimal JOGL's jars for running on Linux/Windows. https://gist.github.com/jjzazuet/5971006 Which resulted in my custom repo structure. https://github.com/jjzazuet/mvn-repo/tree/master/repo/org/jogamp Would it be too cumbersome to make JOGL's build syste produce such artifacts? I understand it may be alot of cherry picking, but as Xerxes stated, this could eventually benefit people doing development for mobile platforms. And 2) I previously mentioned the idea of using Gradle for the JOGAMP projects. Not a trivial undertaking, I know, but I also think it might benefit a codebase this big. Do you guys think it might be useful? Thanks again for your time and help! |
Administrator
|
On 07/11/2013 01:12 AM, Jesus Zazueta [via jogamp] wrote:
> Well I certainly didn't think JGL could serve as a good starting point for > tutorials/examples lol. :P > > I have to admit that even though I got a good bunch of examples ready, the > code is still in diapers. > > However, what I can do is to (as you guys suggest) switch to NEWT and do some > code cleanup. I still intend to use the NEWT-SWT classes since my main project > involves mixing in SWT widgets, but that's still a bit far down the road :P. > > I'll also try to reference JOGAMP's Maven repository in my Gradle build instead. > > And finally, I'll setup a small project page in case you guys might want to > reference this project on the jogamp.org site. I'll keep you posted. ;) > > Sven, a couple questions: > > 1) Can I find JOGL's atomic jars in JOGAMP's Maven repo as well? I tried > looking in Maven central but the only artifact I could find was 'jogl-all'. > Ideally, a Maven repo (either central or JOGAMP's) should also allow to select > the atomic artifacts as well. Take a look at this Gist, where I split the jars > in jogamp-all-platforms.7z (./jar/atomic) and basically uploaded gluegen and > the bare minimal JOGL's jars for running on Linux/Windows. This is a question for our Maven Man: Mark ! <http://jogamp.org/wiki/index.php/Maintainer_and_Contacts#Mark_Raynsford> If you join our IRC channel .. you can chat w/ him, he is 'rmk0' AFAIK. I myself .. just use his great scripts etc to provide the maven artifacts. > > https://gist.github.com/jjzazuet/5971006 > > Which resulted in my custom repo structure. > > https://github.com/jjzazuet/mvn-repo/tree/master/repo/org/jogamp > > Would it be too cumbersome to make JOGL's build syste produce such artifacts? > I understand it may be alot of cherry picking, but as Xerxes stated, this > could eventually benefit people doing development for mobile platforms. I also don't know why you prefer using the atomics .. i.e. in a real world deployment over the network it is surely slower than using on of our all jar files. The latter exist for mobile, desktop, with- and without AWT. > > And > > 2) I previously mentioned the idea of using Gradle for the JOGAMP projects. > Not a trivial undertaking, I know, but I also think it might benefit a > codebase this big. Do you guys think it might be useful? I don't even know what this is :) However, if you like to maintain such thing, you are surely more than welcome. We can discuss this after SIGGRAPH .. let's say in August? Maybe create an enhancement bug report in our bugzilla, then remind me in August. Thank you! ~Sven > > Thanks again for your time and help! > signature.asc (911 bytes) Download Attachment |
Administrator
|
In reply to this post by Jesus Zazueta
The link is broken, this is rather: http://oglplus.org
Julien Gouesse | Personal blog | Website
|
In reply to this post by Jesus Zazueta
'Lo.
It should be fairly easy to add new packages that contain the atomic jars. I left them out initially because I wasn't sure if there was any demand for them with Maven. I'll see what I can do (and we'll test it on the jogamp.org repository first, obviously). |
Hello Mark. Jesus here. Thanks for the info. I was actually trying to switch over and use these artifacts on Maven Central:
However, when testing, I think the native libraries loading mechanism is getting confused by the locations where Gradle placed/cached the actual jars. Specifically, I think the class I'd like to confirm if Maven exhibits this behavior too. I'll try to describe what's going on in my case (with Gradle) when the gluegen-rt library gets loaded. When Gradle downloads the artifacts, this is the actual physical location where they land on my machine:
And when the first static block of
The variable
Which then fails with these messages:
The version of jgl that I have on the master branch of my repo deals with this problem by finding/extracting/loading the libraries by itself, but it's a very fragile approach compared to the facilities offered by JOGL's classes. I'm trying to build JOGL from source to see if I can offer a patch to deal with artifacts stored in different locations. In the meantime, please let me know if there's anything else I could do or specify. Thank you for your time and help! |
'Lo.
The way Maven downloads artifacts means that the native libraries for a given package will be stored in the same directory as the primary jar file for that package. Unfortunately, Gradle seems to break that assumption. We've had a brief talk about it and it seems like the best way to deal with this would be to provide some sort of plugin mechanism for the name resolution, so that GlueGen knows how to find native libraries in Gradle caches. As Sven will emphasize: It's important to remember that looking up a file entails a network lookup on some systems, so we really can't use any system that involves trying all sorts of different filenames until one of them works. Patches/ideas welcome! |
Hello Mark. Jesus again. I have managed to work around the conflict between JOGL's and Gradle's artifact storage/lookup strategy inside JGL by doing this: 1) Replaced JNILibLoaderBase's default loader action with my own:
The relevant class is now in my master repository: GLBootstrap.java 2) Inside my loader action, I retrieved the current runtimes machine description and used that to scan the entire classpath for jars which match the current OS and Arch name. JOGL provides this via 3) I then indexed every jar entry (which I'm naively assuming it to be .dll or .so files only, don't know for OSX :( ) inside the matched jar files to prepare my loader action to load the native libraries if/when they're requested by It pretty much works for me and hopefully it might be something that could be integrated into JOGL as well after evaluating security (file access) and network communication concerns. I tested initially on Windows and I plan to try it on my linux machine later today. One of the things that I realize is that I'm not really comfortable with the idea of handling native dependencies of features that I don't plan to use (for example, nativewindow's AWT native library when I'm only really using NEWT/SWT). Hence my stubornness on wanting to use the atomic jars :P. Anyway, I've updated my master repository at https://github.com/jjzazuet/jgl in case anyone's interested in helping me out. I'm now going to switch the demos over to raw NEWT and leave my SWT code as an optional feature for JGL. After that, I'll see if I can launch the test shell via webstart. Please let me know if there's anything else I could do or specify in the meantime. Thanks again for your time and help! |
... by the way. I forgot to mention, this is sort of how it looks at runtime [main] INFO Initializing native JOGL jar dependencies for platform [windows-amd64]. Temp jar cache disabled. [main] DEBUG Applicable platform jar: [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.gluegen\gluegen-rt\2.0.2-rc12\jar\c013d5e9f359504f5acaec4d7eb87fe2f214fd7\gluegen-rt-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Mapping jar entry [gluegen-rt.dll] -> [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.gluegen\gluegen-rt\2.0.2-rc12\jar\c013d5e9f359504f5acaec4d7eb87fe2f214fd7\gluegen-rt-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Applicable platform jar: [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Mapping jar entry [jogl_desktop.dll] -> [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Mapping jar entry [jogl_mobile.dll] -> [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Mapping jar entry [nativewindow_awt.dll] -> [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Mapping jar entry [nativewindow_win32.dll] -> [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Mapping jar entry [newt.dll] -> [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Loading mapped entry: [gluegen-rt] [gluegen-rt.dll] [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.gluegen\gluegen-rt\2.0.2-rc12\jar\c013d5e9f359504f5acaec4d7eb87fe2f214fd7\gluegen-rt-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Extracting to file [C:\tmp\gluegen-rt.jni] [main] DEBUG Loading mapped entry: [nativewindow_awt] [nativewindow_awt.dll] [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Extracting to file [C:\tmp\nativewindow_awt.jni] [main] DEBUG Loading mapped entry: [nativewindow_win32] [nativewindow_win32.dll] [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [main] DEBUG Extracting to file [C:\tmp\nativewindow_win32.jni] [AWT-EventQueue-0] DEBUG Loading mapped entry: [jogl_desktop] [jogl_desktop.dll] [C:\Users\jjzazuet\.gradle\caches\artifacts-24\filestore\org.jogamp.jogl\jogl-all\2.0.2-rc12\jar\f6c9d77c925da46bc4966fc405553b5a0da9d571\jogl-all-2.0.2-rc12-natives-windows-amd64.jar] [AWT-EventQueue-0] DEBUG Extracting to file [C:\tmp\jogl_desktop.jni] SWTAccessor. |
In reply to this post by Jesus Zazueta
Hi.
Will wait to see what Sven thinks of this, as he understands the issues with GlueGen a lot better than I do. I forgot to mention that the atomic jars have been included in the published Maven packages now, but we've yet to push another timestamped rc12, so they're not actually on the jogamp.org repository yet. See this page: http://jogamp.org/wiki/index.php/Maven#Atomic_jar_files_.28optional.29 |
By the way, if anyone's still interested, I've finally managed to put up a small descriptive page on this project along with a couple of webstart demos. The demos now make use of the JOGL's NApplet facilities.
http://jgl.tribe7.net While running the demos you may see an error message on the applet window but I think that's because the official JOGAMP gluegen-rt webstart deployment is still missing security manifest attributes. After that the applets will run. I'm still finding out if this delay could be reduced. Please let me know if there's anything else I could do or specify in the meantime. Thanks again for your time and help! |
Just a small bug report :) I tried (Mac OSX 10.8 with JDK 1.8 early access): http://jgl.tribe7.net/jnlp/net.tribe7.demos.mchochlik.t030CubeMapping.T030CubeMapping.jnlp [thread applet-com.jogamp.newt.awt.applet.JOGLNewtApplet1Run-1-Display-.macosx_nil-1-EDT-1] DEBUG GL resource initialized.: [GLProgram, 10] [thread applet-com.jogamp.newt.awt.applet.JOGLNewtApplet1Run-1-Display-.macosx_nil-1-EDT-1] DEBUG GL resource initialized.: [GLVertexArray, 2] [thread applet-com.jogamp.newt.awt.applet.JOGLNewtApplet1Run-1-Display-.macosx_nil-1-EDT-1] DEBUG GL resource initialized.: [GLVertexArray, 3] [thread applet-com.jogamp.newt.awt.applet.JOGLNewtApplet1Run-1-Display-.macosx_nil-1-EDT-1] DEBUG GL resource initialized.: [CubeMapFramebuffer, 3] [thread applet-com.jogamp.newt.awt.applet.JOGLNewtApplet1Run-1-Display-.macosx_nil-1-EDT-1] DEBUG GL resource initialized.: [GLTextureCubeMap, 3] [thread applet-com.jogamp.newt.awt.applet.JOGLNewtApplet1Run-1-Display-.macosx_nil-1-EDT-1] DEBUG GL resource initialized.: [GLTextureCubeMap, 4] Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Multiple bind/unbind request: [CubeMapFramebuffer, 3] at net.tribe7.common.base.Preconditions.checkState(Preconditions.java:149) at net.tribe7.opengl.GLContextBoundResource.bind(GLContextBoundResource.java:37) at net.tribe7.demos.mchochlik.t030CubeMapping.T030CubeMapping.doRender(T030CubeMapping.java:133) at net.tribe7.opengl.GL3EventListener.doRender(GL3EventListener.java:47) at net.tribe7.opengl.GLScheduledEventListener.renderTick(GLScheduledEventListener.java:81) at net.tribe7.time.FixedTimeStepScheduler.doStateTick(FixedTimeStepScheduler.java:36) at net.tribe7.time.Scheduler.stateTick(Scheduler.java:41) at net.tribe7.opengl.GLScheduledEventListener.display(GLScheduledEventListener.java:52) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:588) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:572) at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:377) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1034) |
Ah, my bad. I did notice that error yesterday. I just uploaded a new set of webstart jars so *in theory* it should work now :P. I weep since I don't have a MAC to test XD. Anything else, let me know. Thanks! |
Free forum by Nabble | Edit this page |