Summary: | "GL_VERSION is NULL" exception in createExternalGLContext() for SWT tests | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Wade Walker <wwalker3> |
Component: | opengl | Assignee: | Sven Gothel <sgothel> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | darnells, kai, mateushek |
Priority: | --- | ||
Version: | 2 | ||
Hardware: | pc_x86_64 | ||
OS: | windows | ||
Type: | --- | SCM Refs: |
6dd574f75e0b27de31136c05cc0ed18f075f004f
|
Workaround: | --- |
Description
Wade Walker
2011-01-03 22:43:21 CET
The problem seems to be in WindowsWGLGraphicsConfiguration.create() at line 112: if(hasARB) { sharedContext.makeCurrent(); try { caps = wglARBPFID2GLCapabilities(sharedContext, hdc, pfdID, glp, onscreen, usePBuffer); } finally { sharedContext.release(); } If I comment out the two lines to make the shared context current and to release it, the "GL_VERSION is NULL" problem a bit later in the WindowsExternalWGLContext constructor goes away. Apparently this disturbance in the context is enough to mess up later access to the GL object so that getGL().glGetString(GL.GL_VERSION) returns null. The problem is, I don't believe that removing these two lines is the correct solution. The call to sharedCtx.getWGLExt().wglGetPixelFormatAttribivARB() inside wglARBPFID2GLCapabilities() is supposed to require a current context, so I'm not sure why it works without one. The AWT tests still work like this, but I'm suspicious. Do you have any suggestions about a better solution? Perhaps your upcoming changes are going over this area again? Hi Sven, I'm waiting for your next checkin before doing more on this bug. From your forum post on January 10th, it sounded like you were making changes to GLCapabilities, which seems to be where the bug lies. Hi, I'm facing the very same problem using jogl-2.0-b270-20110125-windows-amd64 Kind regards, Kai Having the same problem in my application, after upgrading the jogl to newest version. My system is Windows 7 32bit & Nvidia. I've submitted a pull request for two SWT unit tests that reproduce this problem. You can comment/vote on it at https://github.com/sgothel/jogl/pull/14. These problems are now reproduced in the auto build, since the new SWT tests have been merged in. I can confirm this bug is related to WindowsWGLGraphicsConfiguration and WindowsWGLGraphicsConfigurationFactory. WindowsWGLGraphicsConfiguration.create(..) -> WindowsWGLGraphicsConfiguration.createFromCurrent(..) emphasizing that all resources are 'current' ie locked and available. This method is used for the external context/drawable creation only, called while they are current. Hence this method no more makeCurrent/release, which interfered with the current external context state. WindowsWGLGraphicsConfigurationFactory: Move surface locking to the right (common) place. Testing .. 6dd574f75e0b27de31136c05cc0ed18f075f004f |