From 018c7e8660dc0af68bd129be9af5094d04d0b431 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 6 Oct 2010 16:04:06 +0200 Subject: 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() --- src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java') diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java index c19871560..219d9f4dd 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.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 @@ -204,7 +205,7 @@ public abstract class GLContextImpl extends GLContext { if (contextHandle != 0) { int lockRes = drawable.lockSurface(); - if (NativeWindow.LOCK_SURFACE_NOT_READY == lockRes) { + if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) { // this would be odd .. throw new GLException("Surface not ready to lock: "+drawable); } @@ -231,7 +232,7 @@ public abstract class GLContextImpl extends GLContext { } int lockRes = drawable.lockSurface(); - if (NativeWindow.LOCK_SURFACE_NOT_READY == lockRes) { + if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) { // this would be odd .. throw new GLException("Surface not ready to lock"); } @@ -351,11 +352,11 @@ public abstract class GLContextImpl extends GLContext { boolean exceptionOccurred = false; int lockRes = drawable.lockSurface(); try { - if (NativeWindow.LOCK_SURFACE_NOT_READY == lockRes) { + if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) { return CONTEXT_NOT_CURRENT; } try { - if (NativeWindow.LOCK_SURFACE_CHANGED == lockRes) { + if (NativeSurface.LOCK_SURFACE_CHANGED == lockRes) { drawable.updateHandle(); } if (0 == drawable.getHandle()) { @@ -452,7 +453,7 @@ public abstract class GLContextImpl extends GLContext { protected final long createContextARB(long share, boolean direct, int major[], int minor[], int ctp[]) { - AbstractGraphicsConfiguration config = drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); + AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration().getNativeGraphicsConfiguration(); GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities(); GLProfile glp = glCaps.getGLProfile(); -- cgit v1.2.3