Login  Register

Swing application crashing when resizing OpenGL (GLJPanel) window.

Posted by mikaelhc on Dec 07, 2012; 11:03am
URL: https://forum.jogamp.org/Swing-application-crashing-when-resizing-OpenGL-GLJPanel-window-tp4027441.html

Hi,

I'm still struggling with creating a stable code base for visualizing some scientific data (3D molecules).

Basically, I have a Swing application where I want to show some 3D graphics, driven by a FPSAnimator. All modifications to the data model and UI takes place in the EDT thread.

My troubles come when I start resizing the application.

I've previosly tried using a GLCanvas, but here I encountered the error described here:
http://forum.jogamp.org/GLCanvas-GLJPanel-problems-td4026923.html

So now I switched to GLJPanel, but occasionally I get crashes when resizing the application:

"Caused by: javax.media.opengl.GLException: Should not call this
        at jogamp.opengl.windows.wgl.WindowsWGLContext.getOffscreenContextPixelDataType(WindowsWGLContext.java:542)"

(Full stack trace here: http://pastebin.com/50VKHnTY)
       
In DEBUG mode I get slightly different errors:

When in debug mode, I can see that I always get some exceptions when resizing (but they do not seem to be critical):
java.lang.Exception: Info: setGL (OpenGL null): AWT-EventQueue-0, <null> -> GL4bcImpl, jogamp.opengl.gl4.GL4bcImpl@3cfaab
(Full stack trace here: http://pastebin.com/2tK342wd)

The critical errors (where the rendering stops working) displays these stack traces continously:
http://pastebin.com/sbEfXj63

(Startup information from debug mode here: http://pastebin.com/nGqYNwAq)

I'm *very* interested in workarounds for this: I guess it must be possible to create a simple embedded 3D view, where I can resize the window? Should I use a different approach? Using something else instead of the FPSAnimator to drive the animation? Should I go for JOGL 1.0 instead?

Best regards, Mikael.

System info: Jogl2.0-RC11 - Windows Vista 32-bit - Geforce 570GTX (Driver 9.18.13.697 (10-2-2012) - nvoglv32)