diff options
author | Sven Gothel <[email protected]> | 2013-01-24 17:24:22 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-01-24 17:24:22 +0100 |
commit | b738983638703bb721ee4c9820c8ef43e2252e73 (patch) | |
tree | 5543e1be50c497619b6902676e7f66fdfaea78cd /src/newt/classes/com | |
parent | 85d70b7d38885fa8ba6374aa790d5a296acc8ec1 (diff) |
Bug 665 (part 1) - Allow dis-association of GLContext's GLDrawable ..
Changes allowing re-association (incl. null) of GLContext/GLDrawable:
- GLAutoDrawable: Refine API doc 'setContext(..)'
- GLContext: Refine API doc: 'setGLDrawable(..)' 'getGLDrawable()'
- GLContextImpl.setGLDrawable(): Handle null drawable
- GLAutoDrawableDelegate/GLAutoDrawableBase: Allow null GLContext
- GLDrawableHelper.switchContext(..)/recreateGLDrawable(): Balance GLContext.setGLDrawable(..) calls
- New GLEventListenerState, holding state vector [GLEventListener, GLContext, .. ]
impl. relocation of all components from/to GLAutoDrawable.
- GLDrawableUtil
- Using GLEventListenerState for swapGLContextAndAllGLEventListener(..)
+++
NEWT Window*:
- getDisplayHandle() is 'final', no more 'shortcut' code allowed
due to re-association incl. display handle.
- close*:
- close config's device (was missing)
- null config
+++
Changes allowing reconfig of Display handle as required
to re-associate pre-existing GLContext to a 'window':
- AbstractGraphicsDevice: Add isHandleOwner() / clearHandleOwner()
- Impl. in X11GraphicsDevice and EGLGraphicsDevice, NOP in DefaultGraphicsDevice
- DefaultGraphicsConfiguration add 'setScreen(..)'
- MutableGraphicsConfiguration
- Make DefaultGraphicsConfiguration.setScreen(..) public
- NativeWindowFactory add 'createScreen(String type, AbstractGraphicsDevice device, int screen)'
- Refactored from SWTAccessor
- NativeWindow x11ErrorHandler: Dump Stack Trace in DEBUG mode, always.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 96d0f6e3b..7fccb6622 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -458,24 +458,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind } else { t0 = 0; } - - /* if (nativeWindowCreated && null != context) { - throw new GLException("InternalError: Native Windows has been just created, but context wasn't destroyed (is not null)"); - } */ - if (null == context && visible && 0 != window.getWindowHandle() && 0<getWidth()*getHeight()) { - NativeWindow nw; + + if (null == drawable && visible && 0 != window.getWindowHandle() && 0<getWidth()*getHeight()) { + if( ( null != context ) ) { + throw new InternalError("GLWindow.LifecycleHook.setVisiblePost: "+WindowImpl.getThreadName()+" - Null drawable, but valid context - "+GLWindow.this); + } + final NativeWindow nw; if (window.getWrappedWindow() != null) { nw = NativeWindowFactory.getNativeWindow(window.getWrappedWindow(), window.getPrivateGraphicsConfiguration()); } else { nw = window; } - GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) nw.getGraphicsConfiguration().getChosenCapabilities(); + final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) nw.getGraphicsConfiguration().getChosenCapabilities(); if(null==factory) { factory = GLDrawableFactory.getFactory(glCaps.getGLProfile()); } - if(null==drawable) { - drawable = (GLDrawableImpl) factory.createGLDrawable(nw); - } + drawable = (GLDrawableImpl) factory.createGLDrawable(nw); drawable.setRealized(true); context = (GLContextImpl) drawable.createContext(sharedContext); context.setContextCreationFlags(additionalCtxCreationFlags); |