From 9d78ea65a6bf1064887bc7524c01a689a1fc2a5c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 13 Apr 2013 08:15:21 +0200 Subject: NEWT/AWT: Fix 'AWT driver' to work w/ OSX CALayer ; WindowImpl: 'Object getWrappedWindow()' -> 'NativeSurface getWrappedSurface()' WindowImpl: 'Object getWrappedWindow()' -> 'NativeSurface getWrappedSurface()' - AWT driver itself instantiates the JAWTWindow for eager initialization at createNative(). Fix 'AWT driver' to work w/ OSX CALayer - See above - size reconfig changed to ease OSX CALayer, i.e. set frame's size if already visible reducing CALayer artefacts. --- src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/newt/classes/com') diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index a6c655915..de62747be 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -40,7 +40,6 @@ import javax.media.nativewindow.CapabilitiesImmutable; import javax.media.nativewindow.NativeSurface; import javax.media.nativewindow.NativeWindow; import javax.media.nativewindow.NativeWindowException; -import javax.media.nativewindow.NativeWindowFactory; import javax.media.nativewindow.SurfaceUpdatedListener; import javax.media.nativewindow.util.InsetsImmutable; import javax.media.nativewindow.util.Point; @@ -472,17 +471,16 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind 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; + final NativeSurface ns; + { + final NativeSurface wrapped_ns = window.getWrappedSurface(); + ns = null != wrapped_ns ? wrapped_ns : window; } - final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) nw.getGraphicsConfiguration().getChosenCapabilities(); + final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) ns.getGraphicsConfiguration().getChosenCapabilities(); if(null==factory) { factory = GLDrawableFactory.getFactory(glCaps.getGLProfile()); } - drawable = (GLDrawableImpl) factory.createGLDrawable(nw); + drawable = (GLDrawableImpl) factory.createGLDrawable(ns); drawable.setRealized(true); if( !GLWindow.this.pushGLEventListenerState() ) { -- cgit v1.2.3