diff options
author | Wade Walker <[email protected]> | 2011-02-08 21:36:47 -0600 |
---|---|---|
committer | Wade Walker <[email protected]> | 2011-02-08 21:36:47 -0600 |
commit | ac03851ea77e02c36bdffab461e4a0d2a1971f2d (patch) | |
tree | 3726fcddf10c0a51d3339192ceb879d3a0b1de18 /src/jogl/classes | |
parent | 33a2605d37ec590b8a7fd37a708f8159cb9bd487 (diff) |
Fix ClassCastException when debug logging enabled
The debug logging code puts a null reference into a list,
then tries to cast it to a WGLGLCapabilities object.
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index a66d62485..40271d284 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -153,7 +153,10 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat int numFormats = pformats.length; ArrayList bucket = new ArrayList(numFormats); for (int i = 0; i < numFormats; i++) { - bucket.add( WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, hdc, pformats[i], onscreen) ); + WGLGLCapabilities wglglcapabilities = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, hdc, pformats[i], onscreen); + // formats that don't draw to a window come back null; don't add them or they'll crash debug output + if( wglglcapabilities != null ) + bucket.add( wglglcapabilities ); } return bucket; } |