GLJPanel & Java2D

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

GLJPanel & Java2D

Xfel
Hello,

I'm using jogl-2.0-b3-20101124-windows-amd64 on Windows 7. I wrote a Swing application, so it was logical to use GLJPanel.

When I use -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=true i first get this exception:

exception in QueueFlusher:
javax.media.opengl.GLException: Error: attempted to make an external GLDrawable without a drawable current
        at com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext.create(WindowsExternalWGLContext.java:78)
        at com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory.createExternalGLContextImpl(WindowsWGLDrawableFactory.java:289)
        at com.jogamp.opengl.impl.GLDrawableFactoryImpl.createExternalGLContext(GLDrawableFactoryImpl.java:226)
        at com.jogamp.opengl.impl.awt.Java2D$3.run(Java2D.java:561)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:202)

additionally, at a specific width, there is a diplay error: the pixel colum is just repeated.

if I now resize, the error still begins at the same place. when i make the windows smaller, i suddenly get this one:
exception in QueueFlusher:
javax.media.opengl.GLException: GLEventListener org.xfel.eep.ui.splines.SplineRenderer@5ec24193 already initialized: AWT-GLJPanel[ com.jogamp.opengl.impl.GLPbufferImpl]
        at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:168)
        at javax.media.opengl.awt.GLJPanel$Updater.init(GLJPanel.java:600)
        at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:153)
        at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:167)
        at com.jogamp.opengl.impl.GLPbufferImpl$InitAction.run(GLPbufferImpl.java:304)
        at com.jogamp.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:348)
        at com.jogamp.opengl.impl.GLPbufferImpl$DisplayOnEventDispatchThreadAction.run(GLPbufferImpl.java:328)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:202)
after this, my view is only black-white.

if i leave the -Dsun.java2d.opengl=true out, the display error is still existing, and on resize i get this exception:

Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: GLEventListener org.xfel.eep.ui.splines.SplineRenderer@5289e2f1 already initialized: AWT-GLJPanel[ com.jogamp.opengl.impl.GLPbufferImpl]
        at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:168)
        at javax.media.opengl.awt.GLJPanel$Updater.init(GLJPanel.java:600)
        at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:153)
        at com.jogamp.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:167)
        at com.jogamp.opengl.impl.GLPbufferImpl$InitAction.run(GLPbufferImpl.java:304)
        at com.jogamp.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:348)
        at com.jogamp.opengl.impl.GLPbufferImpl.maybeDoSingleThreadedWorkaround(GLPbufferImpl.java:297)
        at com.jogamp.opengl.impl.GLPbufferImpl.display(GLPbufferImpl.java:121)
        at javax.media.opengl.awt.GLJPanel$PbufferBackend.doPaintComponentImpl(GLJPanel.java:1173)
        at javax.media.opengl.awt.GLJPanel$AbstractReadbackBackend.doPaintComponent(GLJPanel.java:944)
        at javax.media.opengl.awt.GLJPanel.paintComponent(GLJPanel.java:324)
        at javax.swing.JComponent.paint(JComponent.java:1017)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paint(JComponent.java:1026)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paint(JComponent.java:1026)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paint(JComponent.java:1026)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paint(JComponent.java:1026)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paint(JComponent.java:1026)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paint(JComponent.java:1026)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
        at javax.swing.JComponent.paintChildren(JComponent.java:852)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5119)
        at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1475)
        at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1406)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1220)
        at javax.swing.JComponent.paint(JComponent.java:1003)
        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 javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        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)

using GLCanvas is having some troubles, but in general it works very well

What is the problem here?
could you please fix it?
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

gouessej
Administrator
Hi!

Please provide a test case, some source code to reproduce your problem.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Sven Gothel
Administrator
On Wednesday, December 01, 2010 22:04:41 gouessej [via jogamp] wrote:
>
> Hi!
>
> Please provide a test case, some source code to reproduce your problem.
>

Yup ..

http://jogamp.org/wiki/index.php/Jogl_FAQ#Bugreports_.26_Testing

Thank you.

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

Re: GLJPanel & Java2D

Xfel
Taht's a bit difficult because my application is a utility tool for another program. I'll try:
 this is the part where the GLJPanel is created:

preview = new GLJPanel(new GLCapabilities(GLProfile.get(GLProfile.GL2)));
renderer = new SplineRenderer(preview);// this one automatically adds the listeners
preview.setName("preview");
pPreview.add(preview, BorderLayout.CENTER);

all other errors result in the code that comes from JOGL or Java.
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Xfel
I forgot to mention that I don't get my GLJPanel to become focused and so listen for key events.

ant I have one question: why is it inheriting from JPanel instead of JComponent?
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Xfel
I just notified something new: The Width of the area rendered correctly is half the width of the pBuffer.

I would really be happy if someone would do something about this. I tried it with both the lates autobild as well as the so called stable release. But with the buggy GLJPanel stuff, you never can call that stable.
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Xfel
If I try to use the Java2D-Bridge, I now get the following exceptions:

