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() --- .../media/opengl/DefaultGLCapabilitiesChooser.java | 1 + .../javax/media/opengl/GLAnimatorControl.java | 8 +++---- .../classes/javax/media/opengl/GLArrayData.java | 27 ++++++++++++++++++++++ .../classes/javax/media/opengl/GLAutoDrawable.java | 6 ++--- src/jogl/classes/javax/media/opengl/GLBase.java | 27 +++++++++++++++++++++- .../classes/javax/media/opengl/GLCapabilities.java | 1 + .../javax/media/opengl/GLCapabilitiesChooser.java | 1 + src/jogl/classes/javax/media/opengl/GLContext.java | 1 + .../classes/javax/media/opengl/GLDrawable.java | 15 ++++++------ .../javax/media/opengl/GLDrawableFactory.java | 5 ++-- src/jogl/classes/javax/media/opengl/GLProfile.java | 1 + .../classes/javax/media/opengl/awt/GLCanvas.java | 4 ++-- .../classes/javax/media/opengl/awt/GLJPanel.java | 4 ++-- 13 files changed, 80 insertions(+), 21 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java index ee41c9161..dc6daa645 100644 --- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java +++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2003-2009 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 diff --git a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java index 13788fe53..3aba634a0 100644 --- a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java +++ b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java @@ -66,10 +66,7 @@ public interface GLAnimatorControl { /** - * @return Number of frames issued to all registered GLAutoDrawables registered - */ - /** - * @return Number of frame cycles displayed by all registered {@link javax.media.opengl.GLAutoDrawable} + * @return Number of frame cycles displayed * since the first display call, ie getStartTime(). * This value is reset if started or resumed. * @@ -78,6 +75,9 @@ public interface GLAnimatorControl { */ int getTotalFrames(); + /** Reset all performance counter (startTime, currentTime, frame number) */ + public void resetCounter(); + /** * Indicates whether this animator is currently running, ie started. * diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java index 088c71bd8..6c8122f27 100644 --- a/src/jogl/classes/javax/media/opengl/GLArrayData.java +++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java @@ -1,3 +1,30 @@ +/** + * Copyright 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 met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of JogAmp Community. + */ package javax.media.opengl; diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java index bc2f633ce..12ded8736 100644 --- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java +++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java @@ -56,7 +56,7 @@ import java.security.*; based rendering mechanism as well by end users directly.

The implementation shall initialize itself as soon as possible, - ie if the attached {@link javax.media.nativewindow.NativeWindow NativeWindow} is become visible. + ie if the attached {@link javax.media.nativewindow.NativeSurface NativeSurface} becomes visible/realized. The following protocol shall be satisfied: