Bug 308

Summary: Assymetry in null GLCapabilities parameter for off-screen context creation
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED INVALID    
Severity: normal    
Priority: P3    
Version: 1   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
Workaround: ---

Description Sven Gothel 2010-03-24 07:50:42 CET


---- Reported by moorej 2007-07-05 13:22:27 ----

Passing a null for the GLCapabilities when creating a pbuffer throws a
NullPointerException.  This is not the same for the onscreen drawables.  After
looking at the source code, it appears that this is only a problem for Mac and
Windows, the X11 version checks for null.

Here's the stack trace

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at com.sun.opengl.impl.windows.WindowsGLDrawable.<init>(WindowsGLDrawabl
e.java:58)
        at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.<init>(WindowsPb
ufferGLDrawable.java:62)
        at com.sun.opengl.impl.windows.WindowsGLDrawableFactory$2.run(WindowsGLD
rawableFactory.java:147)
        at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.maybeDoSingleThr
eadedWorkaround(WindowsGLDrawableFactory.java:219)
        at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.createGLPbuffer(
WindowsGLDrawableFactory.java:164)
        at SharedPBuffer.init(SharedPBuffer.java:87)
        at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:72)
        at javax.media.opengl.GLCanvas$InitAction.run(GLCanvas.java:307)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1
89)
        at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.
java:301)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:133)
        at javax.media.opengl.GLCanvas.paint(GLCanvas.java:166)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
        at sun.awt.RepaintArea.paint(RepaintArea.java:224)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:293)
        at java.awt.Component.dispatchEventImpl(Component.java:4483)
        at java.awt.Component.dispatchEvent(Component.java:4237)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
pBuffer = GLDrawableFactory.getFactory().createGLPbuffer(
          null, null, 400, 400, canvas.getContext());

WindowsGLDrawable.java:58
    this.capabilities = (GLCapabilities) capabilities.clone();

MacOSXGLDrawable.java:86
	this.capabilities = (GLCapabilities) capabilities.clone();

- whereas -
X11GLDrawable.java:57
    this.capabilities = (capabilities == null) ? null :
      ((GLCapabilities) capabilities.clone());



--- Bug imported by sgothel@jausoft.com 2010-03-24 07:50 EDT  ---

This bug was previously known as _bug_ 308 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=308
Comment 1 Sven Gothel 2010-11-19 01:12:41 CET
it works .. see junit offscreen tests