exception in QueueFlusher:
javax.media.opengl.GLException: GL_VERSION is NULL: com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext [OpenGL -1.-1, options 0x0, null, handle 0x10001, com.jogamp.opengl.impl.gl4.GL4bcImpl@317b1d64,
        Drawable: com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext$Drawable[Realized true,
        Factory   com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory@9c6a99d,
        handle    0x4e01137a,
        Window    ProxySurface[config WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[DefaultGraphicsDevice[type Windows, connection decon, unitID 0, handle 0x0], idx 0], pfdID 2, ARB-Choosen true,
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: true, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 8, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: true, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: true, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 8, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: true, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]], displayHandle 0x0, surfaceHandle 0x4e01137a, size 0x0]]]
        at com.jogamp.opengl.impl.GLContextImpl.setContextVersion(GLContextImpl.java:676)
        at com.jogamp.opengl.impl.GLContextImpl.setGLFunctionAvailability(GLContextImpl.java:863)
        at com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext.<init>(WindowsExternalWGLContext.java:68)
        at com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext.create(WindowsExternalWGLContext.java:88)
        at com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory.createExternalGLContextImpl(WindowsWGLDrawableFactory.java:424)
        at com.jogamp.opengl.impl.GLDrawableFactoryImpl.createExternalGLContext(GLDrawableFactoryImpl.java:282)
        at com.jogamp.opengl.impl.awt.Java2D$3.run(Java2D.java:561)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:202)
GLJPanel.addNotify()
GLJPanel.handleReshape: (w,h) = (1916,889)
-- In invokeWithOGLContextCurrent
exception in QueueFlusher:
javax.media.opengl.GLException: GL_VERSION is NULL: com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext [OpenGL -1.-1, options 0x0, null, handle 0x10001, com.jogamp.opengl.impl.gl4.GL4bcImpl@727f3b8a,
        Drawable: com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext$Drawable[Realized true,
        Factory   com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory@9c6a99d,
        handle    0x4e01137a,
        Window    ProxySurface[config WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[DefaultGraphicsDevice[type Windows, connection decon, unitID 0, handle 0x0], idx 0], pfdID 2, ARB-Choosen true,
        requested GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: true, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 8, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: true, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false],
        chosen    GLCapabilities[Capabilities[Onscreen: true, Red: 8, Green: 8, Blue: 8, Alpha: 8, Opaque: true], GL profile: GLProfile[GL2/GL2], PBuffer: true, DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 8, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false, Num samples: 0, PBuffer-FloatingPointBuffers: true, PBuffer-RenderToTexture: false, PBuffer-RenderToTextureRectangle: false]], displayHandle 0x0, surfaceHandle 0x4e01137a, size 0x0]]]
        at com.jogamp.opengl.impl.GLContextImpl.setContextVersion(GLContextImpl.java:676)
        at com.jogamp.opengl.impl.GLContextImpl.setGLFunctionAvailability(GLContextImpl.java:863)
        at com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext.<init>(WindowsExternalWGLContext.java:68)
        at com.jogamp.opengl.impl.windows.wgl.WindowsExternalWGLContext.create(WindowsExternalWGLContext.java:88)
        at com.jogamp.opengl.impl.windows.wgl.WindowsWGLDrawableFactory.createExternalGLContextImpl(WindowsWGLDrawableFactory.java:424)
        at com.jogamp.opengl.impl.GLDrawableFactoryImpl.createExternalGLContext(GLDrawableFactoryImpl.java:282)
        at javax.media.opengl.awt.GLJPanel$J2DOGLBackend$3.run(GLJPanel.java:1535)
        at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:202)

Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Wade Walker
Administrator
I've seen this "GL_VERSION is NULL" bug too. On Windows 7 64-bit, the last autobuild version that doesn't have this bug is autobuild b244 -- every version after that fails. I'm going to submit a bug report for this soon, I was just trying to debug it more first.

In the meantime, I'm just running b244, which seems to work OK. The TestGearsGLJPanelAWT test works on this build, so your GLJPanel stuff may work on it too. You might take a look at it, the path is jogl\src\junit\com\jogamp\test\junit\jogl\demos\gl2\gears\TestGearsGLJPanelAWT.java.
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Wade Walker
Administrator
In reply to this post by Xfel
I've submitted a bug report for this "GL_VERSION is NULL" bug. You can find it at https://jogamp.org/bugzilla/show_bug.cgi?id=452. You can CC yourself on the report to be notified of progress.

It looks like some changes to WindowsWGLGraphicsConfiguration.java and
WindowsWGLGraphicsConfigurationFactory.java in jogl commit 0a6a592c04a85d8124aa9d38b67f0caa1d739b75 may have introduced this bug on December 9. It shows up first in autobuild b245.

I've written two unit tests that reproduce this bug, and I'm in the process of trying to fix it.
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

gouessej
Administrator
Does it concern only Windows?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Wade Walker
Administrator
I assume it's Windows-only, since it looks like a change in WindowsWGLGraphicsConfiguration.java exposed the problem.

I'm asking Sven for his input on the right solution on the bug page. I found a dirty hack to make the bug go away, but I don't think it's a good idea
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Matt
In reply to this post by Xfel
Just want to report that I spotted the same bug in my app (SWT+JOGL), on Windows 7 32bit + NVidia.
For now applied the workaround proposed in bug 452, and it is working...
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel & Java2D

Wade Walker
Administrator
Please mention that on the bug report too -- it may help Sven prioritize it higher