Future of GLJPanel with J2D interop ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Future of GLJPanel with J2D interop ?

rachotilko
I have been developing a Swing-based JOGL application and I am utilizing some J2D drawing. Is this contellation a future-proof choice ? Will GLJPanel be part of JOGL in the foreseeable future (2-3 years) ? And will JOGL/J2D interop be still possible ? I could have done things differently, but I admit I like it this way.
Reply | Threaded
Open this post in threaded view
|

Re: Future of GLJPanel with J2D interop ?

Sven Gothel
Administrator
On Tuesday, April 19, 2011 01:52:00 pm rachotilko [via jogamp] wrote:
>
> I have been developing a Swing-based JOGL application and I am utilizing some
> J2D drawing. Is this contellation a future-proof choice ?
As long Swing/J2D is available, it should available,
at least in it's AWT subset, as it is now.

> Will GLJPanel be
> part of JOGL in the foreseeable future (2-3 years) ?
Why not ?
Little footprint, mostly common reused code.

> And will JOGL/J2D
> interop be still possible ?
That is a good Q, indeed.

Does it *still* work with curren JOGL ?
I haven't tested it much, besides the junit test of GLJPanel,
which doesn't test the J2D interop based on external GL context etc (AFAIK).

For all who this is important to .. pls help to make sure it works.
You can discuss it here, tune the GLJPanel tests .. offer patches etc.

> I could have done things differently, but I
> admit I like it this way.

For me and my folks, GLJPanel and J2D has the lowest priority indeed.
However, your contribution is very welcome.

Cheers, Sven
Reply | Threaded
Open this post in threaded view
|

Re: Future of GLJPanel with J2D interop ?

gouessej
Administrator
Hi

I'm currently using the dev build 293. Swing/JOGL(/SWT?) interoperability works fine. The only remaining bug is this one: When I resize my embedded frame vertically, the GLJPanel it contains is not resized correctly except when I resize the same frame horizontally and I still get this exception:
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: sun.java2d.InvalidPipeException: bounds changed or surface lost
        at jogamp.opengl.awt.Java2D.invokeWithOGLContextCurrent(Java2D.java:299)
        at javax.media.opengl.awt.GLJPanel$J2DOGLBackend.doPaintComponent(GLJPanel.java:1527)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:384)
        at javax.swing.JComponent.paint(JComponent.java:1029)
        at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
        at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
        at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
        at java.awt.Container.paint(Container.java:1780)
        at java.awt.Window.paint(Window.java:3375)
        at java.awt.Container.update(Container.java:1801)
        at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
        at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:43)
        at sun.awt.RepaintArea.paint(RepaintArea.java:216)
        at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:695)
        at java.awt.Component.dispatchEventImpl(Component.java:4706)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4460)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: sun.java2d.InvalidPipeException: bounds changed or surface lost
        at sun.java2d.pipe.BufferedContext.validate(BufferedContext.java:162)
        at sun.java2d.pipe.BufferedContext.validateContext(BufferedContext.java:110)
        at sun.java2d.pipe.BufferedContext.validateContext(BufferedContext.java:127)
        at sun.java2d.opengl.OGLUtilities.invokeWithOGLContextCurrent(OGLUtilities.java:91)
        at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at jogamp.opengl.awt.Java2D.invokeWithOGLContextCurrent(Java2D.java:294)
        ... 24 more

I still use JOGL 2.0 inside an Eclipse RCP application. My embedded frame contains a GLJPanel (that contains a JInternalFrame) and a SWT Composite. I can use a more recent build and remove SWT things to see whether I still reproduce this bug if anyone is interested.
Julien Gouesse | Personal blog | Website