Announcing: joglutils project

Thanks :slight_smile:
Also, just in case that someone could be interested, there is also a (new) utility for map edition : Map/World Editor (Project 5). I’ve starten this tool just few times ago, but it grows a little day-by-day. For more informations, just visit my pages.

My best guess is that you’re throwing an exception out of your display callback and JOGL isn’t releasing the OpenGL context. Can you check to see if that’s the problem?

Sorry I haven’t had time to integrate your changes to the joglutils project yet. I’m swamped with work on the new Java Plug-In.

Yes, I should have all the updates in by this weekend. I’ve been swamped lately.

Nope, I don’t have any exceptions that are being thrown from my display callback…though wouldn’t I see this same issue if I was in JOGL rc6 if I was having an exception?
I’m seeing this issue in any code that uses GLCanvas (as in the test3ds.Main) code…and I’m not even talking about the updated code that I submitted because this happens on the original joglutils test code that has none of my updates.

This is only happening on rc7 and rc8 of JOGL and I’m definitely not smart enough to figure out what the issue is…it even happens if I turn off all of the joglutils calls.
Here is some sample code where I’ve completely stripped everything out…I mean everything is gone and i’m basically creating a GLCanvas() and starting the Animator and that is it…note that if I replace the GLCanvas() with a GLJPanel() it runs fine in rc6 and rc8. GLCanvas() runs fine in rc6 but throws the exception below in rc8.

Be aware that I have not messed with GLCanvas() recently so I don’t know if any of this code is correct…though this is the stripped down joglutils test code (Main.java)…I probably should start a separate thread because it appears not to be a joglutils issue which I thought it was at first.


import com.sun.opengl.util.Animator;
import java.awt.Frame;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLJPanel;
import javax.swing.*;
import java.awt.*;

public class Main {
   
    public Main() { }

    public static void main(String[] args) {        
        GLCanvas canvas = new GLCanvas();
        //GLJPanel canvas = new GLJPanel();
        
        Frame frame = new Frame();        
        frame.add(canvas);
        
        final Animator animator = new Animator(canvas);
        
        frame.setVisible(true);
        animator.start();
    }
}

Exception thrown by GLCanvas() version in rc8:


OpenGL pipeline enabled for default config on screen 0
exception in QueueFlusher:
java.lang.RuntimeException: java.lang.IllegalArgumentException: argument type mismatch
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:86)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.platformInfo(JAWT_DrawingSurfaceInfo.java:52)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLDrawable.lockSurface(WindowsOnscreenGLDrawable.java:189)
        at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:57)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.opengl.impl.JAWT_DrawingSurfaceInfo.newPlatformInfo(JAWT_DrawingSurfaceInfo.java:83)
        ... 7 more
exception in QueueFlusher:
javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[Java2D Queue Flusher,10,main]
        at com.sun.opengl.impl.GLContextLock.lock(GLContextLock.java:83)
        at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:131)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
        at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:452)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
exception in QueueFlusher:
javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[Java2D Queue Flusher,10,main]
..
..
repeats
..
..

Just out of curiosity, disable the java2d opengl pipe line when running with the canvas. I know it used to not matter, but I see that you have it enabled when you don’t need it.

I think you may be using mismatched versions of jogl.jar and jogl.dll.

I think it it was my damn path variable in windows that still had rc6 instead of rc8.

any updates on how my fixes have been received? well, I hope :wink:

As one of the joglutils project owners I’m sorry I haven’t helped push this through…but I note that rodgersgb is a Developer on the 3ds portion and intended to put it in earlier. rodgersgb, can you take care of this?

Otherwise, Z-Knight, please apply for a Developer role (assuming you’re comfortable using Subversion) and I’ll approve it so you can check in your changes directly.

Finally, which loaders will JOGLUtils contain? I see it already contains a 3DS loader. Is it planned to provide a OBJ loader and a MD3 loader? What about adding a minimal scenegraph, something lighter than in Java 3D?

Yes, I left a lot of your code in (good job). I’ve been real busy at work and got behind on finishing up the merge and posting it. I think I will go ahead and post what I have for now.

Right now it supports 3DS and OBJ. The OBJ loader is not fully implemented yet because I ran into some problems with the way the Object mesh is defined. The OBJ format is much more bloated than 3DS. I think that coming up with a good scenegraph would fix these issues. It would also allow a way to handle LOD.

Ken, we you get a chance can you create a folder named “model” under net.java.joglutils (net.java.joglutils.model) so I can upload new code?

Thanks.

Added. Let me know if there is anything else you need me to do.

I don’t have write permission to the folder.

I don’t know how permissions to write to sub-portions of the repository work so I’ve added both you and Z-Knight as Developers. Let me know if you need anything else, and please be careful to not break anything in the repository.

Thanks Ken, I have no intentions of going outside of the model package you added for me.

I have put all my code in the net.java.joglutils.model package. The loader supports 3ds and obj (not fully implemented yet).

Z-Knight, if you’re not happy with the citations I put in there for you, by all means change it. I appreciate the work you did on the 3DS portion.

We all do, even if we haven’t had an opportunity to test it out yet :).

Citations are not important to me as long as the loader/viewers work for me and everyone else. Glad to have helped. I’ve not tested the new version since I’m still working with the old layout in my own code but I will as soon as I get some time. Thanks for the updates and the new obj loader start.

I have downloaded same .3ds from the net and tried to load it using joglutils. Programs runs without no error but does not shows any scene in the window.

???

If you will post a link to the 3ds file I will try it out.