Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Long JOGL Loading Times  (Read 1618 times)
0 Members and 1 Guest are viewing this topic.
Offline superjoebob

JGO n00b
*

Posts: 15



« on: 2011-05-16 16:14:17 »

I'm not sure if this is a JOGL specific problem, but I do know that applets seem to load up fast enough when I'm not using JOGL to avoid this problem. What happens, is the Java loader pops up, then disappears and the screen stays white for an extended period of time before the game finally loads up, which generally seems to take about 15-20 minutes. I'm on high speed internet, and the size of all the files for the game are around 3 MB, so a 15 minute load time strikes me as a bit off.

I've even had times where the applet never loads at all, and this behavior is the same on the 3 different computers I've been testing on.

I thought that maybe I needed to implement a class loader or something like that, but after doing a few more tests the problem almost seems to be more. In my applet init function, I added a message popup. When the applet launches in browser, the popup appears almost immediately. But, If I leave the popup up, after about 30 seconds the popup disappears and the Java frame goes white. I've put more popups after the first one, and none of them pop up after it turns white, which seems to signal that nothing is actually happening while the screen is white. I've also set up a threaded asset loader, and the GLCanvas is supposed to be painted black immediately when it's initialized, which doesn't happen.

What could I be doing that's causing this?

EDIT: I actually managed to fix the crash error, but now I'm back to an older problem of incredibly long loading times. I've set up popup messages, and the GLCanvas initializes fairly quick, and the first display call is called quickly, but then there are incredible amounts of time between each display call( 1-5 minutes ). Interestingly enough display is getting called whenever I change focus away from the applet (open a different tab, etc).
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #1 on: 2011-05-16 18:21:24 »

Are you using an animator to automatically call display()?  GLCanvas has repaint() hooked up to call display() so it is likely that the focus changes and other events are triggering those displays.

Offline superjoebob

JGO n00b
*

Posts: 15



« Reply #2 on: 2011-05-16 18:26:39 »

Yes, I do have an animator hooked up. It seems like the animator isn't updating because something is still loading. I've stripped down my applet to a simple OpenGL initialization followed by drawing a simple image, and it won't even run in browser anymore. I'm using Netbeans and I've tested it using webstart, and it works. I've also tried running the Launch.html that Netbeans creates, and it runs in browser perfectly. The second I upload the files to the internet, though, they stop working.

EDIT: I've discovered that the applet runs if I keep trying over and over and over again. The first thing I'm doing is setting the applet background color to red. 90% of the time, I open the page, and the browser locks up for 5-10 seconds, then the applet frame flashes red and disappears. BUT, If I refresh at this point and keep doing so every time it crashes, the applet will eventually stay red, and load properly.
Games published by our own members! Go get 'em!
Offline ra4king

JGO Kernel
*****

Posts: 3158
Medals: 196


I'm the King!


« Reply #3 on: 2011-05-16 22:12:34 »

What version JOGL are you using?

Offline superjoebob

JGO n00b
*

Posts: 15



« Reply #4 on: 2011-05-17 00:21:04 »

I'm using 1.1.1a, which came in the Netbeans OpenGL pack. Is there a newer version?  Shocked

I managed to get the applet launching almost faithfully by adding these lines to the header of the HTML:

<meta http-equiv="Cache-Control" Content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">

But the loading time for the applet is still fairly painful ( 3 - 4 minutes ).
Offline ra4king

JGO Kernel
*****

Posts: 3158
Medals: 196


I'm the King!


« Reply #5 on: 2011-05-17 00:31:30 »

Aha yes, you are using a loooong outdated version. The current recommended version is 2.0 Release Candidate 2.

EDIT: The download page might be somewhat confusing. To find the JOGL release, scroll all the way down and look for "jogl-[versionNum]-[operatingSystem].7z"

Offline gouessej

JGO Kernel
*****

Posts: 3560
Medals: 30


TUER


« Reply #6 on: 2011-05-17 04:38:33 »

ra4king is right. The JogAmp foundation has no control on Oracle servers and JOGL is maintained by the JogAmp foundation.

Julien Gouesse
Offline superjoebob

JGO n00b
*

Posts: 15



« Reply #7 on: 2011-05-17 20:46:32 »

I've upgraded my project to use the latest JOGL2 build, but now I can't use the Netbeans OpenGL pack, so I once again get to struggle with trying to figure out JNLP files. The game runs fine when I run it normally, but if I try and run it through Web Start, or through the browser, I get this error:

Exception in thread "Thread-12" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at com.jogamp.gluegen.runtime.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:102)
   at com.jogamp.gluegen.runtime.NativeLibLoader.access$000(NativeLibLoader.java:51)
   at com.jogamp.gluegen.runtime.NativeLibLoader$1.run(NativeLibLoader.java:70)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.jogamp.gluegen.runtime.NativeLibLoader.loadGlueGenRT(NativeLibLoader.java:68)
   at com.jogamp.common.jvm.JVMUtil.<clinit>(JVMUtil.java:56)
   at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:1141)
   at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:221)
   at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:178)
   at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:169)
   at pixelgame.core.CCore.<init>(CCore.java:177)
   at pixelgame.core.CCore.Instance(CCore.java:78)
   at pixelgame.core.CGLStarterThread.run(CGLStarterThread.java:56)

How should I go about setting up the JNLP and HTML to launch my new JOGL2 app? I've tried a number of changes to the original JNLP with no success, and I've tried using the JNLP Applet launcher(described at the bottom of this page http://www.ntu.edu.sg/home/ehchua/programming/opengl/JOGL2.0.html), but of course, I got the old "Class not found" error that absolutely everyone seems to get with no solution.
Offline ra4king

JGO Kernel
*****

Posts: 3158
Medals: 196


I'm the King!


« Reply #8 on: 2011-05-17 21:00:48 »

This means it can't find gluegen-rt.jar in your classpath. It is supposed to be in the "lib" folder of the JOGL zip file.

Offline superjoebob

JGO n00b
*

Posts: 15



« Reply #9 on: 2011-05-17 21:12:28 »

When it builds it puts that file along with nativewindow.all.jar, jogl.all.jar and newt.all.jar into the lib folder alongside the jar. I think it's issue is that it doesn't know how to find gluegen-rt.dll/.so/.yoursystemlibraryextensionhere. To fix that I imagine I have to tell the JNLP to download the library from the internet somewhere, but I'm unsure how to do that. Unless I just have the JOGL jars in the wrong place?

EDIT: Wait, am I supposed to distribute the JOGL Zip with my Jar?
Games published by our own members! Go get 'em!
Offline gouessej

JGO Kernel
*****

Posts: 3560
Medals: 30


TUER


« Reply #10 on: 2011-05-27 08:27:51 »

Hi!

I explained how to setup Netbeans without the pack here, maybe it could be useful for you:
http://tuer.sourceforge.net/download.php

Julien Gouesse
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.157 seconds with 21 queries.