diff options
author | Sven Gothel <[email protected]> | 2010-10-06 16:04:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-06 16:04:06 +0200 |
commit | 018c7e8660dc0af68bd129be9af5094d04d0b431 (patch) | |
tree | ac17156a48167f4a28e129adfc78b7c746aa6744 /src/jogl/classes/com/jogamp/opengl/impl/windows/wgl | |
parent | 03416ffe040d50b96573930104a78933605ae40d (diff) |
NativeWindow/NativeSurface Refactoring ; Added mouseClick NEWT/AWT unit test
NativeWindow/NativeSurface Refactoring
- Using NativeSurface interface
- NativeWindow extends NativeSurface, adds getLocationOnScreen(Point)
- NativeWindow add: getParent()
- NativeWindow/Surface: Removed 'invalidate()', use 'destroy()' if you must.
- NullWindow -> ProxySurface impl NativeSurface
- JOGL: Uses NativeSurface only.
- GLDrawable.getNativeWindow() -> GLDrawable.getNativeSurface()
Added mouseClick NEWT/AWT unit test
JOGL:
- GLAnimatorControl add: resetCounter()
-
NEWT:
- GLWindow counters: return GLWindow counters always
- WindowImpl
- requestFocus() wait until done
- reparent: readded requestFocusImpl(true),
native impl skips java focusAction if reparented
- X11Window: Add XRaiseWindow() in requestFocus()
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/windows/wgl')
11 files changed, 74 insertions, 72 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java index 5e3d55b04..299adec50 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -41,22 +42,22 @@ package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.ProxySurface; public class WindowsDummyWGLDrawable extends WindowsWGLDrawable { private long hwnd, hdc; public WindowsDummyWGLDrawable(GLDrawableFactory factory, GLProfile glp) { - super(factory, new NullWindow(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(glp, null, true, true)), true); + super(factory, new ProxySurface(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(glp, null, true, true)), true); // All entries to CreateDummyWindow must synchronize on one object // to avoid accidentally registering the dummy window class twice synchronized (WindowsDummyWGLDrawable.class) { hwnd = GDI.CreateDummyWindow(0, 0, 1, 1); } hdc = GDI.GetDC(hwnd); - NullWindow nw = (NullWindow) getNativeWindow(); - nw.setSurfaceHandle(hdc); - WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)nw.getGraphicsConfiguration().getNativeGraphicsConfiguration(); + ProxySurface ns = (ProxySurface) getNativeSurface(); + ns.setSurfaceHandle(hdc); + WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration(); // Choose a (hopefully hardware-accelerated) OpenGL pixel format for this device context GLCapabilities caps = (GLCapabilities) config.getChosenCapabilities(); caps.setDepthBits(16); diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java index 1f1fb0d40..9917ea901 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLContext.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -42,7 +43,7 @@ package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; import javax.media.nativewindow.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.ProxySurface; public class WindowsExternalWGLContext extends WindowsWGLContext { private boolean firstMakeCurrent = true; @@ -77,10 +78,10 @@ public class WindowsExternalWGLContext extends WindowsWGLContext { AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(); WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfiguration.create(hdc, pfdID, glp, aScreen, true, true); - NullWindow nw = new NullWindow(cfg); - nw.setSurfaceHandle(hdc); + ProxySurface ns = new ProxySurface(cfg); + ns.setSurfaceHandle(hdc); - return new WindowsExternalWGLContext(new Drawable(factory, nw), ctx, cfg); + return new WindowsExternalWGLContext(new Drawable(factory, ns), ctx, cfg); } public int makeCurrent() throws GLException { @@ -114,7 +115,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext { // Need to provide the display connection to extension querying APIs static class Drawable extends WindowsWGLDrawable { - Drawable(GLDrawableFactory factory, NativeWindow comp) { + Drawable(GLDrawableFactory factory, NativeSurface comp) { super(factory, comp, true); } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java index 41e469224..19fe8f03c 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -42,11 +43,11 @@ package com.jogamp.opengl.impl.windows.wgl; import javax.media.nativewindow.*; import javax.media.opengl.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.ProxySurface; public class WindowsExternalWGLDrawable extends WindowsWGLDrawable { - private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeWindow component) { + private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeSurface component) { super(factory, component, true); } @@ -63,12 +64,12 @@ public class WindowsExternalWGLDrawable extends WindowsWGLDrawable { AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(); WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfiguration.create(hdc, pfdID, glp, aScreen, true, true); - NullWindow nw = new NullWindow(cfg); - nw.setSurfaceHandle(hdc); + ProxySurface ns = new ProxySurface(cfg); + ns.setSurfaceHandle(hdc); - cfg.updateGraphicsConfiguration(factory, nw); + cfg.updateGraphicsConfiguration(factory, ns); - return new WindowsExternalWGLDrawable(factory, nw); + return new WindowsExternalWGLDrawable(factory, ns); } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java index 8079cd42a..ea02a4919 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -42,13 +43,12 @@ package com.jogamp.opengl.impl.windows.wgl; import javax.media.opengl.*; import javax.media.nativewindow.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.NullWindow; public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { private long origbitmap; private long hbitmap; - public WindowsOffscreenWGLDrawable(GLDrawableFactory factory, NativeWindow target) { + public WindowsOffscreenWGLDrawable(GLDrawableFactory factory, NativeSurface target) { super(factory, target, true); create(); } @@ -66,8 +66,8 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { } private void create() { - NativeWindow nw = getNativeWindow(); - WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)nw.getGraphicsConfiguration().getNativeGraphicsConfiguration(); + NativeSurface ns = getNativeSurface(); + WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities capabilities = (GLCapabilities)config.getRequestedCapabilities(); int width = getWidth(); int height = getHeight(); @@ -97,7 +97,7 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { System.out.println("LastError: " + GDI.GetLastError()); throw new GLException("Error creating device context for offscreen OpenGL context"); } - ((SurfaceChangeable)nw).setSurfaceHandle(hdc); + ((SurfaceChangeable)ns).setSurfaceHandle(hdc); hbitmap = GDI.CreateDIBSection(hdc, info, GDI.DIB_RGB_COLORS, null, 0, 0); if (hbitmap == 0) { @@ -114,19 +114,19 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable { throw new GLException("Error selecting bitmap into new device context"); } - config.updateGraphicsConfiguration(getFactory(), nw); + config.updateGraphicsConfiguration(getFactory(), ns); } public void destroy() { - NativeWindow nw = getNativeWindow(); - if (nw.getSurfaceHandle() != 0) { + NativeSurface ns = getNativeSurface(); + if (ns.getSurfaceHandle() != 0) { // Must destroy bitmap and device context - GDI.SelectObject(nw.getSurfaceHandle(), origbitmap); + GDI.SelectObject(ns.getSurfaceHandle(), origbitmap); GDI.DeleteObject(hbitmap); - GDI.DeleteDC(nw.getSurfaceHandle()); + GDI.DeleteDC(ns.getSurfaceHandle()); origbitmap = 0; hbitmap = 0; - ((SurfaceChangeable)nw).setSurfaceHandle(0); + ((SurfaceChangeable)ns).setSurfaceHandle(0); } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java index 401b8c3c6..b0d62a4e1 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -44,7 +45,7 @@ import javax.media.opengl.*; import com.jogamp.opengl.impl.*; public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable { - protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeWindow component) { + protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeSurface component) { super(factory, component, false); } @@ -52,12 +53,4 @@ public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable { return new WindowsOnscreenWGLContext(this, shareWith); } - public int getWidth() { - return component.getWidth(); - } - - public int getHeight() { - return component.getHeight(); - } - } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java index c8c62914a..5708aa6bb 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -51,16 +52,16 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { private int floatMode; - public WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeWindow target, + public WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeSurface target, WindowsWGLDrawable dummyDrawable, WGLExt wglExt) { super(factory, target, true); if (DEBUG) { - System.out.println("Pbuffer config: " + getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration()); + System.out.println("Pbuffer config: " + getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration()); } - createPbuffer(dummyDrawable.getNativeWindow().getSurfaceHandle(), wglExt); + createPbuffer(dummyDrawable.getNativeSurface().getSurfaceHandle(), wglExt); if (DEBUG) { System.err.println("Created pbuffer " + this); @@ -80,18 +81,18 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { } public void destroy() { - NativeWindow nw = getNativeWindow(); + NativeSurface ns = getNativeSurface(); if(0!=buffer) { WGLExt wglExt = cachedWGLExt; - if (nw.getSurfaceHandle() != 0) { + if (ns.getSurfaceHandle() != 0) { // Must release DC and pbuffer // NOTE that since the context is not current, glGetError() can // not be called here, so we skip the use of any composable // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl) - if (wglExt.wglReleasePbufferDCARB(buffer, nw.getSurfaceHandle()) == 0) { + if (wglExt.wglReleasePbufferDCARB(buffer, ns.getSurfaceHandle()) == 0) { throw new GLException("Error releasing pbuffer device context: error code " + GDI.GetLastError()); } - ((SurfaceChangeable)nw).setSurfaceHandle(0); + ((SurfaceChangeable)ns).setSurfaceHandle(0); } if (!wglExt.wglDestroyPbufferARB(buffer)) { throw new GLException("Error destroying pbuffer: error code " + GDI.GetLastError()); @@ -102,7 +103,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { public long getPbufferHandle() { // The actual to-be-used handle for makeCurrent etc, - // is the derived DC, set in the NativeWindow surfaceHandle + // is the derived DC, set in the NativeSurface surfaceHandle // returned by getHandle(). return buffer; } @@ -124,7 +125,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { int niattribs = 0; int width, height; - WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities capabilities = (GLCapabilities)config.getRequestedCapabilities(); GLProfile glProfile = capabilities.getGLProfile(); @@ -265,10 +266,10 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { throw new GLException("pbuffer creation error: wglGetPbufferDC() failed"); } - NativeWindow nw = getNativeWindow(); + NativeSurface ns = getNativeSurface(); // Set up instance variables buffer = tmpBuffer; - ((SurfaceChangeable)nw).setSurfaceHandle(tmpHdc); + ((SurfaceChangeable)ns).setSurfaceHandle(tmpHdc); cachedWGLExt = wglExt; cachedParentHdc = parentHdc; @@ -324,7 +325,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable { width = tmp[0]; wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_HEIGHT_ARB, tmp, 0 ); height = tmp[0]; - ((SurfaceChangeable)nw).setSize(width, height); + ((SurfaceChangeable)ns).setSize(width, height); } private static String wglGetLastError() { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java index 33f1bc829..c80e46cc2 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -306,7 +307,7 @@ public class WindowsWGLContext extends GLContextImpl { if (newCreated) { WindowsWGLGraphicsConfiguration config = - (WindowsWGLGraphicsConfiguration)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + (WindowsWGLGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration(); config.updateCapabilitiesByWGL(this); } } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java index b1bc9b5ce..9fef457db 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawable.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -55,7 +56,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { private long profilingSwapBuffersTime; - public WindowsWGLDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized) { + public WindowsWGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) { super(factory, comp, realized); } @@ -64,9 +65,9 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl { return; // nothing todo .. } - NativeWindow nativeWindow = getNativeWindow(); - WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)nativeWindow.getGraphicsConfiguration().getNativeGraphicsConfiguration(); - config.updateGraphicsConfiguration(getFactory(), nativeWindow); + NativeSurface ns = getNativeSurface(); + WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration(); + config.updateGraphicsConfiguration(getFactory(), ns); if (DEBUG) { System.err.println("!!! WindowsWGLDrawable.setRealized(true): "+config); } diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java index 85444b61c..08cee4dab 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -47,7 +48,7 @@ import javax.media.opengl.*; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.util.*; import com.jogamp.opengl.impl.*; -import com.jogamp.nativewindow.impl.NullWindow; +import com.jogamp.nativewindow.impl.ProxySurface; public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { private static final boolean VERBOSE = Debug.verbose(); @@ -134,14 +135,14 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { } } - public GLDrawableImpl createOnscreenDrawable(NativeWindow target) { + public GLDrawableImpl createOnscreenDrawable(NativeSurface target) { if (target == null) { throw new IllegalArgumentException("Null target"); } return new WindowsOnscreenWGLDrawable(this, target); } - protected GLDrawableImpl createOffscreenDrawable(NativeWindow target) { + protected GLDrawableImpl createOffscreenDrawable(NativeSurface target) { if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -152,7 +153,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { return canCreateGLPbuffer; } - protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeWindow target) { + protected GLDrawableImpl createGLPbufferDrawableImpl(final NativeSurface target) { if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -185,12 +186,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { return (GLDrawableImpl) returnList.get(0); } - protected NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { + protected NativeSurface createOffscreenSurface(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height) { AbstractGraphicsScreen screen = DefaultGraphicsScreen.createDefault(); - NullWindow nw = new NullWindow(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( - capabilities, chooser, screen) ); - nw.setSize(width, height); - return nw; + ProxySurface ns = new ProxySurface(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( + capabilities, chooser, screen) ); + ns.setSize(width, height); + return ns; } public GLContext createExternalGLContext() { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java index eb5719566..8744b7a37 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -86,8 +87,8 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio } /** Update config - before having a valid context */ - protected void updateGraphicsConfiguration(GLDrawableFactory factory, NativeWindow nativeWindow) { - WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, nativeWindow); + protected void updateGraphicsConfiguration(GLDrawableFactory factory, NativeSurface ns) { + WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, ns); } /** Update config - after having a valid and current context */ @@ -101,8 +102,8 @@ public class WindowsWGLGraphicsConfiguration extends DefaultGraphicsConfiguratio WGLExt wglExt = (WGLExt) context.getPlatformGLExtensions(); GLDrawable drawable = context.getGLDrawable(); - NativeWindow nativeWindow = drawable.getNativeWindow(); - long hdc = nativeWindow.getSurfaceHandle(); + NativeSurface ns = drawable.getNativeSurface(); + long hdc = ns.getSurfaceHandle(); GLCapabilities[] caps = HDC2GLCapabilities(wglExt, hdc, getPixelFormatID(), glp, true, onscreen, usePBuffer); if(null!=caps && null!=caps[0]) { 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 e76e63f23..fd5a174c8 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 @@ -1,5 +1,6 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright (c) 2010 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -87,10 +88,10 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio } protected static void updateGraphicsConfiguration(CapabilitiesChooser chooser, - GLDrawableFactory _factory, NativeWindow nativeWindow) { + GLDrawableFactory _factory, NativeSurface ns) { WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory; - if (nativeWindow == null) { - throw new IllegalArgumentException("NativeWindow is null"); + if (ns == null) { + throw new IllegalArgumentException("NativeSurface is null"); } if (chooser != null && @@ -99,17 +100,17 @@ public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfiguratio } boolean choosenBywGLPixelFormat = false; - WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) nativeWindow.getGraphicsConfiguration().getNativeGraphicsConfiguration(); + WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities capabilities = (GLCapabilities) config.getRequestedCapabilities(); boolean onscreen = capabilities.isOnscreen(); boolean usePBuffer = capabilities.isPBuffer(); GLProfile glProfile = capabilities.getGLProfile(); - long hdc = nativeWindow.getSurfaceHandle(); + long hdc = ns.getSurfaceHandle(); if (DEBUG) { Exception ex = new Exception("WindowsWGLGraphicsConfigurationFactory got HDC "+toHexString(hdc)); ex.printStackTrace(); - System.err.println("WindowsWGLGraphicsConfigurationFactory got NW "+nativeWindow); + System.err.println("WindowsWGLGraphicsConfigurationFactory got NW "+ns); } PIXELFORMATDESCRIPTOR pfd = null; |