diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java index fd8052b96..1aca29d0a 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java @@ -272,11 +272,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { final GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(capsRequested); final GLDrawableImpl drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser, new UpstreamSurfaceHookMutableSize(width, height) ) ); + final GLContextImpl ctx; if(null != drawable) { drawable.setRealized(true); + ctx = (GLContextImpl) drawable.createContext(shareWith); + } else { + ctx = null; } - - return new GLPbufferImpl( drawable, (GLContextImpl) drawable.createContext(shareWith) ); + return new GLPbufferImpl( drawable, ctx); } //--------------------------------------------------------------------------- @@ -607,7 +610,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { rampEntry = 0.0f; gammaRamp[i] = rampEntry; } - needsGammaRampReset = true; + if( !needsGammaRampReset ) { + originalGammaRamp = getGammaRamp(); + needsGammaRampReset = true; + } return setGammaRamp(gammaRamp); } |