From 5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 Mon Sep 17 00:00:00 2001
From: Harvey Harrison
Date: Thu, 17 Oct 2013 22:27:27 -0700
Subject: jogl: remove all trailing whitespace
Signed-off-by: Harvey Harrison
---
src/jogl/classes/jogamp/opengl/Debug.java | 20 +-
.../opengl/DesktopGLDynamicLibraryBundleInfo.java | 14 +-
.../opengl/DesktopGLDynamicLookupHelper.java | 10 +-
.../jogamp/opengl/ExtensionAvailabilityCache.java | 38 +--
src/jogl/classes/jogamp/opengl/FPSCounterImpl.java | 50 +--
.../classes/jogamp/opengl/GLAutoDrawableBase.java | 144 ++++----
.../classes/jogamp/opengl/GLBufferSizeTracker.java | 18 +-
.../jogamp/opengl/GLBufferStateTracker.java | 30 +-
src/jogl/classes/jogamp/opengl/GLContextImpl.java | 296 ++++++++---------
.../classes/jogamp/opengl/GLContextShareSet.java | 50 +--
.../jogamp/opengl/GLDebugMessageHandler.java | 126 +++----
.../jogamp/opengl/GLDrawableFactoryImpl.java | 58 ++--
.../classes/jogamp/opengl/GLDrawableHelper.java | 198 +++++------
src/jogl/classes/jogamp/opengl/GLDrawableImpl.java | 64 ++--
.../jogamp/opengl/GLDynamicLibraryBundleInfo.java | 18 +-
.../jogamp/opengl/GLDynamicLookupHelper.java | 10 +-
.../classes/jogamp/opengl/GLFBODrawableImpl.java | 142 ++++----
.../jogamp/opengl/GLGraphicsConfigurationUtil.java | 60 ++--
.../jogamp/opengl/GLOffscreenAutoDrawableImpl.java | 42 +--
src/jogl/classes/jogamp/opengl/GLPbufferImpl.java | 16 +-
src/jogl/classes/jogamp/opengl/GLRunnableTask.java | 28 +-
src/jogl/classes/jogamp/opengl/GLStateTracker.java | 52 +--
.../classes/jogamp/opengl/GLVersionNumber.java | 20 +-
src/jogl/classes/jogamp/opengl/GLWorkerThread.java | 24 +-
src/jogl/classes/jogamp/opengl/GLXExtensions.java | 4 +-
.../jogamp/opengl/ListenerSyncedImplStub.java | 12 +-
src/jogl/classes/jogamp/opengl/ProjectFloat.java | 120 +++----
.../jogamp/opengl/SharedResourceRunner.java | 44 +--
src/jogl/classes/jogamp/opengl/ThreadingImpl.java | 38 +--
.../jogamp/opengl/ToolkitThreadingPlugin.java | 16 +-
.../jogamp/opengl/awt/AWTThreadingPlugin.java | 16 +-
.../classes/jogamp/opengl/awt/AWTTilePainter.java | 74 ++---
src/jogl/classes/jogamp/opengl/awt/AWTUtil.java | 16 +-
src/jogl/classes/jogamp/opengl/awt/Java2D.java | 46 +--
.../classes/jogamp/opengl/awt/VersionApplet.java | 6 +-
.../egl/DesktopES2DynamicLibraryBundleInfo.java | 26 +-
src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 20 +-
.../classes/jogamp/opengl/egl/EGLDisplayUtil.java | 62 ++--
.../classes/jogamp/opengl/egl/EGLDrawable.java | 20 +-
.../jogamp/opengl/egl/EGLDrawableFactory.java | 136 ++++----
.../opengl/egl/EGLDummyUpstreamSurfaceHook.java | 12 +-
.../opengl/egl/EGLDynamicLibraryBundleInfo.java | 30 +-
.../opengl/egl/EGLES1DynamicLibraryBundleInfo.java | 28 +-
.../opengl/egl/EGLES2DynamicLibraryBundleInfo.java | 38 +--
.../opengl/egl/EGLGraphicsConfiguration.java | 58 ++--
.../egl/EGLGraphicsConfigurationFactory.java | 68 ++--
.../jogamp/opengl/egl/EGLOnscreenDrawable.java | 4 +-
.../jogamp/opengl/egl/EGLUpstreamSurfaceHook.java | 50 +--
.../jogamp/opengl/egl/EGLWrappedSurface.java | 10 +-
.../classes/jogamp/opengl/gl2/ProjectDouble.java | 92 +++---
.../classes/jogamp/opengl/glu/GLUquadricImpl.java | 82 ++---
src/jogl/classes/jogamp/opengl/glu/Glue.java | 16 +-
.../classes/jogamp/opengl/glu/error/Error.java | 16 +-
.../opengl/glu/gl2/nurbs/GL2CurveEvaluator.java | 2 +-
.../opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java | 38 +--
.../jogamp/opengl/glu/mipmap/BuildMipmap.java | 198 +++++------
.../classes/jogamp/opengl/glu/mipmap/Extract.java | 8 +-
.../jogamp/opengl/glu/mipmap/Extract1010102.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract1555rev.java | 24 +-
.../opengl/glu/mipmap/Extract2101010rev.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract233rev.java | 18 +-
.../jogamp/opengl/glu/mipmap/Extract332.java | 18 +-
.../jogamp/opengl/glu/mipmap/Extract4444.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract4444rev.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract5551.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract565.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract565rev.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract8888.java | 24 +-
.../jogamp/opengl/glu/mipmap/Extract8888rev.java | 24 +-
.../jogamp/opengl/glu/mipmap/ExtractFloat.java | 14 +-
.../jogamp/opengl/glu/mipmap/ExtractPrimitive.java | 8 +-
.../jogamp/opengl/glu/mipmap/ExtractSByte.java | 14 +-
.../jogamp/opengl/glu/mipmap/ExtractSInt.java | 14 +-
.../jogamp/opengl/glu/mipmap/ExtractSShort.java | 14 +-
.../jogamp/opengl/glu/mipmap/ExtractUByte.java | 14 +-
.../jogamp/opengl/glu/mipmap/ExtractUInt.java | 14 +-
.../jogamp/opengl/glu/mipmap/ExtractUShort.java | 14 +-
.../jogamp/opengl/glu/mipmap/HalveImage.java | 276 ++++++++--------
.../classes/jogamp/opengl/glu/mipmap/Image.java | 120 +++----
.../classes/jogamp/opengl/glu/mipmap/Mipmap.java | 200 +++++------
.../opengl/glu/mipmap/PixelStorageModes.java | 14 +-
.../jogamp/opengl/glu/mipmap/ScaleInternal.java | 364 ++++++++++-----------
.../jogamp/opengl/glu/mipmap/Type_Widget.java | 80 ++---
src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java | 18 +-
.../jogamp/opengl/glu/nurbs/ArcSdirSorter.java | 2 +-
.../jogamp/opengl/glu/nurbs/ArcTdirSorter.java | 2 +-
.../classes/jogamp/opengl/glu/nurbs/Backend.java | 2 +-
src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java | 2 +-
.../classes/jogamp/opengl/glu/nurbs/Breakpt.java | 4 +-
.../jogamp/opengl/glu/nurbs/CArrayOfArcs.java | 32 +-
.../jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java | 22 +-
.../jogamp/opengl/glu/nurbs/CArrayOfFloats.java | 32 +-
.../opengl/glu/nurbs/CArrayOfQuiltspecs.java | 28 +-
.../classes/jogamp/opengl/glu/nurbs/Curve.java | 6 +-
.../classes/jogamp/opengl/glu/nurbs/Flist.java | 6 +-
.../classes/jogamp/opengl/glu/nurbs/Knotspec.java | 20 +-
.../jogamp/opengl/glu/nurbs/Knotvector.java | 14 +-
.../classes/jogamp/opengl/glu/nurbs/Mapdesc.java | 12 +-
.../jogamp/opengl/glu/nurbs/O_nurbscurve.java | 2 +-
.../classes/jogamp/opengl/glu/nurbs/Patchlist.java | 2 +-
.../classes/jogamp/opengl/glu/nurbs/Property.java | 6 +-
.../jogamp/opengl/glu/nurbs/Renderhints.java | 2 +-
.../jogamp/opengl/glu/nurbs/Subdivider.java | 6 +-
.../jogamp/opengl/glu/nurbs/TrimVertex.java | 4 +-
.../jogamp/opengl/glu/registry/Registry.java | 14 +-
.../jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 144 ++++----
.../opengl/macosx/cgl/MacOSXCGLDrawable.java | 10 +-
.../macosx/cgl/MacOSXCGLDrawableFactory.java | 28 +-
.../cgl/MacOSXCGLDynamicLibraryBundleInfo.java | 18 +-
.../macosx/cgl/MacOSXCGLGraphicsConfiguration.java | 44 +--
.../cgl/MacOSXCGLGraphicsConfigurationFactory.java | 18 +-
.../macosx/cgl/MacOSXPbufferCGLDrawable.java | 4 +-
.../MacOSXAWTCGLGraphicsConfigurationFactory.java | 12 +-
.../classes/jogamp/opengl/util/GLArrayHandler.java | 24 +-
.../jogamp/opengl/util/GLArrayHandlerFlat.java | 14 +-
.../opengl/util/GLArrayHandlerInterleaved.java | 20 +-
.../jogamp/opengl/util/GLDataArrayHandler.java | 10 +-
.../jogamp/opengl/util/GLFixedArrayHandler.java | 16 +-
.../opengl/util/GLFixedArrayHandlerFlat.java | 8 +-
.../jogamp/opengl/util/GLVBOArrayHandler.java | 10 +-
.../jogamp/opengl/util/av/EGLMediaPlayerImpl.java | 46 +--
.../jogamp/opengl/util/av/GLMediaPlayerImpl.java | 284 ++++++++--------
.../jogamp/opengl/util/av/JavaSoundAudioSink.java | 70 ++--
.../jogamp/opengl/util/av/NullAudioSink.java | 54 +--
.../jogamp/opengl/util/av/NullGLMediaPlayer.java | 44 +--
.../av/impl/FFMPEGDynamicLibraryBundleInfo.java | 118 +++----
.../opengl/util/av/impl/FFMPEGMediaPlayer.java | 174 +++++-----
.../jogamp/opengl/util/av/impl/FFMPEGNatives.java | 92 +++---
.../opengl/util/av/impl/FFMPEGStaticNatives.java | 10 +-
.../opengl/util/av/impl/FFMPEGv08Natives.java | 10 +-
.../opengl/util/av/impl/FFMPEGv09Natives.java | 10 +-
.../opengl/util/av/impl/FFMPEGv10Natives.java | 10 +-
.../opengl/util/av/impl/OMXGLMediaPlayer.java | 48 +--
.../jogamp/opengl/util/glsl/GLSLArrayHandler.java | 24 +-
.../opengl/util/glsl/GLSLArrayHandlerFlat.java | 10 +-
.../util/glsl/GLSLArrayHandlerInterleaved.java | 18 +-
.../jogamp/opengl/util/glsl/GLSLTextureRaster.java | 70 ++--
.../opengl/util/glsl/fixedfunc/FixedFuncHook.java | 60 ++--
.../util/glsl/fixedfunc/FixedFuncPipeline.java | 236 ++++++-------
.../jogamp/opengl/util/jpeg/JPEGDecoder.java | 132 ++++----
.../jogamp/opengl/util/pngj/FilterType.java | 2 +-
.../classes/jogamp/opengl/util/pngj/ImageInfo.java | 2 +-
.../classes/jogamp/opengl/util/pngj/ImageLine.java | 30 +-
.../jogamp/opengl/util/pngj/ImageLineHelper.java | 8 +-
.../jogamp/opengl/util/pngj/ImageLines.java | 8 +-
.../jogamp/opengl/util/pngj/PngHelperInternal.java | 2 +-
.../classes/jogamp/opengl/util/pngj/PngReader.java | 56 ++--
.../classes/jogamp/opengl/util/pngj/PngWriter.java | 28 +-
.../jogamp/opengl/util/pngj/PngjException.java | 4 +-
.../opengl/util/pngj/PngjExceptionInternal.java | 4 +-
.../opengl/util/pngj/chunks/ChunkHelper.java | 14 +-
.../util/pngj/chunks/ChunkLoadBehaviour.java | 2 +-
.../opengl/util/pngj/chunks/ChunkPredicate.java | 2 +-
.../jogamp/opengl/util/pngj/chunks/ChunksList.java | 12 +-
.../util/pngj/chunks/ChunksListForWrite.java | 6 +-
.../jogamp/opengl/util/pngj/chunks/PngChunk.java | 2 +-
.../opengl/util/pngj/chunks/PngChunkBKGD.java | 6 +-
.../opengl/util/pngj/chunks/PngChunkMultiple.java | 4 +-
.../opengl/util/pngj/chunks/PngChunkSBIT.java | 2 +-
.../opengl/util/pngj/chunks/PngChunkTRNS.java | 2 +-
.../opengl/util/pngj/chunks/PngMetadata.java | 10 +-
.../opengl/windows/wgl/WGLGLCapabilities.java | 8 +-
.../classes/jogamp/opengl/windows/wgl/WGLUtil.java | 22 +-
.../windows/wgl/WindowsBitmapWGLDrawable.java | 4 +-
.../windows/wgl/WindowsExternalWGLContext.java | 2 +-
.../windows/wgl/WindowsPbufferWGLDrawable.java | 6 +-
.../opengl/windows/wgl/WindowsWGLContext.java | 10 +-
.../opengl/windows/wgl/WindowsWGLDrawable.java | 8 +-
.../windows/wgl/WindowsWGLDrawableFactory.java | 30 +-
.../wgl/WindowsWGLDynamicLibraryBundleInfo.java | 14 +-
.../wgl/WindowsWGLGraphicsConfiguration.java | 72 ++--
.../WindowsWGLGraphicsConfigurationFactory.java | 42 +--
.../WindowsAWTWGLGraphicsConfigurationFactory.java | 22 +-
.../classes/jogamp/opengl/x11/glx/GLXUtil.java | 44 +--
.../opengl/x11/glx/X11ExternalGLXContext.java | 6 +-
.../opengl/x11/glx/X11ExternalGLXDrawable.java | 2 +-
.../jogamp/opengl/x11/glx/X11GLXContext.java | 18 +-
.../opengl/x11/glx/X11GLXDrawableFactory.java | 30 +-
.../x11/glx/X11GLXDynamicLibraryBundleInfo.java | 22 +-
.../x11/glx/X11GLXGraphicsConfiguration.java | 60 ++--
.../glx/X11GLXGraphicsConfigurationFactory.java | 46 +--
181 files changed, 3591 insertions(+), 3591 deletions(-)
(limited to 'src/jogl/classes/jogamp/opengl')
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
index b88a09b71..74892d894 100644
--- a/src/jogl/classes/jogamp/opengl/Debug.java
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -51,14 +51,14 @@ public class Debug extends PropertyAccess {
// Some common properties
private static final boolean verbose;
private static final boolean debugAll;
-
+
static {
AccessController.doPrivileged(new PrivilegedAction
*/
protected final void defaultWindowDestroyNotifyOp() {
final NativeSurface ns = getNativeSurface();
@@ -243,22 +243,22 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
shallClose = WindowClosingMode.DISPOSE_ON_CLOSE == ((WindowClosingProtocol)ns).getDefaultCloseOperation();
} else {
shallClose = true;
- }
+ }
if( shallClose ) {
destroyAvoidAwareOfLocking();
- }
+ }
}
/**
- * Calls {@link #destroy()}
+ * Calls {@link #destroy()}
* directly if the following requirements are met:
*
- *
An {@link GLAnimatorControl} is bound (see {@link #getAnimator()}) and running on another thread.
+ *
An {@link GLAnimatorControl} is bound (see {@link #getAnimator()}) and running on another thread.
* Here we pause the animation while issuing the destruction.
*
Surface is not locked by another thread (considered anonymous).
*
*
- * Otherwise destroy is being flagged to be called within the next
+ * Otherwise destroy is being flagged to be called within the next
* call of display().
*
*
@@ -270,9 +270,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
*/
protected final void destroyAvoidAwareOfLocking() {
final NativeSurface ns = getNativeSurface();
-
+
final GLAnimatorControl ctrl = helper.getAnimator();
-
+
// Is an animator thread perform rendering?
if ( helper.isAnimatorStartedOnOtherThread() ) {
// Pause animations before initiating safe destroy.
@@ -292,7 +292,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
destroy();
}
}
-
+
/**
* Calls {@link #destroyImplInLock()} while claiming the lock.
*/
@@ -305,7 +305,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
lock.unlock();
}
}
-
+
/**
* Default implementation to destroys the drawable and context of this GLAutoDrawable:
*
@@ -323,7 +323,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
pullGLEventListenerState();
}
if( null != context ) {
- if( context.isCreated() ) {
+ if( context.isCreated() ) {
// Catch dispose GLExceptions by GLEventListener, just 'print' them
// so we can continue with the destruction.
try {
@@ -341,9 +341,9 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
if( ownsDevice ) {
device.close();
}
- }
+ }
}
-
+
public final void defaultSwapBuffers() throws GLException {
final RecursiveLock _lock = getLock();
_lock.lock();
@@ -359,7 +359,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
//
// GLAutoDrawable
//
-
+
protected final Runnable defaultInitAction = new Runnable() {
@Override
public final void run() {
@@ -397,7 +397,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
_lock.unlock();
}
}
-
+
protected final GLEventListener defaultDisposeGLEventListener(GLEventListener listener, boolean remove) {
final RecursiveLock _lock = getLock();
_lock.lock();
@@ -405,14 +405,14 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
return helper.disposeGLEventListener(GLAutoDrawableBase.this, drawable, context, listener, remove);
} finally {
_lock.unlock();
- }
+ }
}
-
+
@Override
public final GLDrawable getDelegatedDrawable() {
return drawable;
}
-
+
@Override
public final GLContext getContext() {
return context;
@@ -458,7 +458,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
@Override
public final void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
- helper.addGLEventListener(index, listener);
+ helper.addGLEventListener(index, listener);
}
@Override
@@ -480,21 +480,21 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
helper.setGLEventListenerInitState(listener, initialized);
}
-
+
@Override
public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
return defaultDisposeGLEventListener(listener, remove);
}
-
+
@Override
public final GLEventListener removeGLEventListener(GLEventListener listener) {
- return helper.removeGLEventListener(listener);
+ return helper.removeGLEventListener(listener);
}
-
+
@Override
public final void setAnimator(GLAnimatorControl animatorControl)
throws GLException {
- helper.setAnimator(animatorControl);
+ helper.setAnimator(animatorControl);
}
@Override
@@ -511,20 +511,20 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
public final Thread getExclusiveContextThread() {
return helper.getExclusiveContextThread();
}
-
+
@Override
public final boolean invoke(boolean wait, GLRunnable glRunnable) {
- return helper.invoke(this, wait, glRunnable);
+ return helper.invoke(this, wait, glRunnable);
}
@Override
public boolean invoke(final boolean wait, final List glRunnables) {
return helper.invoke(this, wait, glRunnables);
}
-
+
@Override
public final void setAutoSwapBufferMode(boolean enable) {
- helper.setAutoSwapBufferMode(enable);
+ helper.setAutoSwapBufferMode(enable);
}
@Override
@@ -534,7 +534,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
@Override
public final void setContextCreationFlags(int flags) {
- additionalCtxCreationFlags = flags;
+ additionalCtxCreationFlags = flags;
final GLContext _context = context;
if(null != _context) {
_context.setContextCreationFlags(additionalCtxCreationFlags);
@@ -549,7 +549,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
//
// FPSCounter
//
-
+
@Override
public final void setUpdateFPSFrames(int frames, PrintStream out) {
fpsCounter.setUpdateFPSFrames(frames, out);
@@ -599,11 +599,11 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
public final float getTotalFPS() {
return fpsCounter.getTotalFPS();
}
-
+
//
// GLDrawable delegation
//
-
+
@Override
public final GLContext createContext(final GLContext shareWith) {
final RecursiveLock lock = getLock();
@@ -624,10 +624,10 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
public final void setRealized(boolean realized) {
final RecursiveLock _lock = getLock();
_lock.lock();
- try {
+ try {
final GLDrawable _drawable = drawable;
if( null == _drawable || realized && ( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) ) {
- return;
+ return;
}
_drawable.setRealized(realized);
if( realized && _drawable.isRealized() ) {
@@ -637,7 +637,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
_lock.unlock();
}
}
-
+
@Override
public final boolean isRealized() {
final GLDrawable _drawable = drawable;
@@ -661,7 +661,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
final GLDrawable _drawable = drawable;
return null != _drawable ? _drawable.isGLOriented() : true;
}
-
+
@Override
public final GLCapabilitiesImmutable getChosenGLCapabilities() {
final GLDrawable _drawable = drawable;
@@ -685,7 +685,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
final GLDrawable _drawable = drawable;
return null != _drawable ? _drawable.getHandle() : 0;
}
-
+
protected static String getThreadName() { return Thread.currentThread().getName(); }
@Override
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
index 17646cc7b..73a864304 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferSizeTracker.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2006 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -93,7 +93,7 @@ public class GLBufferSizeTracker {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferSizeTracker", true);
}
-
+
// Map from buffer names to sizes.
// Note: should probably have some way of shrinking this map, but
// can't just make it a WeakHashMap because nobody holds on to the
@@ -102,7 +102,7 @@ public class GLBufferSizeTracker {
// pattern of buffer objects indicates that the fact that this map
// never shrinks is probably not that bad.
private IntLongHashMap bufferSizeMap;
-
+
public GLBufferSizeTracker() {
bufferSizeMap = new IntLongHashMap();
bufferSizeMap.setKeyNotFoundValue(0xFFFFFFFFFFFFFFFFL);
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index f14d16ec4..cd9eea287 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2006 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -50,7 +50,7 @@ import com.jogamp.common.util.IntIntHashMap;
* This class is used to verify that e.g. the vertex
* buffer object extension is in use when the glVertexPointer variant
* taking a long as argument is called.
- *
+ *
* Note that because the enumerated value used for the binding of a
* buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to
* query the binding using glGetIntegerv (e.g.
@@ -77,16 +77,16 @@ import com.jogamp.common.util.IntIntHashMap;
public class GLBufferStateTracker {
protected static final boolean DEBUG;
-
+
static {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
}
-
+
// Maps binding targets to buffer objects. A null value indicates
// that the binding is unknown. A zero value indicates that it is
- // known that no buffer is bound to the target, according to the
- // OpenGL specifications.
+ // known that no buffer is bound to the target, according to the
+ // OpenGL specifications.
// http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
private IntIntHashMap bindingMap;
@@ -108,7 +108,7 @@ public class GLBufferStateTracker {
public final void setBoundBufferObject(int target, int value) {
bindingMap.put(target, value);
if (DEBUG) {
- System.err.println("GLBufferStateTracker.setBoundBufferObject() target 0x" +
+ System.err.println("GLBufferStateTracker.setBoundBufferObject() target 0x" +
Integer.toHexString(target) + " -> mapped bound buffer 0x" +
Integer.toHexString(value));
// Thread.dumpStack();
@@ -146,7 +146,7 @@ public class GLBufferStateTracker {
value = 0;
}
if (DEBUG) {
- System.err.println("GLBufferStateTracker.getBoundBufferObject() glerr[pre 0x"+Integer.toHexString(glerrPre)+", post 0x"+Integer.toHexString(glerrPost)+"], [queried value]: target 0x" +
+ System.err.println("GLBufferStateTracker.getBoundBufferObject() glerr[pre 0x"+Integer.toHexString(glerrPre)+", post 0x"+Integer.toHexString(glerrPost)+"], [queried value]: target 0x" +
Integer.toHexString(target) + " / query 0x"+Integer.toHexString(queryTarget)+
" -> mapped bound buffer 0x" + Integer.toHexString(value));
}
@@ -156,7 +156,7 @@ public class GLBufferStateTracker {
return 0;
}
if (DEBUG) {
- System.err.println("GLBufferStateTracker.getBoundBufferObject() [mapped value]: target 0x" +
+ System.err.println("GLBufferStateTracker.getBoundBufferObject() [mapped value]: target 0x" +
Integer.toHexString(target) + " -> mapped bound buffer 0x" +
Integer.toHexString(value));
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 7f9f20a21..7c3a5922b 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -106,14 +106,14 @@ public abstract class GLContextImpl extends GLContext {
private final GLStateTracker glStateTracker = new GLStateTracker();
private GLDebugMessageHandler glDebugHandler = null;
private final int[] boundFBOTarget = new int[] { 0, 0 }; // { draw, read }
- private int defaultVAO = 0;
-
+ private int defaultVAO = 0;
+
protected GLDrawableImpl drawable;
protected GLDrawableImpl drawableRead;
-
+
private volatile boolean pixelDataEvaluated;
private int /* pixelDataInternalFormat, */ pixelDataFormat, pixelDataType;
-
+
protected GL gl;
protected static final Object mappedContextTypeObjectLock;
@@ -161,7 +161,7 @@ public abstract class GLContextImpl extends GLContext {
glStateTracker.setEnabled(false);
glStateTracker.clearStates();
}
-
+
@Override
protected void resetStates(boolean isInit) {
if( !isInit ) {
@@ -177,12 +177,12 @@ public abstract class GLContextImpl extends GLContext {
glRenderer = glVendor;
glRendererLowerCase = glRenderer;
glVersion = glVendor;
-
+
if (boundFBOTarget != null) { //
boundFBOTarget[0] = 0; // draw
boundFBOTarget[1] = 0; // read
}
-
+
pixelDataEvaluated = false;
super.resetStates(isInit);
@@ -190,7 +190,7 @@ public abstract class GLContextImpl extends GLContext {
@Override
public final GLDrawable setGLReadDrawable(GLDrawable read) {
- if(!isGLReadDrawableAvailable()) {
+ if(!isGLReadDrawableAvailable()) {
throw new GLException("Setting read drawable feature not available");
}
final boolean lockHeld = lock.isOwner(Thread.currentThread());
@@ -220,7 +220,7 @@ public abstract class GLContextImpl extends GLContext {
final Thread currentThread = Thread.currentThread();
if( lock.isLockedByOtherThread() ) {
throw new GLException("GLContext current by other thread "+lock.getOwner().getName()+", operation not allowed on this thread "+currentThread.getName());
- }
+ }
final boolean lockHeld = lock.isOwner(currentThread);
if( lockHeld && lock.getHoldCount() > 1 ) {
// would need to makeCurrent * holdCount
@@ -272,7 +272,7 @@ public abstract class GLContextImpl extends GLContext {
}
return _gl;
}
-
+
@Override
public final GL getGL() {
return gl;
@@ -314,7 +314,7 @@ public abstract class GLContextImpl extends GLContext {
@Override
public void release() throws GLException {
release(false);
- }
+ }
private void release(boolean inDestruction) throws GLException {
if( TRACE_SWITCH ) {
System.err.println(getThreadName() +": GLContext.ContextSwitch[release.0]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+", inDestruction: "+inDestruction+", "+lock);
@@ -332,7 +332,7 @@ public abstract class GLContextImpl extends GLContext {
}
throw new GLException(msg);
}
-
+
Throwable drawableContextMadeCurrentException = null;
final boolean actualRelease = ( inDestruction || lock.getHoldCount() == 1 ) && 0 != contextHandle;
try {
@@ -365,7 +365,7 @@ public abstract class GLContextImpl extends GLContext {
if(null != drawableContextMadeCurrentException) {
throw new GLException("GLContext.release(false) during GLDrawableImpl.contextMadeCurrent(this, false)", drawableContextMadeCurrentException);
}
-
+
}
private Throwable lastCtxReleaseStack = null;
protected abstract void releaseImpl() throws GLException;
@@ -518,21 +518,21 @@ public abstract class GLContextImpl extends GLContext {
public final int makeCurrent() throws GLException {
return makeCurrent(false);
}
-
+
protected final int makeCurrent(boolean forceDrawableAssociation) throws GLException {
if( TRACE_SWITCH ) {
System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.0]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - "+lock);
- }
+ }
// Note: the surface is locked within [makeCurrent .. swap .. release]
final int lockRes = drawable.lockSurface();
if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockRes) {
if( DEBUG_TRACE_SWITCH ) {
- System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X1]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - Surface Not Ready - CONTEXT_NOT_CURRENT - "+lock);
+ System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X1]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - Surface Not Ready - CONTEXT_NOT_CURRENT - "+lock);
}
return CONTEXT_NOT_CURRENT;
}
-
+
boolean unlockResources = true; // Must be cleared if successful, otherwise finally block will release context and/or surface!
int res = CONTEXT_NOT_CURRENT;
try {
@@ -552,7 +552,7 @@ public abstract class GLContextImpl extends GLContext {
drawableUpdatedNotify();
unlockResources = false; // success
if( TRACE_SWITCH ) {
- System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X2]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - keep - CONTEXT_CURRENT - "+lock);
+ System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X2]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - keep - CONTEXT_CURRENT - "+lock);
}
return CONTEXT_CURRENT;
} else {
@@ -561,7 +561,7 @@ public abstract class GLContextImpl extends GLContext {
}
res = makeCurrentWithinLock(lockRes);
unlockResources = CONTEXT_NOT_CURRENT == res; // success ?
-
+
/**
* FIXME: refactor dependence on Java 2D / JOGL bridge
if ( tracker != null && res == CONTEXT_CURRENT_NEW ) {
@@ -608,16 +608,16 @@ public abstract class GLContextImpl extends GLContext {
if(TRACE_GL) {
gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, gl, new Object[] { System.err } ) );
}
-
+
forceDrawableAssociation = true;
}
-
+
if( forceDrawableAssociation ) {
associateDrawable(true);
}
-
+
contextMadeCurrent(true);
-
+
/* FIXME: refactor dependence on Java 2D / JOGL bridge
// Try cleaning up any stale server-side OpenGL objects
@@ -629,10 +629,10 @@ public abstract class GLContextImpl extends GLContext {
}
if( TRACE_SWITCH ) {
System.err.println(getThreadName() +": GLContext.ContextSwitch[makeCurrent.X3]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+" - switch - "+makeCurrentResultToString(res)+" - stateTracker.on "+glStateTracker.isEnabled()+" - "+lock);
- }
+ }
return res;
}
-
+
private final int makeCurrentWithinLock(int surfaceLockRes) throws GLException {
if (!isCreated()) {
if( 0 >= drawable.getWidth() || 0 >= drawable.getHeight() ) {
@@ -683,7 +683,7 @@ public abstract class GLContextImpl extends GLContext {
final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
final AbstractGraphicsDevice device = config.getScreen().getDevice();
- // Non ARB desktop profiles may not have been registered
+ // Non ARB desktop profiles may not have been registered
if( !GLContext.getAvailableGLVersionsSet(device) ) { // not yet set
if( 0 == ( ctxOptions & GLContext.CTX_PROFILE_ES) ) { // not ES profile
final int reqMajor;
@@ -701,10 +701,10 @@ public abstract class GLContextImpl extends GLContext {
GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile,
ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
GLContext.setAvailableGLVersionsSet(device);
-
+
if (DEBUG) {
System.err.println(getThreadName() + ": createContextOLD-MapVersionsAvailable HAVE: " + device+" -> "+reqMajor+"."+reqProfile+ " -> "+getGLVersion());
- }
+ }
}
}
}
@@ -717,17 +717,17 @@ public abstract class GLContextImpl extends GLContext {
protected abstract void makeCurrentImpl() throws GLException;
/**
- * Calls {@link GLDrawableImpl#associateContext(GLContext, boolean)}
- */
- protected void associateDrawable(boolean bound) {
- drawable.associateContext(this, bound);
+ * Calls {@link GLDrawableImpl#associateContext(GLContext, boolean)}
+ */
+ protected void associateDrawable(boolean bound) {
+ drawable.associateContext(this, bound);
}
-
+
/**
- * Calls {@link GLDrawableImpl#contextMadeCurrent(GLContext, boolean)}
- */
+ * Calls {@link GLDrawableImpl#contextMadeCurrent(GLContext, boolean)}
+ */
protected void contextMadeCurrent(boolean current) {
- drawable.contextMadeCurrent(this, current);
+ drawable.contextMadeCurrent(this, current);
}
/**
@@ -827,7 +827,7 @@ public abstract class GLContextImpl extends GLContext {
final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
final int[] reqMajorCTP = new int[] { 0, 0 };
getRequestMajorAndCompat(glCaps.getGLProfile(), reqMajorCTP);
-
+
int _major[] = { 0 };
int _minor[] = { 0 };
int _ctp[] = { 0 };
@@ -842,7 +842,7 @@ public abstract class GLContextImpl extends GLContext {
}
return _ctx;
}
-
+
private final boolean mapGLVersions(AbstractGraphicsDevice device) {
synchronized (GLContext.deviceVersionAvailable) {
final long t0 = ( DEBUG ) ? System.nanoTime() : 0;
@@ -854,7 +854,7 @@ public abstract class GLContextImpl extends GLContext {
boolean hasGL4 = false;
boolean hasGL3 = false;
boolean hasES3 = false;
-
+
// Even w/ PROFILE_ALIASING, try to use true core GL profiles
// ensuring proper user behavior across platforms due to different feature sets!
//
@@ -863,7 +863,7 @@ public abstract class GLContextImpl extends GLContext {
success |= hasGL4;
if(hasGL4) {
// Map all lower compatible profiles: GL3
- GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+ GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
if(PROFILE_ALIASING) {
hasGL3 = true;
}
@@ -874,7 +874,7 @@ public abstract class GLContextImpl extends GLContext {
hasGL3 = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE); // GL3
success |= hasGL3;
if(hasGL3) {
- resetStates(false); // clean this context states, since creation was temporary
+ resetStates(false); // clean this context states, since creation was temporary
}
}
if(!hasGL4bc) {
@@ -919,14 +919,14 @@ public abstract class GLContextImpl extends GLContext {
hasGL2 = createContextARBMapVersionsAvailable(2, CTX_PROFILE_COMPAT); // GL2
success |= hasGL2;
if(hasGL2) {
- resetStates(false); // clean this context states, since creation was temporary
+ resetStates(false); // clean this context states, since creation was temporary
}
}
if(!hasES3) {
hasES3 = createContextARBMapVersionsAvailable(3, CTX_PROFILE_ES); // ES3
success |= hasES3;
if(hasES3) {
- resetStates(false); // clean this context states, since creation was temporary
+ resetStates(false); // clean this context states, since creation was temporary
}
}
if(success) {
@@ -935,7 +935,7 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG) {
final long t1 = System.nanoTime();
System.err.println("GLContextImpl.mapGLVersions: "+device+", profileAliasing: "+PROFILE_ALIASING+", total "+(t1-t0)/1e6 +"ms");
- System.err.println(GLContext.dumpAvailableGLVersions(null).toString());
+ System.err.println(GLContext.dumpAvailableGLVersions(null).toString());
}
} else if (DEBUG) {
System.err.println(getThreadName() + ": createContextARB-MapVersions NONE for :"+device);
@@ -944,9 +944,9 @@ public abstract class GLContextImpl extends GLContext {
}
}
- /**
+ /**
* Note: Since context creation is temporary, caller need to issue {@link #resetStates(boolean)}, if creation was successful, i.e. returns true.
- * This method does not reset the states, allowing the caller to utilize the state variables.
+ * This method does not reset the states, allowing the caller to utilize the state variables.
**/
private final boolean createContextARBMapVersionsAvailable(int reqMajor, int reqProfile) {
long _context;
@@ -1059,7 +1059,7 @@ public abstract class GLContextImpl extends GLContext {
if ( 0 == ctp ) {
throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
}
-
+
if (!GLContext.isValidGLVersion(ctp, major, minor)) {
throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
}
@@ -1080,10 +1080,10 @@ public abstract class GLContextImpl extends GLContext {
if( ctxGLSLVersion.isZero() ) {
ctxGLSLVersion = getStaticGLSLVersionNumber(major, minor, ctxOptions);
}
- }
+ }
}
}
-
+
//----------------------------------------------------------------------
// Helpers for various context implementations
//
@@ -1107,8 +1107,8 @@ public abstract class GLContextImpl extends GLContext {
*/
return gl;
}
-
- /**
+
+ /**
* Finalizes GL instance initialization after this context has been initialized.
*
* Method calls 'void finalizeInit()' of instance 'gl' as retrieved by reflection, if exist.
@@ -1138,7 +1138,7 @@ public abstract class GLContextImpl extends GLContext {
* ie for GLXExt, EGLExt, ..
*/
public abstract ProcAddressTable getPlatformExtProcAddressTable();
-
+
/**
* Part of GL_NV_vertex_array_range.
*
@@ -1154,7 +1154,7 @@ public abstract class GLContextImpl extends GLContext {
* Provides platform-independent access to the wglFreeMemoryNV /
* glXFreeMemoryNV.
*
- */
+ */
public abstract void glFreeMemoryNV(ByteBuffer pointer);
/** Maps the given "platform-independent" function name to a real function
@@ -1195,7 +1195,7 @@ public abstract class GLContextImpl extends GLContext {
}
} );
}
-
+
private final boolean initGLRendererAndGLVersionStrings() {
final GLDynamicLookupHelper glDynLookupHelper = getDrawableImpl().getGLDynamicLookupHelper();
final long _glGetString = glDynLookupHelper.dynamicLookupFunction("glGetString");
@@ -1215,7 +1215,7 @@ public abstract class GLContextImpl extends GLContext {
return false;
}
glVendor = _glVendor;
-
+
final String _glRenderer = glGetStringInt(GL.GL_RENDERER, _glGetString);
if(null == _glRenderer) {
if(DEBUG) {
@@ -1226,7 +1226,7 @@ public abstract class GLContextImpl extends GLContext {
}
glRenderer = _glRenderer;
glRendererLowerCase = glRenderer.toLowerCase();
-
+
final String _glVersion = glGetStringInt(GL.GL_VERSION, _glGetString);
if(null == _glVersion) {
// FIXME
@@ -1237,7 +1237,7 @@ public abstract class GLContextImpl extends GLContext {
return false;
}
glVersion = _glVersion;
-
+
return true;
}
}
@@ -1251,7 +1251,7 @@ public abstract class GLContextImpl extends GLContext {
minor[0] = 0;
}
}
-
+
/**
* Returns null if version string is invalid, otherwise a valid instance.
*
@@ -1278,7 +1278,7 @@ public abstract class GLContextImpl extends GLContext {
* version for given arrays.
*
* If the GL query fails, major will be zero.
- *
+ *
*
* Note: Non ARB ctx is limited to GL 3.0.
*
@@ -1292,20 +1292,20 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG) {
Thread.dumpStack();
}
- return false;
+ return false;
} else {
glGetIntegervInt(GL2GL3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
glGetIntegervInt(GL2GL3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
limitNonARBContextVersion(glIntMajor, glIntMinor, ctp);
- return true;
+ return true;
}
}
-
+
protected final int getCtxOptions() {
return ctxOptions;
}
-
+
/**
* Sets the OpenGL implementation class and
* the cache of which GL functions are available for calling through this
@@ -1325,8 +1325,8 @@ public abstract class GLContextImpl extends GLContext {
*
be greater or equal than the requested major.minor version, and
*
match the ctxProfileBits
*
, otherwise method aborts and returns false.
- * @return returns true if successful, otherwise false. See strictMatch.
- * If false is returned, no data has been cached or mapped, i.e. ProcAddressTable, Extensions, Version, etc.
+ * @return returns true if successful, otherwise false. See strictMatch.
+ * If false is returned, no data has been cached or mapped, i.e. ProcAddressTable, Extensions, Version, etc.
* @see #setContextVersion
* @see javax.media.opengl.GLContext#CTX_OPTION_ANY
* @see javax.media.opengl.GLContext#CTX_PROFILE_COMPAT
@@ -1340,7 +1340,7 @@ public abstract class GLContextImpl extends GLContext {
if ( 0 < major && !GLContext.isValidGLVersion(ctxProfileBits, major, minor) ) {
throw new GLException("Invalid GL Version Request "+GLContext.getGLVersion(major, minor, ctxProfileBits, null));
}
-
+
if(null==this.gl || !verifyInstance(gl.getGLProfile(), "Impl", this.gl)) {
setGL( createGL( getGLDrawable().getGLProfile() ) );
}
@@ -1348,7 +1348,7 @@ public abstract class GLContextImpl extends GLContext {
final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration();
final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice();
-
+
{
final boolean initGLRendererAndGLVersionStringsOK = initGLRendererAndGLVersionStrings();
if( !initGLRendererAndGLVersionStringsOK ) {
@@ -1367,7 +1367,7 @@ public abstract class GLContextImpl extends GLContext {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Given "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, glVersion));
}
}
-
+
//
// Validate GL version either by GL-Integer or GL-String
//
@@ -1377,8 +1377,8 @@ public abstract class GLContextImpl extends GLContext {
boolean versionValidated = false;
boolean versionGL3IntFailed = false;
{
- // Validate the requested version w/ the GL-version from an integer query.
- final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 };
+ // Validate the requested version w/ the GL-version from an integer query.
+ final int[] glIntMajor = new int[] { 0 }, glIntMinor = new int[] { 0 };
final boolean getGLIntVersionOK = getGLIntVersion(glIntMajor, glIntMinor, ctxProfileBits);
if( !getGLIntVersionOK ) {
final String errMsg = "Fetching GL Integer Version failed. "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null);
@@ -1392,14 +1392,14 @@ public abstract class GLContextImpl extends GLContext {
// unusable GL context - non query mode - hard fail!
throw new GLException(errMsg);
}
- }
+ }
if (DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (Int): "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
}
-
+
// Only validate if a valid int version was fetched, otherwise cont. w/ version-string method -> 3.0 > Version || Version > MAX!
if ( GLContext.isValidGLVersion(ctxProfileBits, glIntMajor[0], glIntMinor[0]) ) {
- if( glIntMajor[0] "+glVersion+", "+glIntMajor[0]+"."+glIntMinor[0]);
@@ -1415,13 +1415,13 @@ public abstract class GLContextImpl extends GLContext {
}
}
if( !versionValidated ) {
- // Validate the requested version w/ the GL-version from the version string.
+ // Validate the requested version w/ the GL-version from the version string.
final VersionNumber setGLVersionNumber = new VersionNumber(major, minor, 0);
final VersionNumber strGLVersionNumber = getGLVersionNumber(ctxProfileBits, glVersion);
if (DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: version verification (String): "+glVersion+", "+strGLVersionNumber);
}
-
+
// Only validate if a valid string version was fetched -> MIN > Version || Version > MAX!
if( null != strGLVersionNumber ) {
if( strGLVersionNumber.compareTo(setGLVersionNumber) < 0 || 0 == major ) {
@@ -1438,7 +1438,7 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL3 version Int failed, String: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+strGLVersionNumber);
}
- return false;
+ return false;
}
versionValidated = true;
}
@@ -1447,27 +1447,27 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, No GL version validation possible: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion);
}
- return false;
+ return false;
}
if (DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: post version verification "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntFailed "+versionGL3IntFailed);
}
-
+
if( 2 > major ) { // there is no ES2/3-compat for a profile w/ major < 2
ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT ) ;
}
-
+
final VersionNumberString vendorVersion = GLVersionNumber.createVendorVersion(glVersion);
-
+
setRendererQuirks(adevice, major, minor, ctxProfileBits, vendorVersion);
-
+
if( strictMatch && glRendererQuirks.exist(GLRendererQuirks.GLNonCompliant) ) {
if(DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL is not compliant: "+GLContext.getGLVersion(major, minor, ctxProfileBits, glVersion)+", "+glRenderer);
}
return false;
}
-
+
if(!isCurrentContextHardwareRasterizer()) {
ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT;
}
@@ -1529,7 +1529,7 @@ public abstract class GLContextImpl extends GLContext {
}
}
}
-
+
if( 0 != ( CTX_PROFILE_ES & ctxProfileBits ) ) {
if( major >= 3 ) {
ctxProfileBits |= CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ;
@@ -1550,45 +1550,45 @@ public abstract class GLContextImpl extends GLContext {
} else if( hasFBOImpl(major, ctxProfileBits, extensionAvailability) ) {
ctxProfileBits |= CTX_IMPL_FBO;
}
-
+
if( ( 0 != ( CTX_PROFILE_ES & ctxProfileBits ) && major == 1 ) || isExtensionAvailable(GLExtensions.OES_single_precision) ) {
ctxProfileBits |= CTX_IMPL_FP32_COMPAT_API;
}
-
+
if(FORCE_NO_FBO_SUPPORT) {
ctxProfileBits &= ~CTX_IMPL_FBO ;
- }
-
+ }
+
//
// Set GL Version (complete w/ version string)
//
setContextVersion(major, minor, ctxProfileBits, vendorVersion, true);
-
+
finalizeInit(gl);
-
+
setDefaultSwapInterval();
-
+
final int glErrX = gl.glGetError(); // clear GL error, maybe caused by above operations
-
+
if(DEBUG) {
System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: OK "+contextFQN+" - "+GLContext.getGLVersion(ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions, null)+" - glErr "+toHexString(glErrX));
}
return true;
}
-
+
private final void setRendererQuirks(final AbstractGraphicsDevice adevice, int major, int minor, int ctp, final VersionNumberString vendorVersion) {
int[] quirks = new int[GLRendererQuirks.COUNT + 1]; // + 1 ( NoFullFBOSupport )
int i = 0;
-
+
final String MesaSP = "Mesa ";
- // final String MesaRendererAMDsp = " AMD ";
- // final String MesaRendererIntelsp = "Intel(R)";
+ // final String MesaRendererAMDsp = " AMD ";
+ // final String MesaRendererIntelsp = "Intel(R)";
final boolean hwAccel = 0 == ( ctp & GLContext.CTX_IMPL_ACCEL_SOFT );
final boolean compatCtx = 0 != ( ctp & GLContext.CTX_PROFILE_COMPAT );
final boolean isDriverMesa = glRenderer.contains(MesaSP) || glRenderer.contains("Gallium ");
final boolean isDriverATICatalyst = !isDriverMesa && ( glVendor.contains("ATI Technologies") || glRenderer.startsWith("ATI ") );
final boolean isDriverNVIDIAGeForce = !isDriverMesa && ( glVendor.contains("NVIDIA Corporation") || glRenderer.contains("NVIDIA ") );
-
+
//
// OS related quirks
//
@@ -1603,7 +1603,7 @@ public abstract class GLContextImpl extends GLContext {
}
quirks[i++] = quirk;
}
-
+
if( isDriverNVIDIAGeForce ) {
final VersionNumber osxVersionNVFlushClean = new VersionNumber(10,7,3); // < OSX 10.7.3 w/ NV needs glFlush
if( Platform.getOSVersionNumber().compareTo(osxVersionNVFlushClean) < 0 ) {
@@ -1622,7 +1622,7 @@ public abstract class GLContextImpl extends GLContext {
quirks[i++] = quirk;
}
}
- } else if( Platform.getOSType() == Platform.OSType.WINDOWS ) {
+ } else if( Platform.getOSType() == Platform.OSType.WINDOWS ) {
//
// WINDOWS
//
@@ -1633,28 +1633,28 @@ public abstract class GLContextImpl extends GLContext {
}
quirks[i++] = quirk;
}
-
+
if( isDriverATICatalyst ) {
- final VersionNumber winXPVersionNumber = new VersionNumber ( 5, 1, 0);
- final VersionNumber amdSafeMobilityVersion = new VersionNumber(12, 102, 3);
-
+ final VersionNumber winXPVersionNumber = new VersionNumber ( 5, 1, 0);
+ final VersionNumber amdSafeMobilityVersion = new VersionNumber(12, 102, 3);
+
if ( vendorVersion.compareTo(amdSafeMobilityVersion) < 0 ) { // includes: vendorVersion.isZero()
final int quirk = GLRendererQuirks.NeedCurrCtx4ARBCreateContext;
if(DEBUG) {
System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", [Vendor "+glVendor+" or Renderer "+glRenderer+"], driverVersion "+vendorVersion);
}
- quirks[i++] = quirk;
+ quirks[i++] = quirk;
}
-
+
if( Platform.getOSVersionNumber().compareTo(winXPVersionNumber) <= 0 ) {
final int quirk = GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries;
if(DEBUG) {
System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS-Version "+Platform.getOSType()+" "+Platform.getOSVersionNumber()+", [Vendor "+glVendor+" or Renderer "+glRenderer+"]");
}
- quirks[i++] = quirk;
+ quirks[i++] = quirk;
}
}
- } else if( Platform.OSType.ANDROID == Platform.getOSType() ) {
+ } else if( Platform.OSType.ANDROID == Platform.getOSType() ) {
//
// ANDROID
//
@@ -1667,7 +1667,7 @@ public abstract class GLContextImpl extends GLContext {
quirks[i++] = quirk;
}
}
-
+
//
// Windowing Toolkit related quirks
//
@@ -1704,8 +1704,8 @@ public abstract class GLContextImpl extends GLContext {
}
}
}
-
-
+
+
//
// RENDERER related quirks
//
@@ -1735,8 +1735,8 @@ public abstract class GLContextImpl extends GLContext {
}
if( Platform.getOSType() == Platform.OSType.WINDOWS && glRenderer.contains("SVGA3D") )
{
- final VersionNumber mesaSafeFBOVersion = new VersionNumber(8, 0, 0);
- if ( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // includes: vendorVersion.isZero()
+ final VersionNumber mesaSafeFBOVersion = new VersionNumber(8, 0, 0);
+ if ( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // includes: vendorVersion.isZero()
final int quirk = GLRendererQuirks.NoFullFBOSupport;
if(DEBUG) {
System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType() + " / Renderer " + glRenderer + " / Mesa-Version "+vendorVersion);
@@ -1745,7 +1745,7 @@ public abstract class GLContextImpl extends GLContext {
}
}
}
-
+
//
// Property related quirks
//
@@ -1754,28 +1754,28 @@ public abstract class GLContextImpl extends GLContext {
if(DEBUG) {
System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: property");
}
- quirks[i++] = quirk;
+ quirks[i++] = quirk;
}
-
+
glRendererQuirks = new GLRendererQuirks(quirks, 0, i);
}
-
+
private static final boolean hasFBOImpl(int major, int ctp, ExtensionAvailabilityCache extCache) {
return ( 0 != (ctp & CTX_PROFILE_ES) && major >= 2 ) || // ES >= 2.0
-
- major >= 3 || // any >= 3.0 GL ctx
-
+
+ major >= 3 || // any >= 3.0 GL ctx
+
( null != extCache &&
-
+
extCache.isExtensionAvailable(GLExtensions.ARB_ES2_compatibility) || // ES 2.0 compatible
-
+
extCache.isExtensionAvailable(GLExtensions.ARB_framebuffer_object) || // ARB_framebuffer_object
-
+
extCache.isExtensionAvailable(GLExtensions.EXT_framebuffer_object) || // EXT_framebuffer_object
-
- extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object) ) ; // OES_framebuffer_object excluded
+
+ extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object) ) ; // OES_framebuffer_object excluded
}
-
+
private final void removeCachedVersion(int major, int minor, int ctxProfileBits) {
if(!isCurrentContextHardwareRasterizer()) {
ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT;
@@ -1932,7 +1932,7 @@ public abstract class GLContextImpl extends GLContext {
evalPixelDataType();
return pixelDataFormat;
}
-
+
private final void evalPixelDataType() {
if(!pixelDataEvaluated) {
synchronized(this) {
@@ -1946,14 +1946,14 @@ public abstract class GLContextImpl extends GLContext {
} else */ if( isGLES2Compatible() || isExtensionAvailable(GLExtensions.OES_read_format) ) {
final int[] glImplColorReadVals = new int[] { 0, 0 };
gl.glGetIntegerv(GL.GL_IMPLEMENTATION_COLOR_READ_FORMAT, glImplColorReadVals, 0);
- gl.glGetIntegerv(GL.GL_IMPLEMENTATION_COLOR_READ_TYPE, glImplColorReadVals, 1);
+ gl.glGetIntegerv(GL.GL_IMPLEMENTATION_COLOR_READ_TYPE, glImplColorReadVals, 1);
// pixelDataInternalFormat = (4 == components) ? GL.GL_RGBA : GL.GL_RGB;
pixelDataFormat = glImplColorReadVals[0];
pixelDataType = glImplColorReadVals[1];
ok = 0 != pixelDataFormat && 0 != pixelDataType;
}
if( !ok ) {
- // RGBA read is safe for all GL profiles
+ // RGBA read is safe for all GL profiles
// pixelDataInternalFormat = (4 == components) ? GL.GL_RGBA : GL.GL_RGB;
pixelDataFormat=GL.GL_RGBA;
pixelDataType = GL.GL_UNSIGNED_BYTE;
@@ -1984,54 +1984,54 @@ public abstract class GLContextImpl extends GLContext {
public final GLStateTracker getGLStateTracker() {
return glStateTracker;
}
-
+
//---------------------------------------------------------------------------
// Helpers for context optimization where the last context is left
// current on the OpenGL worker thread
//
- /**
+ /**
* Returns true if the given thread is owner, otherwise false.
*
* Method exists merely for code validation of {@link #isCurrent()}.
- *
+ *
*/
public final boolean isOwner(Thread thread) {
return lock.isOwner(thread);
}
-
- /**
+
+ /**
* Returns true if there are other threads waiting for this GLContext to {@link #makeCurrent()}, otherwise false.
*
* Since method does not perform any synchronization, accurate result are returned if lock is hold - only.
- *
+ *
*/
public final boolean hasWaiters() {
return lock.getQueueLength()>0;
}
-
- /**
+
+ /**
* Returns the number of hold locks. See {@link RecursiveLock#getHoldCount()} for semantics.
*
* Since method does not perform any synchronization, accurate result are returned if lock is hold - only.
- *
+ *
*/
public final int getLockCount() {
return lock.getHoldCount();
}
-
+
//---------------------------------------------------------------------------
// Special FBO hook
//
-
+
/**
* Tracks {@link GL#GL_FRAMEBUFFER}, {@link GL2GL3#GL_DRAW_FRAMEBUFFER} and {@link GL2GL3#GL_READ_FRAMEBUFFER}
* to be returned via {@link #getBoundFramebuffer(int)}.
- *
+ *
*
Invoked by {@link GL#glBindFramebuffer(int, int)}.
- *
- *
Assumes valid framebufferName range of [0..{@link Integer#MAX_VALUE}]
- *
+ *
+ *
Assumes valid framebufferName range of [0..{@link Integer#MAX_VALUE}]
+ *
*
Does not throw an exception if target is unknown or framebufferName invalid.
*/
public final void setBoundFramebuffer(int target, int framebufferName) {
@@ -2064,14 +2064,14 @@ public abstract class GLContextImpl extends GLContext {
throw new InternalError("Invalid FBO target name: "+toHexString(target));
}
}
-
+
@Override
- public final int getDefaultDrawFramebuffer() { return drawable.getDefaultDrawFramebuffer(); }
+ public final int getDefaultDrawFramebuffer() { return drawable.getDefaultDrawFramebuffer(); }
@Override
- public final int getDefaultReadFramebuffer() { return drawable.getDefaultReadFramebuffer(); }
+ public final int getDefaultReadFramebuffer() { return drawable.getDefaultReadFramebuffer(); }
@Override
public final int getDefaultReadBuffer() { return drawable.getDefaultReadBuffer(gl); }
-
+
//---------------------------------------------------------------------------
// GL_ARB_debug_output, GL_AMD_debug_output helpers
//
@@ -2090,7 +2090,7 @@ public abstract class GLContextImpl extends GLContext {
public final int getContextCreationFlags() {
return additionalCtxCreationFlags;
}
-
+
@Override
public final void setContextCreationFlags(int flags) {
if(!isCreated()) {
@@ -2160,7 +2160,7 @@ public abstract class GLContextImpl extends GLContext {
/** Internal bootstraping glGetString(GL_RENDERER) */
private static native String glGetStringInt(int name, long procAddress);
-
+
/** Internal bootstraping glGetIntegerv(..) for version */
private static native void glGetIntegervInt(int pname, int[] params, int params_offset, long procAddress);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
index b7acc0dff..70ade34b7 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2011 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:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -55,7 +55,7 @@ import javax.media.opengl.GLException;
public class GLContextShareSet {
private static final boolean DEBUG = GLContextImpl.DEBUG;
-
+
// This class is implemented using a HashMap which maps from all shared contexts
// to a share set, containing all shared contexts itself.
@@ -74,17 +74,17 @@ public class GLContextShareSet {
} else {
destroyedShares.put(ctx, dummyValue);
}
- }
+ }
}
public Set getCreatedShares() {
return createdShares.keySet();
}
-
+
public Set getDestroyedShares() {
return destroyedShares.keySet();
}
-
+
public GLContext getCreatedShare(GLContext ignore) {
for (Iterator iter = createdShares.keySet().iterator(); iter.hasNext(); ) {
GLContext ctx = iter.next();
@@ -133,9 +133,9 @@ public class GLContextShareSet {
addEntry(share1, share);
addEntry(share2, share);
if (DEBUG) {
- System.err.println("GLContextShareSet: registereSharing: 1: " +
+ System.err.println("GLContextShareSet: registereSharing: 1: " +
toHexString(share1.getHandle()) + ", 2: " + toHexString(share2.getHandle()));
- }
+ }
}
public static synchronized void unregisterSharing(GLContext lastContext) {
@@ -155,9 +155,9 @@ public class GLContextShareSet {
throw new GLException("Last context's share set contains no destroyed context");
}
if (DEBUG) {
- System.err.println("GLContextShareSet: unregisterSharing: " +
+ System.err.println("GLContextShareSet: unregisterSharing: " +
toHexString(lastContext.getHandle())+", entries: "+s.size());
- }
+ }
for(Iterator iter = s.iterator() ; iter.hasNext() ; ) {
GLContext ctx = iter.next();
if(null == removeEntry(ctx)) {
@@ -165,7 +165,7 @@ public class GLContextShareSet {
}
}
}
-
+
private static synchronized Set getCreatedSharedImpl(GLContext context) {
if (context == null) {
throw new IllegalArgumentException("context is null");
@@ -174,9 +174,9 @@ public class GLContextShareSet {
if (share != null) {
return share.getCreatedShares();
}
- return null;
+ return null;
}
-
+
public static synchronized boolean isShared(GLContext context) {
if (context == null) {
throw new IllegalArgumentException("context is null");
@@ -184,12 +184,12 @@ public class GLContextShareSet {
final ShareSet share = entryFor(context);
return share != null;
}
-
+
public static synchronized boolean hasCreatedSharedLeft(GLContext context) {
final Set s = getCreatedSharedImpl(context);
return null != s && s.size()>0 ;
}
-
+
/** currently not used ..
public static synchronized Set getCreatedShared(GLContext context) {
final Set s = getCreatedSharedImpl(context);
@@ -198,7 +198,7 @@ public class GLContextShareSet {
}
return s;
}
-
+
public static synchronized Set getDestroyedShared(GLContext context) {
if (context == null) {
throw new IllegalArgumentException("context is null");
@@ -209,7 +209,7 @@ public class GLContextShareSet {
}
return share.getDestroyedShares();
} */
-
+
public static synchronized GLContext getShareContext(GLContext contextToCreate) {
ShareSet share = entryFor(contextToCreate);
if (share == null) {
@@ -262,7 +262,7 @@ public class GLContextShareSet {
//----------------------------------------------------------------------
// Internals only below this point
-
+
private static ShareSet entryFor(GLContext context) {
return (ShareSet) shareMap.get(context);
@@ -276,8 +276,8 @@ public class GLContextShareSet {
private static ShareSet removeEntry(GLContext context) {
return (ShareSet) shareMap.remove(context);
}
-
+
protected static String toHexString(long hex) {
return "0x" + Long.toHexString(hex);
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
index 9ecaca75d..b770f3b05 100644
--- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
+++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
@@ -44,57 +44,57 @@ import com.jogamp.opengl.GLExtensions;
/**
* The GLDebugMessageHandler, handling GL_ARB_debug_output or GL_AMD_debug_output
* debug messages.
- *
+ *
*
An instance must be bound to the current thread's GLContext to achieve thread safety.
- *
- *
A native callback function is registered at {@link #enable(boolean) enable(true)},
- * which forwards received messages to the added {@link GLDebugListener} directly.
+ *
+ *
A native callback function is registered at {@link #enable(boolean) enable(true)},
+ * which forwards received messages to the added {@link GLDebugListener} directly.
* Hence the {@link GLDebugListener#messageSent(GLDebugMessage)} implementation shall
* return as fast as possible.
- *
+ *
*
In case no GL_ARB_debug_output is available, but GL_AMD_debug_output,
* the messages are translated to ARB {@link GLDebugMessage}, using {@link GLDebugMessage#translateAMDEvent(javax.media.opengl.GLContext, long, int, int, int, String)}.
*/
public class GLDebugMessageHandler {
private static final boolean DEBUG = Debug.debug("GLDebugMessageHandler");
-
+
private static final int EXT_ARB = 1;
- private static final int EXT_AMD = 2;
-
+ private static final int EXT_AMD = 2;
+
static {
if ( !initIDs0() ) {
throw new NativeWindowException("Failed to initialize GLDebugMessageHandler jmethodIDs");
- }
+ }
}
-
- private final GLContextImpl ctx;
+
+ private final GLContextImpl ctx;
private final ListenerSyncedImplStub listenerImpl;
-
+
// licefycle: init - EOL
private String extName;
private int extType;
private long glDebugMessageCallbackProcAddress;
- private boolean extAvailable;
+ private boolean extAvailable;
private boolean synchronous;
-
+
// licefycle: enable - disable/EOL
private long handle;
-
+
/**
* @param ctx the associated GLContext
* @param glDebugExtension chosen extension to use
*/
- public GLDebugMessageHandler(GLContextImpl ctx) {
+ public GLDebugMessageHandler(GLContextImpl ctx) {
this.ctx = ctx;
- this.listenerImpl = new ListenerSyncedImplStub();
+ this.listenerImpl = new ListenerSyncedImplStub();
this.glDebugMessageCallbackProcAddress = 0;
this.extName = null;
this.extType = 0;
- this.extAvailable = false;
+ this.extAvailable = false;
this.handle = 0;
this.synchronous = true;
}
-
+
public void init(boolean enable) {
if(DEBUG) {
System.err.println("GLDebugMessageHandler.init("+enable+")");
@@ -106,13 +106,13 @@ public class GLDebugMessageHandler {
System.err.println("GLDebugMessageHandler.init("+enable+") .. n/a");
}
}
-
+
private final long getAddressFor(final ProcAddressTable table, final String functionName) {
return AccessController.doPrivileged(new PrivilegedAction() {
public Long run() {
try {
return Long.valueOf( table.getAddressFor(functionName) );
- } catch (IllegalArgumentException iae) {
+ } catch (IllegalArgumentException iae) {
return Long.valueOf(0);
}
}
@@ -124,12 +124,12 @@ public class GLDebugMessageHandler {
if( isAvailable()) {
return;
}
-
+
if( !ctx.isGLDebugEnabled() ) {
if(DEBUG) {
System.err.println("GLDebugMessageHandler: GL DEBUG not set in ARB ctx options: "+ctx.getGLVersion());
}
- return;
+ return;
}
if(Platform.OS_TYPE == Platform.OSType.WINDOWS && Platform.is32Bit()) {
// Currently buggy, ie. throws an exception after leaving the native callback.
@@ -149,93 +149,93 @@ public class GLDebugMessageHandler {
if(DEBUG) {
System.err.println("GLDebugMessageHandler: Using extension: <"+extName+">");
}
-
+
if(0 == extType) {
if(DEBUG) {
System.err.println("GLDebugMessageHandler: No extension available! "+ctx.getGLVersion());
System.err.println("GL_EXTENSIONS "+ctx.getGLExtensionCount());
- System.err.println(ctx.getGLExtensionsString());
+ System.err.println(ctx.getGLExtensionsString());
}
return;
}
-
+
final ProcAddressTable procAddressTable = ctx.getGLProcAddressTable();
if( !ctx.isGLES1() && !ctx.isGLES2() ) {
switch(extType) {
- case EXT_ARB:
+ case EXT_ARB:
glDebugMessageCallbackProcAddress = getAddressFor(procAddressTable, "glDebugMessageCallbackARB");
break;
- case EXT_AMD:
+ case EXT_AMD:
glDebugMessageCallbackProcAddress = getAddressFor(procAddressTable, "glDebugMessageCallbackAMD");
break;
}
} else {
glDebugMessageCallbackProcAddress = 0;
if(DEBUG) {
- System.err.println("Non desktop context not supported");
- }
+ System.err.println("Non desktop context not supported");
+ }
}
extAvailable = 0 < extType && null != extName && 0 != glDebugMessageCallbackProcAddress;
-
+
if(DEBUG) {
System.err.println("GLDebugMessageHandler: extAvailable: "+extAvailable+", glDebugMessageCallback* : 0x"+Long.toHexString(glDebugMessageCallbackProcAddress));
}
-
+
if(!extAvailable) {
glDebugMessageCallbackProcAddress = 0;
}
-
+
handle = 0;
}
public final boolean isAvailable() { return extAvailable; }
-
+
/**
- * @return The extension implementing the GLDebugMessage feature,
- * either {@link #GL_ARB_debug_output} or {@link #GL_AMD_debug_output}.
- * If unavailable null is returned.
+ * @return The extension implementing the GLDebugMessage feature,
+ * either {@link #GL_ARB_debug_output} or {@link #GL_AMD_debug_output}.
+ * If unavailable null is returned.
*/
public final String getExtension() {
return extName;
}
-
+
public final boolean isExtensionARB() {
return extName == GLExtensions.ARB_debug_output;
}
-
+
public final boolean isExtensionAMD() {
return extName == GLExtensions.AMD_debug_output;
}
-
+
/**
- * @see javax.media.opengl.GLContext#isGLDebugSynchronous()
+ * @see javax.media.opengl.GLContext#isGLDebugSynchronous()
*/
public final boolean isSynchronous() { return synchronous; }
-
+
/**
- * @see javax.media.opengl.GLContext#setGLDebugSynchronous(boolean)
+ * @see javax.media.opengl.GLContext#setGLDebugSynchronous(boolean)
*/
public final void setSynchronous(boolean synchronous) {
this.synchronous = synchronous;
if( isEnabled() ) {
setSynchronousImpl();
}
- }
+ }
private final void setSynchronousImpl() {
if(isExtensionARB()) {
if(synchronous) {
ctx.getGL().glEnable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
} else {
ctx.getGL().glDisable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
- }
+ }
if(DEBUG) {
System.err.println("GLDebugMessageHandler: synchronous "+synchronous);
}
}
}
-
+
/**
- * @see javax.media.opengl.GLContext#enableGLDebugMessage(boolean)
+ * @see javax.media.opengl.GLContext#enableGLDebugMessage(boolean)
*/
public final void enable(boolean enable) throws GLException {
ctx.validateCurrent();
@@ -243,7 +243,7 @@ public class GLDebugMessageHandler {
return;
}
enableImpl(enable);
- }
+ }
final void enableImpl(boolean enable) throws GLException {
if(enable) {
if(0 == handle) {
@@ -257,19 +257,19 @@ public class GLDebugMessageHandler {
if(0 != handle) {
unregister0(glDebugMessageCallbackProcAddress, handle);
handle = 0;
- }
+ }
}
if(DEBUG) {
System.err.println("GLDebugMessageHandler: enable("+enable+") -> 0x" + Long.toHexString(handle));
}
}
-
+
public final boolean isEnabled() { return 0 != handle; }
- public final int listenerSize() {
- return listenerImpl.size();
+ public final int listenerSize() {
+ return listenerImpl.size();
}
-
+
public final void addListener(GLDebugListener listener) {
listenerImpl.addListener(-1, listener);
}
@@ -277,11 +277,11 @@ public class GLDebugMessageHandler {
public final void addListener(int index, GLDebugListener listener) {
listenerImpl.addListener(index, listener);
}
-
+
public final void removeListener(GLDebugListener listener) {
listenerImpl.removeListener(listener);
}
-
+
private final void sendMessage(GLDebugMessage msg) {
synchronized(listenerImpl) {
if(DEBUG) {
@@ -293,10 +293,10 @@ public class GLDebugMessageHandler {
}
}
}
-
+
public static class StdErrGLDebugListener implements GLDebugListener {
boolean threadDump;
-
+
public StdErrGLDebugListener(boolean threadDump) {
this.threadDump = threadDump;
}
@@ -305,13 +305,13 @@ public class GLDebugMessageHandler {
if(threadDump) {
Thread.dumpStack();
}
- }
+ }
}
-
+
//
// native -> java
//
-
+
protected final void glDebugMessageARB(int source, int type, int id, int severity, String msg) {
final GLDebugMessage event = new GLDebugMessage(ctx, System.currentTimeMillis(), source, type, id, severity, msg);
sendMessage(event);
@@ -321,11 +321,11 @@ public class GLDebugMessageHandler {
final GLDebugMessage event = GLDebugMessage.translateAMDEvent(ctx, System.currentTimeMillis(), id, category, severity, msg);
sendMessage(event);
}
-
+
//
// java -> native
- //
-
+ //
+
private static native boolean initIDs0();
private native long register0(long glDebugMessageCallbackProcAddress, int extType);
private native void unregister0(long glDebugMessageCallbackProcAddress, long handle);
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index f5ceb8058..1e4cb38fa 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -95,14 +95,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
} catch (GLException gle) {
if(DEBUG) {
- System.err.println("Catched Exception on thread "+getThreadName());
+ System.err.println("Catched Exception on thread "+getThreadName());
gle.printStackTrace();
}
}
return null;
}
protected abstract SharedResourceRunner.Resource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device);
-
+
/**
* Returns the shared context mapped to the device {@link AbstractGraphicsDevice#getConnection()},
* either a pre-existing or newly created, or null if creation failed or not supported.
@@ -176,7 +176,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
final OffscreenLayerSurface ols = NativeWindowFactory.getOffscreenLayerSurface(target, true);
if(null != ols) {
final GLCapabilitiesImmutable chosenCapsMod = GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(chosenCaps, this, adevice);
-
+
// layered surface -> Offscreen/[FBO|PBuffer]
if( !chosenCapsMod.isFBO() && !chosenCapsMod.isPBuffer() ) {
throw new GLException("Neither FBO nor Pbuffer is available for "+chosenCapsMod+", "+target);
@@ -193,10 +193,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
if( ! ( target instanceof MutableSurface ) ) {
throw new IllegalArgumentException("Passed NativeSurface must implement SurfaceChangeable for offscreen layered surface: "+target);
- }
+ }
if( chosenCapsMod.isFBO() ) {
result = createFBODrawableImpl(target, chosenCapsMod, 0);
- } else {
+ } else {
result = createOffscreenDrawableImpl(target);
}
} else if(chosenCaps.isOnscreen()) {
@@ -217,7 +217,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
throw new IllegalArgumentException("Passed NativeSurface must implement MutableSurface for offscreen: "+target);
}
if( chosenCaps.isFBO() && isFBOAvailable ) {
- // need to hook-up a native dummy surface since source may not have & use minimum GLCapabilities for it w/ same profile
+ // need to hook-up a native dummy surface since source may not have & use minimum GLCapabilities for it w/ same profile
final ProxySurface dummySurface = createDummySurfaceImpl(adevice, false, new GLCapabilities(chosenCaps.getGLProfile()), (GLCapabilitiesImmutable)config.getRequestedCapabilities(), null, 64, 64);
dummySurface.setUpstreamSurfaceHook(new DelegatedUpstreamSurfaceHookWithSurfaceSize(dummySurface.getUpstreamSurfaceHook(), target));
result = createFBODrawableImpl(dummySurface, chosenCaps, 0);
@@ -245,7 +245,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
//
// PBuffer Offscreen GLAutoDrawable construction
//
-
+
@Override
public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
@@ -271,7 +271,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
GLDrawableImpl drawable = null;
device.lock();
try {
- drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
+ drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
new UpstreamSurfaceHookMutableSize(width, height) ) );
if(null != drawable) {
drawable.setRealized(true);
@@ -294,9 +294,9 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
}
- return GLContext.isFBOAvailable(device, glp);
+ return GLContext.isFBOAvailable(device, glp);
}
-
+
@Override
public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
GLCapabilitiesImmutable capsRequested,
@@ -311,7 +311,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
return new GLOffscreenAutoDrawableImpl( drawable, context, null, null);
}
-
+
@Override
public final GLDrawable createOffscreenDrawable(AbstractGraphicsDevice deviceReq,
GLCapabilitiesImmutable capsRequested,
@@ -324,18 +324,18 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq);
}
-
+
final GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(capsRequested, this, device);
device.lock();
try {
if( capsChosen.isFBO() ) {
- // Use minimum GLCapabilities for the dummy surface w/ same profile
+ // Use minimum GLCapabilities for the dummy surface w/ same profile
final ProxySurface dummySurface = createDummySurfaceImpl(device, true, new GLCapabilities(capsChosen.getGLProfile()), capsRequested, null, width, height);
final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
return new GLFBODrawableImpl.ResizeableImpl(this, dummyDrawable, dummySurface, capsChosen, 0);
- }
- return createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
+ }
+ return createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
new UpstreamSurfaceHookMutableSize(width, height) ) );
} finally {
device.unlock();
@@ -343,7 +343,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
}
@Override
- public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp) {
+ public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLProfile glp) {
final AbstractGraphicsDevice device = createNewDevice ? getOrCreateSharedDevice(deviceReq) : deviceReq;
if(null == device) {
throw new GLException("No shared device for requested: "+deviceReq+", createNewDevice "+createNewDevice);
@@ -357,14 +357,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
device.unlock();
}
}
-
- /** Creates a platform independent unrealized FBO offscreen GLDrawable */
+
+ /** Creates a platform independent unrealized FBO offscreen GLDrawable */
protected final GLFBODrawable createFBODrawableImpl(NativeSurface dummySurface, GLCapabilitiesImmutable fboCaps, int textureUnit) {
final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
return new GLFBODrawableImpl(this, dummyDrawable, dummySurface, fboCaps, textureUnit);
}
-
- /** Creates a platform dependent unrealized offscreen pbuffer/pixmap GLDrawable instance */
+
+ /** Creates a platform dependent unrealized offscreen pbuffer/pixmap GLDrawable instance */
protected abstract GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) ;
/**
@@ -381,10 +381,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @param capsChosen
* @param capsRequested
* @param chooser the custom chooser, may be null for default
- * @param upstreamHook surface size information and optional control of the surface's lifecycle
+ * @param upstreamHook surface size information and optional control of the surface's lifecycle
* @return the created {@link MutableSurface} instance w/o defined surface handle
*/
- protected abstract ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
+ protected abstract ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
GLCapabilitiesImmutable capsChosen,
GLCapabilitiesImmutable capsRequested,
GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook);
@@ -399,7 +399,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @param deviceReq which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be null for the platform's default device.
* @param requestedCaps
* @param chooser the custom chooser, may be null for default
- * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
+ * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
* The latter is platform specific and small
* @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
* The latter is platform specific and small
@@ -419,7 +419,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
device.unlock();
}
}
-
+
/**
* A dummy surface is not visible on screen and will not be used to render directly to,
* it maybe on- or offscreen.
@@ -433,22 +433,22 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
* @param chosenCaps
* @param requestedCaps
* @param chooser the custom chooser, may be null for default
- * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
+ * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
* The latter is platform specific and small
* @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
* The latter is platform specific and small
* @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
*/
- public abstract ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
+ public abstract ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice device, boolean createNewDevice,
GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height);
//---------------------------------------------------------------------------
//
// ProxySurface (Wrapped pre-existing native surface) construction
//
-
+
@Override
- public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
+ public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
if(null == device) {
@@ -473,7 +473,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
*
* @param upstream TODO
*/
- protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
+ protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream);
//---------------------------------------------------------------------------
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index 5418fbaf3..2cf384fd7 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -63,12 +63,12 @@ import javax.media.opengl.GLRunnable;
public class GLDrawableHelper {
/** true if property jogl.debug.GLDrawable.PerfStats is defined. */
private static final boolean PERF_STATS;
-
+
static {
Debug.initSingleton();
PERF_STATS = Debug.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
}
-
+
protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
private final Object listenersLock = new Object();
private final ArrayList listeners = new ArrayList();
@@ -120,7 +120,7 @@ public class GLDrawableHelper {
/** Limit release calls of {@link #forceNativeRelease(GLContext)} to {@value}. */
private static final int MAX_RELEASE_ITER = 512;
-
+
/**
* Since GLContext's {@link GLContext#makeCurrent()} and {@link GLContext#release()}
* is recursive, a call to {@link GLContext#release()} may not natively release the context.
@@ -138,36 +138,36 @@ public class GLDrawableHelper {
System.err.println("GLDrawableHelper.forceNativeRelease() #"+releaseCount+" -- currentThread "+Thread.currentThread()+" -> "+GLContext.getCurrent());
}
} while( MAX_RELEASE_ITER > releaseCount && ctx.isCurrent() );
-
+
if( ctx.isCurrent() ) {
throw new GLException("Context still current after "+MAX_RELEASE_ITER+" releases: "+ctx);
}
}
-
+
/**
* Switch {@link GLContext} / {@link GLDrawable} association.
*
* The oldCtx will be destroyed if destroyPrevCtx is true,
- * otherwise dis-associate oldCtx from drawable
+ * otherwise dis-associate oldCtx from drawable
* via {@link GLContext#setGLDrawable(GLDrawable, boolean) oldCtx.setGLDrawable(null, true);}.
*
*
- * Re-associate newCtx with drawable
+ * Re-associate newCtx with drawable
* via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.
*
- *
+ *
* If the old or new context was current on this thread, it is being released before switching the drawable.
*
*
* No locking is being performed on the drawable, caller is required to take care of it.
*
- *
+ *
* @param drawable the drawable which context is changed
* @param oldCtx the old context, maybe null.
* @param destroyOldCtx if true, destroy the oldCtx
* @param newCtx the new context, maybe null for dis-association.
* @param newCtxCreationFlags additional creation flags if newCtx is not null and not been created yet, see {@link GLContext#setContextCreationFlags(int)}
- *
+ *
* @see GLAutoDrawable#setContext(GLContext, boolean)
*/
public static final void switchContext(GLDrawable drawable, GLContext oldCtx, boolean destroyOldCtx, GLContext newCtx, int newCtxCreationFlags) {
@@ -178,16 +178,16 @@ public class GLDrawableHelper {
oldCtx.setGLDrawable(null, true); // dis-associate old pair
}
}
-
+
if(null!=newCtx) {
newCtx.setContextCreationFlags(newCtxCreationFlags);
- newCtx.setGLDrawable(drawable, true); // re-associate new pair
+ newCtx.setGLDrawable(drawable, true); // re-associate new pair
}
}
-
+
/**
* If the drawable is not realized, OP is a NOP.
- *
+ *
*
release context if current
*
destroy old drawable
*
create new drawable
@@ -197,12 +197,12 @@ public class GLDrawableHelper {
*
* Locking is performed via {@link GLContext#makeCurrent()} on the passed context.
*
- *
+ *
* @param drawable
* @param context maybe null
* @return the new drawable
*/
- public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, GLContext context) {
+ public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, GLContext context) {
if( ! drawable.isRealized() ) {
return drawable;
}
@@ -210,7 +210,7 @@ public class GLDrawableHelper {
final GLDrawableFactory factory = drawable.getFactory();
final NativeSurface surface = drawable.getNativeSurface();
final ProxySurface proxySurface = (surface instanceof ProxySurface) ? (ProxySurface)surface : null;
-
+
if( null != context ) {
// Ensure to sync GL command stream
if( currentContext != context ) {
@@ -219,7 +219,7 @@ public class GLDrawableHelper {
context.getGL().glFinish();
context.setGLDrawable(null, true); // dis-associate
}
-
+
if(null != proxySurface) {
proxySurface.enableUpstreamSurfaceHookLifecycle(false);
}
@@ -236,18 +236,18 @@ public class GLDrawableHelper {
if(null != context) {
context.setGLDrawable(drawable, true); // re-association
}
-
+
if( null != currentContext ) {
currentContext.makeCurrent();
}
return drawable;
}
-
+
/**
* Performs resize operation on the given drawable, assuming it is offscreen.
*
* The {@link GLDrawableImpl}'s {@link NativeSurface} is being locked during operation.
- * In case the holder is an auto drawable or similar, it's lock shall be claimed by the caller.
+ * In case the holder is an auto drawable or similar, it's lock shall be claimed by the caller.
*
*
* May recreate the drawable via {@link #recreateGLDrawable(GLDrawableImpl, GLContext)}
@@ -257,10 +257,10 @@ public class GLDrawableHelper {
* FBO drawables are resized w/o drawable destruction.
*
*
- * Offscreen resize operation is validated w/ drawable size in the end.
+ * Offscreen resize operation is validated w/ drawable size in the end.
* An exception is thrown if not successful.
*
- *
+ *
* @param drawable
* @param context
* @param newWidth the new width, it's minimum is capped to 1
@@ -270,7 +270,7 @@ public class GLDrawableHelper {
* @throws GLException may be thrown a resize operation
*/
public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, GLContext context, int newWidth, int newHeight)
- throws NativeWindowException, GLException
+ throws NativeWindowException, GLException
{
if(drawable.getChosenGLCapabilities().isOnscreen()) {
throw new NativeWindowException("Drawable is not offscreen: "+drawable);
@@ -288,7 +288,7 @@ public class GLDrawableHelper {
}
if(0>=newWidth) { newWidth = 1; validateSize=false; }
if(0>=newHeight) { newHeight = 1; validateSize=false; }
- // propagate new size
+ // propagate new size
if(ns instanceof ProxySurface) {
final ProxySurface ps = (ProxySurface) ns;
final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook();
@@ -301,7 +301,7 @@ public class GLDrawableHelper {
System.err.println("GLDrawableHelper.resizeOffscreenDrawable: Drawable's offscreen surface n.a. ProxySurface, but "+ns.getClass().getName()+": "+ns);
}
if(drawable instanceof GLFBODrawable) {
- if( null != context && context.isCreated() ) {
+ if( null != context && context.isCreated() ) {
((GLFBODrawable) drawable).resetSize(context.getGL());
}
} else {
@@ -315,7 +315,7 @@ public class GLDrawableHelper {
}
return drawable;
}
-
+
public final void addGLEventListener(GLEventListener listener) {
addGLEventListener(-1, listener);
}
@@ -328,14 +328,14 @@ public class GLDrawableHelper {
// GLEventListener may be added after context is created,
// hence we earmark initialization for the next display call.
listenersToBeInit.add(listener);
-
+
listeners.add(index, listener);
}
}
/**
* Note that no {@link GLEventListener#dispose(GLAutoDrawable)} call is being issued
- * due to the lack of a current context.
+ * due to the lack of a current context.
* Consider calling {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}.
* @return the removed listener, or null if listener was not added
*/
@@ -356,11 +356,11 @@ public class GLDrawableHelper {
return listener;
}
}
-
+
public final int getGLEventListenerCount() {
synchronized(listenersLock) {
return listeners.size();
- }
+ }
}
public final GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
@@ -371,13 +371,13 @@ public class GLDrawableHelper {
return listeners.get(index);
}
}
-
+
public final boolean getGLEventListenerInitState(GLEventListener listener) {
synchronized(listenersLock) {
return !listenersToBeInit.contains(listener);
}
}
-
+
public final void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
synchronized(listenersLock) {
if(initialized) {
@@ -387,16 +387,16 @@ public class GLDrawableHelper {
}
}
}
-
+
/**
- * Disposes the given {@link GLEventListener} via {@link GLEventListener#dispose(GLAutoDrawable)}
+ * Disposes the given {@link GLEventListener} via {@link GLEventListener#dispose(GLAutoDrawable)}
* if it has been initialized and added to this queue.
*
* If remove is true, the {@link GLEventListener} is removed from this drawable queue before disposal,
* otherwise marked uninitialized.
*
*
- * Please consider using {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}
+ * Please consider using {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}
* for correctness, i.e. encapsulating all calls w/ makeCurrent etc.
*
@@ -456,20 +456,20 @@ public class GLDrawableHelper {
listenersToBeInit.add(listener);
disposeCount++;
}
- }
+ }
}
}
return disposeCount;
}
/**
- * Principal helper method which runs {@link #disposeGLEventListener(GLAutoDrawable, GLEventListener, boolean)}
+ * Principal helper method which runs {@link #disposeGLEventListener(GLAutoDrawable, GLEventListener, boolean)}
* with the context made current.
*
- * If an {@link GLAnimatorControl} is being attached and the current thread is different
+ * If an {@link GLAnimatorControl} is being attached and the current thread is different
* than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
*
- *
+ *
* @param autoDrawable
* @param context
* @param listener
@@ -477,7 +477,7 @@ public class GLDrawableHelper {
*/
public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable,
final GLDrawable drawable,
- final GLContext context,
+ final GLContext context,
final GLEventListener listener,
final boolean remove) {
synchronized(listenersLock) {
@@ -485,7 +485,7 @@ public class GLDrawableHelper {
if( listenersToBeInit.contains(listener) ) {
if( remove ) {
listenersToBeInit.remove(listener);
- return listeners.remove(listener) ? listener : null;
+ return listeners.remove(listener) ? listener : null;
}
return null;
}
@@ -498,21 +498,21 @@ public class GLDrawableHelper {
}
};
invokeGL(drawable, context, action, nop);
-
+
if(isPaused) {
animatorCtrl.resume();
}
return res[0];
}
-
+
/**
- * Principal helper method which runs {@link #disposeAllGLEventListener(GLAutoDrawable, boolean)}
+ * Principal helper method which runs {@link #disposeAllGLEventListener(GLAutoDrawable, boolean)}
* with the context made current.
*
- * If an {@link GLAnimatorControl} is being attached and the current thread is different
+ * If an {@link GLAnimatorControl} is being attached and the current thread is different
* than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
*
- *
+ *
* @param autoDrawable
* @param context
* @param remove
@@ -521,21 +521,21 @@ public class GLDrawableHelper {
final GLDrawable drawable,
final GLContext context,
final boolean remove) {
-
+
final boolean isPaused = isAnimatorAnimatingOnOtherThread() && animatorCtrl.pause();
-
+
final Runnable action = new Runnable() {
public void run() {
disposeAllGLEventListener(autoDrawable, remove);
}
};
invokeGL(drawable, context, action, nop);
-
+
if(isPaused) {
animatorCtrl.resume();
}
}
-
+
private final void init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape, boolean setViewport) {
l.init(drawable);
if(sendReshape) {
@@ -543,8 +543,8 @@ public class GLDrawableHelper {
}
}
- /**
- * The default init action to be called once after ctx is being created @ 1st makeCurrent().
+ /**
+ * The default init action to be called once after ctx is being created @ 1st makeCurrent().
* @param sendReshape set to true if the subsequent display call won't reshape, otherwise false to avoid double reshape.
**/
public final void init(GLAutoDrawable drawable, boolean sendReshape) {
@@ -554,7 +554,7 @@ public class GLDrawableHelper {
if( listenerCount > 0 ) {
for (int i=0; i < listenerCount; i++) {
final GLEventListener listener = _listeners.get(i) ;
-
+
// If make ctx current, invoked by invokGL(..), results in a new ctx, init gets called.
// This may happen not just for initial setup, but for ctx recreation due to resource change (drawable/window),
// hence it must be called unconditional, always.
@@ -571,7 +571,7 @@ public class GLDrawableHelper {
public final void display(GLAutoDrawable drawable) {
displayImpl(drawable);
if( glRunnables.size()>0 && !execGLRunnables(drawable) ) { // glRunnables volatile OK; execGL.. only executed if size > 0
- displayImpl(drawable);
+ displayImpl(drawable);
}
}
private final void displayImpl(GLAutoDrawable drawable) {
@@ -580,7 +580,7 @@ public class GLDrawableHelper {
final int listenerCount = _listeners.size();
for (int i=0; i < listenerCount; i++) {
final GLEventListener listener = _listeners.get(i) ;
- // GLEventListener may need to be init,
+ // GLEventListener may need to be init,
// in case this one is added after the realization of the GLAutoDrawable
if( listenersToBeInit.remove(listener) ) {
init( listener, drawable, true /* sendReshape */, listenersToBeInit.size() + 1 == listenerCount /* setViewport if 1st init */ );
@@ -589,11 +589,11 @@ public class GLDrawableHelper {
}
}
}
-
+
private final void reshape(GLEventListener listener, GLAutoDrawable drawable,
int x, int y, int width, int height, boolean setViewport, boolean checkInit) {
if(checkInit) {
- // GLEventListener may need to be init,
+ // GLEventListener may need to be init,
// in case this one is added after the realization of the GLAutoDrawable
synchronized(listenersLock) {
if( listenersToBeInit.remove(listener) ) {
@@ -627,7 +627,7 @@ public class GLDrawableHelper {
_glRunnables = null;
}
}
-
+
if(null!=_glRunnables) {
for (int i=0; i < _glRunnables.size(); i++) {
res = _glRunnables.get(i).run(drawable) && res;
@@ -648,7 +648,7 @@ public class GLDrawableHelper {
_glRunnables = null;
}
}
-
+
if(null!=_glRunnables) {
for (int i=0; i < _glRunnables.size(); i++) {
_glRunnables.get(i).flush();
@@ -656,7 +656,7 @@ public class GLDrawableHelper {
}
}
}
-
+
public final void setAnimator(GLAnimatorControl animator) throws GLException {
synchronized(glRunnablesLock) {
if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) {
@@ -693,7 +693,7 @@ public class GLDrawableHelper {
* If wait is true the call blocks until the glRunnable
* has been executed.
*
- * If wait is trueand
+ * If wait is trueand
* {@link GLDrawable#isRealized()} returns falseor {@link GLAutoDrawable#getContext()} returns null,
* the call is ignored and returns false.
* This helps avoiding deadlocking the caller.
@@ -709,7 +709,7 @@ public class GLDrawableHelper {
wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
return false;
}
-
+
GLRunnableTask rTask = null;
Object rTaskLock = new Object();
Throwable throwable = null;
@@ -743,13 +743,13 @@ public class GLDrawableHelper {
}
return true;
}
-
+
public final boolean invoke(GLAutoDrawable drawable, boolean wait, List newGLRunnables) {
if( null == newGLRunnables || newGLRunnables.size() == 0 || null == drawable ||
wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
return false;
}
-
+
final int count = newGLRunnables.size();
GLRunnableTask rTask = null;
Object rTaskLock = new Object();
@@ -785,18 +785,18 @@ public class GLDrawableHelper {
}
}
}
- return true;
+ return true;
}
public final void enqueue(GLRunnable glRunnable) {
if( null == glRunnable) {
return;
- }
+ }
synchronized(glRunnablesLock) {
glRunnables.add( new GLRunnableTask(glRunnable, null, false) );
}
}
-
+
public final void setAutoSwapBufferMode(boolean enable) {
autoSwapBufferMode = enable;
}
@@ -812,17 +812,17 @@ public class GLDrawableHelper {
/**
* Dedicates this instance's {@link GLContext} to the given thread.
* The thread will exclusively claim the {@link GLContext} via {@link #display()} and not release it
- * until {@link #destroy()} or setExclusiveContextThread(null) has been called.
+ * until {@link #destroy()} or setExclusiveContextThread(null) has been called.
*
* Default non-exclusive behavior is requested via setExclusiveContextThread(null),
- * which will cause the next call of {@link #display()} on the exclusive thread to
- * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()}
+ * which will cause the next call of {@link #display()} on the exclusive thread to
+ * release the {@link GLContext}. Only after it's async release, {@link #getExclusiveContextThread()}
* will return null.
*
*
* To release a previous made exclusive thread, a user issues setExclusiveContextThread(null)
- * and may poll {@link #getExclusiveContextThread()} until it returns null,
- * while the exclusive thread is still running.
+ * and may poll {@link #getExclusiveContextThread()} until it returns null,
+ * while the exclusive thread is still running.
*
*
* Note: Setting a new exclusive thread without properly releasing a previous one
@@ -833,7 +833,7 @@ public class GLDrawableHelper {
* and spare redundant context switches.
*
* @param t the exclusive thread to claim the context, or null for default operation.
- * @return previous exclusive context thread
+ * @return previous exclusive context thread
* @throws GLException If an exclusive thread is still active but a new one is attempted to be set
*/
public final Thread setExclusiveContextThread(Thread t, GLContext context) throws GLException {
@@ -857,7 +857,7 @@ public class GLDrawableHelper {
ex.printStackTrace();
throw new GLException(ex);
}
- }
+ }
exclusiveContextThread = t;
}
if (DEBUG) {
@@ -865,14 +865,14 @@ public class GLDrawableHelper {
}
return oldExclusiveContextThread;
}
-
+
/**
- * @see #setExclusiveContextThread(Thread, GLContext)
+ * @see #setExclusiveContextThread(Thread, GLContext)
*/
public final Thread getExclusiveContextThread() {
return exclusiveContextThread;
}
-
+
private static final ThreadLocal perThreadInitAction = new ThreadLocal();
/** Principal helper method which runs a Runnable with the context
@@ -904,15 +904,15 @@ public class GLDrawableHelper {
}
if(PERF_STATS) {
- invokeGLImplStats(drawable, context, runnable, initAction);
+ invokeGLImplStats(drawable, context, runnable, initAction);
} else {
invokeGLImpl(drawable, context, runnable, initAction);
}
}
- /**
- * Principal helper method which runs
- * {@link #disposeAllGLEventListener(GLAutoDrawable, boolean) disposeAllGLEventListener(autoDrawable, false)}
+ /**
+ * Principal helper method which runs
+ * {@link #disposeAllGLEventListener(GLAutoDrawable, boolean) disposeAllGLEventListener(autoDrawable, false)}
* with the context made current.
*
* If destroyContext is true the context is destroyed in the end while holding the lock.
@@ -940,7 +940,7 @@ public class GLDrawableHelper {
}
}
- int res;
+ int res;
try {
res = context.makeCurrent();
if (GLContext.CONTEXT_NOT_CURRENT != res) {
@@ -975,7 +975,7 @@ public class GLDrawableHelper {
private final void invokeGLImpl(final GLDrawable drawable,
final GLContext context,
final Runnable runnable,
- final Runnable initAction) {
+ final Runnable initAction) {
final Thread currentThread = Thread.currentThread();
// Exclusive Cases:
@@ -1013,7 +1013,7 @@ public class GLDrawableHelper {
lastContext.release();
}
}
-
+
try {
final boolean releaseContext;
if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1110,7 +1110,7 @@ public class GLDrawableHelper {
long tdX = 0; // release
boolean ctxClaimed = false;
boolean ctxReleased = false;
- boolean ctxDestroyed = false;
+ boolean ctxDestroyed = false;
try {
final boolean releaseContext;
if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1129,7 +1129,7 @@ public class GLDrawableHelper {
}
initAction.run();
}
- tdR = System.currentTimeMillis();
+ tdR = System.currentTimeMillis();
tdA = tdR - t0; // makeCurrent
runnable.run();
tdS = System.currentTimeMillis();
@@ -1172,5 +1172,5 @@ public class GLDrawableHelper {
}
protected static String getThreadName() { return Thread.currentThread().getName(); }
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
index e1088da29..a79a3cf25 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
@@ -53,11 +53,11 @@ import javax.media.opengl.GLProfile;
public abstract class GLDrawableImpl implements GLDrawable {
protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG;
-
+
protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
this(factory, comp, (GLCapabilitiesImmutable) comp.getGraphicsConfiguration().getRequestedCapabilities(), realized);
}
-
+
protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, GLCapabilitiesImmutable requestedCapabilities, boolean realized) {
this.factory = factory;
this.surface = comp;
@@ -100,20 +100,20 @@ public abstract class GLDrawableImpl implements GLDrawable {
}
} finally {
unlockSurface();
- }
+ }
surface.surfaceUpdated(this, surface, System.currentTimeMillis());
}
-
+
/**
* Platform and implementation depending surface swap.
*
The surface is locked.
*
- * If doubleBuffered is true,
+ * If doubleBuffered is true,
* an actual platform dependent surface swap shall be executed.
*
*
- * If doubleBuffered is false,
- * {@link GL#glFlush()} has been called already and
+ * If doubleBuffered is false,
+ * {@link GL#glFlush()} has been called already and
* the implementation may execute implementation specific code.
*
* @param doubleBuffered indicates whether double buffering is enabled, see above.
@@ -143,19 +143,19 @@ public abstract class GLDrawableImpl implements GLDrawable {
return surface;
}
- /**
+ /**
* called with locked surface @ setRealized(false) or @ lockSurface(..) when surface changed
*
* Must be paired w/ {@link #createHandle()}.
- *
+ *
*/
protected void destroyHandle() {}
- /**
+ /**
* called with locked surface @ setRealized(true) or @ lockSurface(..) when surface changed
*
* Must be paired w/ {@link #destroyHandle()}.
- *
+ *
*/
protected void createHandle() {}
@@ -213,16 +213,16 @@ public abstract class GLDrawableImpl implements GLDrawable {
System.err.println(getThreadName() + ": setRealized: "+getClass().getName()+" "+this.realized+" == "+realizedArg);
}
}
-
+
/**
- * Platform specific realization of drawable
+ * Platform specific realization of drawable
*/
protected abstract void setRealizedImpl();
/**
* Callback for special implementations, allowing
*
- *
to associate bound context to this drawable (bound == true)
+ *
to associate bound context to this drawable (bound == true)
* or to remove such association (bound == false).
*
to trigger GLContext/GLDrawable related lifecycle: construct, destroy.
*
@@ -239,8 +239,8 @@ public abstract class GLDrawableImpl implements GLDrawable {
* @param bound if true create an association, otherwise remove it
*/
protected void associateContext(GLContext ctx, boolean bound) { }
-
- /**
+
+ /**
* Callback for special implementations, allowing GLContext to trigger GL related lifecycle: makeCurrent, release.
*
* If current is true, the context has just been made current.
@@ -252,13 +252,13 @@ public abstract class GLDrawableImpl implements GLDrawable {
* Being called by {@link GLContextImpl#contextMadeCurrent(boolean)}.
*
* @see #associateContext(GLContext, boolean)
- */
+ */
protected void contextMadeCurrent(GLContext glc, boolean current) { }
/** Callback for special implementations, allowing GLContext to fetch a custom default render framebuffer. Defaults to zero.*/
protected int getDefaultDrawFramebuffer() { return 0; }
/** Callback for special implementations, allowing GLContext to fetch a custom default read framebuffer. Defaults to zero. */
- protected int getDefaultReadFramebuffer() { return 0; }
+ protected int getDefaultReadFramebuffer() { return 0; }
/** Callback for special implementations, allowing GLContext to fetch a custom default read buffer of current framebuffer. */
protected int getDefaultReadBuffer(GL gl) {
if(gl.isGLES() || getChosenGLCapabilities().getDoubleBuffered()) {
@@ -266,9 +266,9 @@ public abstract class GLDrawableImpl implements GLDrawable {
// Note-2: ES3 only supports GL_BACK, GL_NONE or GL_COLOR_ATTACHMENT0+i
return GL.GL_BACK;
}
- return GL.GL_FRONT ;
+ return GL.GL_FRONT ;
}
-
+
@Override
public final boolean isRealized() {
return realized;
@@ -286,22 +286,22 @@ public abstract class GLDrawableImpl implements GLDrawable {
@Override
public boolean isGLOriented() {
- return true;
+ return true;
}
-
- /**
+
+ /**
* {@link NativeSurface#lockSurface() Locks} the underlying windowing toolkit's {@link NativeSurface surface}.
*
* If drawable is {@link #setRealized(boolean) realized},
- * the {@link #getHandle() drawable handle} is valid after successfully {@link NativeSurface#lockSurface() locking}
+ * the {@link #getHandle() drawable handle} is valid after successfully {@link NativeSurface#lockSurface() locking}
* it's {@link NativeSurface surface} until being {@link #unlockSurface() unlocked}.
*
*
- * In case the {@link NativeSurface surface} has changed as indicated by it's
+ * In case the {@link NativeSurface surface} has changed as indicated by it's
* {@link NativeSurface#lockSurface() lock} result {@link NativeSurface#LOCK_SURFACE_CHANGED},
- * the implementation is required to update this information as needed within it's implementation.
+ * the implementation is required to update this information as needed within it's implementation.
*
- *
+ *
* @see NativeSurface#lockSurface()
* @see #getHandle()
*/
@@ -312,7 +312,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
final long _handle1 = getHandle();
destroyHandle();
createHandle();
- final long _handle2 = getHandle();
+ final long _handle2 = getHandle();
if(DEBUG) {
if( _handle1 != _handle2) {
System.err.println(getThreadName() + ": Drawable handle changed: "+toHexString(_handle1)+" -> "+toHexString(_handle2));
@@ -320,14 +320,14 @@ public abstract class GLDrawableImpl implements GLDrawable {
}
}
return lockRes;
-
+
}
- /**
+ /**
* {@link NativeSurface#unlockSurface() Unlocks} the underlying windowing toolkit {@link NativeSurface surface},
* which may render the {@link #getHandle() drawable handle} invalid.
- *
- * @see NativeSurface#unlockSurface()
+ *
+ * @see NativeSurface#unlockSurface()
* @see #getHandle()
*/
public final void unlockSurface() {
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
index 8ba9f617b..640e181ae 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl;
import com.jogamp.common.os.DynamicLibraryBundle;
@@ -36,7 +36,7 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle
protected GLDynamicLibraryBundleInfo() {
}
- /**
+ /**
* Returns true,
* since we might load a desktop GL library and allow symbol access to subsequent libs.
*
@@ -47,19 +47,19 @@ public abstract class GLDynamicLibraryBundleInfo implements DynamicLibraryBundle
*
*/
public final boolean shallLinkGlobal() { return true; }
-
+
/**
* {@inheritDoc}
*
* Returns false.
*
- */
+ */
@Override
public boolean shallLookupGlobal() { return false; }
@Override
public final RunnableExecutor getLibLoaderExecutor() {
return DynamicLibraryBundle.getDefaultRunnableExecutor();
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
index 1ed73f15e..421f06205 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl;
import com.jogamp.common.os.DynamicLibraryBundle;
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index f2248b388..ab318927c 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -26,11 +26,11 @@ import com.jogamp.opengl.JoglVersion;
* to initialize the {@link FBObject} instance.
*
*
- * It utilizes the context current hook {@link #contextMadeCurrent(GLContext, boolean) contextMadeCurrent(context, true)}
+ * It utilizes the context current hook {@link #contextMadeCurrent(GLContext, boolean) contextMadeCurrent(context, true)}
* to {@link FBObject#bind(GL) bind} the FBO.
*
* See {@link GLFBODrawable} for double buffering details.
- *
+ *
* @see GLDrawableImpl#contextRealized(GLContext, boolean)
* @see GLDrawableImpl#contextMadeCurrent(GLContext, boolean)
* @see GLDrawableImpl#getDefaultDrawFramebuffer()
@@ -39,21 +39,21 @@ import com.jogamp.opengl.JoglVersion;
public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
protected static final boolean DEBUG;
protected static final boolean DEBUG_SWAP;
-
+
static {
Debug.initSingleton();
DEBUG = GLDrawableImpl.DEBUG || Debug.debug("FBObject");
DEBUG_SWAP = DEBUG || Debug.isPropertyDefined("jogl.debug.FBObject.Swap", true);
}
-
+
private final GLDrawableImpl parent;
private GLCapabilitiesImmutable origParentChosenCaps;
-
+
private boolean initialized;
private int texUnit;
private int samples;
private boolean fboResetQuirk;
-
+
private FBObject[] fbos;
private int fboIBack; // points to GL_BACK buffer
private int fboIFront; // points to GL_FRONT buffer
@@ -64,19 +64,19 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
private boolean fboSwapped;
/** dump fboResetQuirk info only once pre ClassLoader and only in DEBUG mode */
- private static volatile boolean resetQuirkInfoDumped = false;
-
+ private static volatile boolean resetQuirkInfoDumped = false;
+
/** number of FBOs for double buffering. TODO: Possible to configure! */
- private static final int bufferCount = 2;
-
+ private static final int bufferCount = 2;
+
// private DoubleBufferMode doubleBufferMode; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
-
+
private SwapBufferContext swapBufferContext;
-
+
public static interface SwapBufferContext {
public void swapBuffers(boolean doubleBuffered);
}
-
+
/**
* @param factory
* @param parent
@@ -84,7 +84,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
* @param fboCaps the requested FBO capabilities
* @param textureUnit
*/
- protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface,
+ protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface,
GLCapabilitiesImmutable fboCaps, int textureUnit) {
super(factory, surface, fboCaps, false);
this.initialized = false;
@@ -94,13 +94,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
this.texUnit = textureUnit;
this.samples = fboCaps.getNumSamples();
fboResetQuirk = false;
-
+
// default .. // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
// this.doubleBufferMode = ( samples > 0 || fboCaps.getDoubleBuffered() ) ? DoubleBufferMode.FBO : DoubleBufferMode.NONE ;
-
+
this.swapBufferContext = null;
}
-
+
private final void initialize(boolean realize, GL gl) {
if( !initialized && !realize ) {
if( DEBUG ) {
@@ -114,7 +114,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
if(realize) {
final GLCapabilities chosenFBOCaps = (GLCapabilities) getChosenGLCapabilities(); // cloned at setRealized(true)
-
+
final int maxSamples = gl.getMaxRenderbufferSamples();
{
final int newSamples = samples <= maxSamples ? samples : maxSamples;
@@ -123,7 +123,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
samples = newSamples;
}
-
+
final int fbosN;
if(samples > 0) {
fbosN = 1;
@@ -136,7 +136,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
fbos = new FBObject[fbosN];
fboIBack = 0; // head
fboIFront = fbos.length - 1; // tail
-
+
for(int i=0; i "+newSamples+"/"+maxSamples);
}
@@ -297,11 +297,11 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
System.err.println("GLFBODrawableImpl.reset(newSamples "+newSamples+"): END "+this);
}
}
-
+
//
// GLDrawable
//
-
+
@Override
public final GLContext createContext(GLContext shareWith) {
final GLContext ctx = parent.createContext(shareWith);
@@ -312,7 +312,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
//
// GLDrawableImpl
//
-
+
@Override
public final GLDynamicLookupHelper getGLDynamicLookupHelper() {
return parent.getGLDynamicLookupHelper();
@@ -320,13 +320,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
@Override
protected final int getDefaultDrawFramebuffer() { return initialized ? fbos[fboIBack].getWriteFramebuffer() : 0; }
-
+
@Override
protected final int getDefaultReadFramebuffer() { return initialized ? fbos[fboIFront].getReadFramebuffer() : 0; }
@Override
protected final int getDefaultReadBuffer(GL gl) { return initialized ? fbos[fboIFront].getDefaultReadBuffer() : GL.GL_COLOR_ATTACHMENT0 ; }
-
+
@Override
protected final void setRealizedImpl() {
final MutableGraphicsConfiguration msConfig = (MutableGraphicsConfiguration) surface.getGraphicsConfiguration();
@@ -341,12 +341,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
parent.setRealized(false);
}
}
-
+
@Override
protected void associateContext(GLContext glc, boolean bound) {
- initialize(bound, glc.getGL());
+ initialize(bound, glc.getGL());
}
-
+
@Override
protected final void contextMadeCurrent(GLContext glc, boolean current) {
final GL gl = glc.getGL();
@@ -367,7 +367,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
}
}
-
+
@Override
protected void swapBuffersImpl(boolean doubleBuffered) {
final GLContext ctx = GLContext.getCurrent();
@@ -389,7 +389,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
swapFBOImplPost(ctx);
}
}
-
+
private final void swapFBOImplPost(GLContext glc) {
// Safely reset the previous front FBO - after completing propagating swap
if(0 <= pendingFBOReset) {
@@ -398,18 +398,18 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
pendingFBOReset = -1;
}
}
-
+
private final void swapFBOImpl(GLContext glc) {
final GL gl = glc.getGL();
fbos[fboIBack].markUnbound(); // fast path, use(gl,..) is called below
-
+
if(DEBUG) {
int _fboIFront = ( fboIFront + 1 ) % fbos.length;
if(_fboIFront != fboIBack) { throw new InternalError("XXX: "+_fboIFront+"!="+fboIBack); }
}
fboIFront = fboIBack;
fboIBack = ( fboIBack + 1 ) % fbos.length;
-
+
final Colorbuffer colorbuffer = samples > 0 ? fbos[fboIFront].getSamplingSink() : fbos[fboIFront].getColorbuffer(0);
final TextureAttachment texAttachment;
if(colorbuffer instanceof TextureAttachment) {
@@ -423,12 +423,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
}
gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit);
fbos[fboIFront].use(gl, texAttachment);
-
- /* Included in above use command:
+
+ /* Included in above use command:
gl.glBindFramebuffer(GL2GL3.GL_DRAW_FRAMEBUFFER, fbos[fboIBack].getDrawFramebuffer());
gl.glBindFramebuffer(GL2GL3.GL_READ_FRAMEBUFFER, fbos[fboIFront].getReadFramebuffer());
} */
-
+
if(DEBUG_SWAP) {
System.err.println("Post FBO swap(X): fboI back "+fboIBack+", front "+fboIFront+", num "+fbos.length);
}
@@ -436,62 +436,62 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
//
// GLFBODrawable
- //
-
+ //
+
@Override
public final boolean isInitialized() {
return initialized;
}
-
+
@Override
public final void resetSize(GL gl) throws GLException {
reset(gl, samples);
- }
-
+ }
+
@Override
public final int getTextureUnit() { return texUnit; }
-
+
@Override
public final void setTextureUnit(int u) { texUnit = u; }
-
+
@Override
public final int getNumSamples() { return samples; }
-
+
@Override
public void setNumSamples(GL gl, int newSamples) throws GLException {
if(samples != newSamples) {
reset(gl, newSamples);
}
}
-
+
@Override
public final int setNumBuffers(int bufferCount) throws GLException {
// FIXME: Implement
return bufferCount;
}
-
+
@Override
public final int getNumBuffers() {
return bufferCount;
}
-
+
/** // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
@Override
public final DoubleBufferMode getDoubleBufferMode() {
return doubleBufferMode;
}
-
+
@Override
public final void setDoubleBufferMode(DoubleBufferMode mode) throws GLException {
if(initialized) {
throw new GLException("Not allowed past initialization: "+this);
- }
+ }
final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities();
if(0 == samples && caps.getDoubleBuffered() && DoubleBufferMode.NONE != mode) {
doubleBufferMode = mode;
}
} */
-
+
@Override
public FBObject getFBObject(int bufferName) throws IllegalArgumentException {
if(!initialized) {
@@ -509,12 +509,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
case GL.GL_BACK:
res = fbos[fboIBack];
break;
- default:
+ default:
throw new IllegalArgumentException(illegalBufferName+toHexString(bufferName));
- }
- return res;
+ }
+ return res;
}
-
+
@Override
public final TextureAttachment getTextureBuffer(int bufferName) throws IllegalArgumentException {
if(!initialized) {
@@ -536,13 +536,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
res = (TextureAttachment) fbos[fboIBack].getColorbuffer(0);
}
break;
- default:
+ default:
throw new IllegalArgumentException(illegalBufferName+toHexString(bufferName));
- }
- return res;
+ }
+ return res;
}
private static final String illegalBufferName = "Only GL_FRONT and GL_BACK buffer are allowed, passed ";
-
+
@Override
public String toString() {
return getClass().getSimpleName()+"[Initialized "+initialized+", realized "+isRealized()+", texUnit "+texUnit+", samples "+samples+
@@ -555,13 +555,13 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
",\n\tSurface "+getNativeSurface()+
"]";
}
-
+
public static class ResizeableImpl extends GLFBODrawableImpl implements GLFBODrawable.Resizeable {
- protected ResizeableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, ProxySurface surface,
+ protected ResizeableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, ProxySurface surface,
GLCapabilitiesImmutable fboCaps, int textureUnit) {
super(factory, parent, surface, fboCaps, textureUnit);
}
-
+
@Override
public final void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException {
if(DEBUG) {
@@ -572,7 +572,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
throw new NativeWindowException("Could not lock surface: "+this);
}
try {
- // propagate new size
+ // propagate new size
final ProxySurface ps = (ProxySurface) getNativeSurface();
final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook();
if(ush instanceof UpstreamSurfaceHook.MutableSize) {
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
index d54da4d28..702fb77de 100644
--- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
@@ -85,12 +85,12 @@ public class GLGraphicsConfigurationUtil {
}
if(isFBO) {
winattrbits |= FBO_BIT;
- }
+ }
if(isPBuffer ){
winattrbits |= PBUFFER_BIT;
- }
+ }
if(isBitmap) {
- winattrbits |= BITMAP_BIT;
+ winattrbits |= BITMAP_BIT;
}
return winattrbits;
}
@@ -110,7 +110,7 @@ public class GLGraphicsConfigurationUtil {
} else if(isPBuffer ){
winattrbits = PBUFFER_BIT;
} else if(isBitmap) {
- winattrbits = BITMAP_BIT;
+ winattrbits = BITMAP_BIT;
} else {
throw new InternalError("Empty bitmask");
}
@@ -136,9 +136,9 @@ public class GLGraphicsConfigurationUtil {
caps.setHardwareAccelerated(false);
}
- return caps;
+ return caps;
}
-
+
/**
* Fixes the requested {@link GLCapabilitiesImmutable} according to on- and offscreen usage.
*
@@ -150,17 +150,17 @@ public class GLGraphicsConfigurationUtil {
* @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}.
* @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance.
*/
- public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested,
+ public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested,
GLDrawableFactory factory, AbstractGraphicsDevice device) {
if( !capsRequested.isOnscreen() ) {
return fixOffscreenGLCapabilities(capsRequested, factory, device);
}
return capsRequested;
}
-
+
public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(GLCapabilitiesImmutable capsRequested)
{
- if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) {
+ if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) {
// fix caps ..
final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
caps2.setBitmap (false);
@@ -174,7 +174,7 @@ public class GLGraphicsConfigurationUtil {
public static GLCapabilitiesImmutable fixOffscreenBitOnly(GLCapabilitiesImmutable capsRequested)
{
- if( capsRequested.isOnscreen() ) {
+ if( capsRequested.isOnscreen() ) {
// fix caps ..
final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
caps2.setOnscreen(false);
@@ -182,7 +182,7 @@ public class GLGraphicsConfigurationUtil {
}
return capsRequested;
}
-
+
/**
* Fixes the requested {@link GLCapabilitiesImmutable} according to:
*
@@ -203,15 +203,15 @@ public class GLGraphicsConfigurationUtil {
final GLProfile glp = capsRequested.getGLProfile();
final boolean fboAvailable = GLContext.isFBOAvailable(device, glp);
final boolean pbufferAvailable = factory.canCreateGLPbuffer(device, glp);
-
+
final GLRendererQuirks glrq = factory.getRendererQuirks(device);
final boolean bitmapAvailable;
final boolean doubleBufferAvailable;
-
+
if(null != glrq) {
bitmapAvailable = !glrq.exist(GLRendererQuirks.NoOffscreenBitmap);
if( capsRequested.getDoubleBuffered() &&
- ( capsRequested.isPBuffer() && glrq.exist(GLRendererQuirks.NoDoubleBufferedPBuffer) ) ||
+ ( capsRequested.isPBuffer() && glrq.exist(GLRendererQuirks.NoDoubleBufferedPBuffer) ) ||
( capsRequested.isBitmap() && glrq.exist(GLRendererQuirks.NoDoubleBufferedBitmap) ) ) {
doubleBufferAvailable = false;
} else {
@@ -221,25 +221,25 @@ public class GLGraphicsConfigurationUtil {
bitmapAvailable = true;
doubleBufferAvailable = true;
}
-
- final boolean auto = !( fboAvailable && capsRequested.isFBO() ) &&
- !( pbufferAvailable && capsRequested.isPBuffer() ) &&
+
+ final boolean auto = !( fboAvailable && capsRequested.isFBO() ) &&
+ !( pbufferAvailable && capsRequested.isPBuffer() ) &&
!( bitmapAvailable && capsRequested.isBitmap() ) ;
final boolean useFBO = fboAvailable && ( auto || capsRequested.isFBO() ) ;
final boolean usePbuffer = !useFBO && pbufferAvailable && ( auto || capsRequested.isPBuffer() ) ;
final boolean useBitmap = !useFBO && !usePbuffer && bitmapAvailable && ( auto || capsRequested.isBitmap() ) ;
-
+
if( capsRequested.isOnscreen() ||
- useFBO != capsRequested.isFBO() ||
- usePbuffer != capsRequested.isPBuffer() ||
+ useFBO != capsRequested.isFBO() ||
+ usePbuffer != capsRequested.isPBuffer() ||
useBitmap != capsRequested.isBitmap() ||
!doubleBufferAvailable && capsRequested.getDoubleBuffered() )
{
// fix caps ..
final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
caps2.setOnscreen(false);
- caps2.setFBO( useFBO );
+ caps2.setFBO( useFBO );
caps2.setPBuffer( usePbuffer );
caps2.setBitmap( useBitmap );
if( !doubleBufferAvailable ) {
@@ -253,8 +253,8 @@ public class GLGraphicsConfigurationUtil {
public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(GLCapabilitiesImmutable capsRequested)
{
if( capsRequested.isOnscreen() ||
- !capsRequested.isPBuffer() ||
- capsRequested.isFBO() )
+ !capsRequested.isPBuffer() ||
+ capsRequested.isFBO() )
{
// fix caps ..
final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
@@ -277,7 +277,7 @@ public class GLGraphicsConfigurationUtil {
}
return capsRequested;
}
-
+
/** Fix double buffered setting */
public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(GLCapabilitiesImmutable capsRequested, boolean doubleBuffered)
{
@@ -288,7 +288,7 @@ public class GLGraphicsConfigurationUtil {
}
return capsRequested;
}
-
+
public static GLCapabilitiesImmutable clipRGBAGLCapabilities(GLCapabilitiesImmutable caps, boolean allowRGB555, boolean allowAlpha)
{
final int iR = caps.getRedBits();
@@ -305,21 +305,21 @@ public class GLGraphicsConfigurationUtil {
caps2.setGreenBits(oG);
caps2.setBlueBits(oB);
caps2.setAlphaBits(oA);
- return caps2;
+ return caps2;
}
return caps;
}
-
+
public static int clipColor(final int compIn, final boolean allowRGB555) {
final int compOut;
if( 5 < compIn || !allowRGB555 ) {
- compOut = 8;
+ compOut = 8;
} else {
compOut = 5;
- }
+ }
return compOut;
}
-
+
public static GLCapabilitiesImmutable fixGLProfile(GLCapabilitiesImmutable caps, GLProfile glp)
{
if( caps.getGLProfile() != glp ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
index 6d9116303..a22454d60 100644
--- a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -42,10 +42,10 @@ import com.jogamp.opengl.GLAutoDrawableDelegate;
import jogamp.opengl.GLFBODrawableImpl;
public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implements GLOffscreenAutoDrawable {
-
+
/**
* @param drawable a valid {@link GLDrawable}, may not be {@link GLDrawable#isRealized() realized} yet.
- * @param context a valid {@link GLContext},
+ * @param context a valid {@link GLContext},
* may not have been made current (created) yet,
* may not be associated w/ drawable yet,
* may be null for lazy initialization
@@ -55,16 +55,16 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public GLOffscreenAutoDrawableImpl(GLDrawable drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
super(drawable, context, upstreamWidget, true, lock);
}
-
+
@Override
public void setSize(int newWidth, int newHeight) throws NativeWindowException, GLException {
this.defaultWindowResizedOp(newWidth, newHeight);
}
-
- public static class FBOImpl extends GLOffscreenAutoDrawableImpl implements GLOffscreenAutoDrawable.FBO {
+
+ public static class FBOImpl extends GLOffscreenAutoDrawableImpl implements GLOffscreenAutoDrawable.FBO {
/**
* @param drawable a valid {@link GLDrawable}, may not be {@link GLDrawable#isRealized() realized} yet.
- * @param context a valid {@link GLContext},
+ * @param context a valid {@link GLContext},
* may not have been made current (created) yet,
* may not be associated w/ drawable yet,
* may be null for lazy initialization
@@ -74,7 +74,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public FBOImpl(GLFBODrawableImpl drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
super(drawable, context, upstreamWidget, lock);
}
-
+
@Override
public boolean isInitialized() {
return ((GLFBODrawableImpl)drawable).isInitialized();
@@ -84,7 +84,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public final int getTextureUnit() {
return ((GLFBODrawableImpl)drawable).getTextureUnit();
}
-
+
@Override
public final void setTextureUnit(int unit) {
((GLFBODrawableImpl)drawable).setTextureUnit(unit);
@@ -94,23 +94,23 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
public final int getNumSamples() {
return ((GLFBODrawableImpl)drawable).getNumSamples();
}
-
+
@Override
public final void setNumSamples(GL gl, int newSamples) throws GLException {
((GLFBODrawableImpl)drawable).setNumSamples(gl, newSamples);
windowRepaintOp();
}
-
+
@Override
public final int setNumBuffers(int bufferCount) throws GLException {
return ((GLFBODrawableImpl)drawable).setNumBuffers(bufferCount);
}
-
+
@Override
public final int getNumBuffers() {
return ((GLFBODrawableImpl)drawable).getNumBuffers();
}
-
+
/** // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
@Override
public DoubleBufferMode getDoubleBufferMode() {
@@ -119,14 +119,14 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
@Override
public void setDoubleBufferMode(DoubleBufferMode mode) throws GLException {
- ((GLFBODrawableImpl)drawable).setDoubleBufferMode(mode);
+ ((GLFBODrawableImpl)drawable).setDoubleBufferMode(mode);
} */
-
+
@Override
- public final FBObject getFBObject(int bufferName) {
+ public final FBObject getFBObject(int bufferName) {
return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
}
-
+
public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
}
@@ -134,6 +134,6 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
@Override
public void resetSize(GL gl) throws GLException {
((GLFBODrawableImpl)drawable).resetSize(gl);
- }
+ }
}
}
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
index b8841d6e2..c32957b86 100644
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
@@ -51,7 +51,7 @@ import com.jogamp.common.util.locks.RecursiveLock;
public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContextImpl pbufferContext) {
- super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
+ super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
}
//
@@ -60,26 +60,26 @@ public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
//
// GLDrawable delegation
- //
-
+ //
+
@Override
public final void swapBuffers() throws GLException {
defaultSwapBuffers();
}
-
+
//
// GLAutoDrawable completion
//
private final RecursiveLock lock = LockFactory.createRecursiveLock(); // instance wide lock
-
+
@Override
protected final RecursiveLock getLock() { return lock; }
-
+
@Override
public final Object getUpstreamWidget() {
return null;
}
-
+
@Override
public void destroy() {
defaultDestroy();
@@ -92,7 +92,7 @@ public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
@Override
public final void display() {
- final RecursiveLock _lock = lock;
+ final RecursiveLock _lock = lock;
_lock.lock(); // sync: context/drawable could been recreated/destroyed while animating
try {
if( null != context ) {
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 244a3fd79..2238d49bc 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl;
import javax.media.opengl.GLRunnable;
@@ -86,41 +86,41 @@ public class GLRunnableTask implements GLRunnable {
}
return res;
}
-
- /**
+
+ /**
* Simply flush this task and notify a waiting executor.
* The executor which might have been blocked until notified
* will be unblocked and the task removed from the queue.
- *
+ *
* @see #isFlushed()
* @see #isInQueue()
- */
+ */
public void flush() {
if(!isExecuted() && null != notifyObject) {
synchronized (notifyObject) {
isFlushed=true;
- notifyObject.notifyAll();
+ notifyObject.notifyAll();
}
}
}
-
+
/**
* @return !{@link #isExecuted()} && !{@link #isFlushed()}
*/
public boolean isInQueue() { return !isExecuted && !isFlushed; }
-
+
/**
* @return whether this task has been executed.
* @see #isInQueue()
*/
public boolean isExecuted() { return isExecuted; }
-
+
/**
* @return whether this task has been flushed.
* @see #isInQueue()
*/
public boolean isFlushed() { return isFlushed; }
-
+
public Throwable getThrowable() { return runnableException; }
}
diff --git a/src/jogl/classes/jogamp/opengl/GLStateTracker.java b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
index 01c3716e0..307fd0a15 100644
--- a/src/jogl/classes/jogamp/opengl/GLStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -53,47 +53,47 @@ import java.util.ArrayList;
* Currently supported states: PixelStorei
*/
public class GLStateTracker {
-
- /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */
+
+ /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */
public static final int MIN_CLIENT_ATTRIB_STACK_DEPTH = 16;
-
+
/** static size of pixel state map */
static final int PIXEL_STATE_MAP_SIZE = 16;
/** avoid rehash of static size pixel state map */
static final int PIXEL_STATE_MAP_CAPACITY = 32;
-
+
private volatile boolean enabled = true;
private IntIntHashMap pixelStateMap;
private final ArrayList stack;
-
+
private static class SavedState {
/**
* Empty pixel-store state
- */
+ */
private IntIntHashMap pixelStateMap;
-
+
/**
* set (client) pixel-store state, deep copy
- */
+ */
private final void setPixelStateMap(IntIntHashMap pixelStateMap) {
this.pixelStateMap = (IntIntHashMap) pixelStateMap.clone();
}
-
+
/**
* get (client) pixel-store state, return reference
- */
+ */
private final IntIntHashMap getPixelStateMap() { return pixelStateMap; }
}
-
- public GLStateTracker() {
+
+ public GLStateTracker() {
pixelStateMap = new IntIntHashMap(PIXEL_STATE_MAP_CAPACITY, 0.75f);
pixelStateMap.setKeyNotFoundValue(0xFFFFFFFF);
resetStates();
-
+
stack = new ArrayList(MIN_CLIENT_ATTRIB_STACK_DEPTH);
}
@@ -102,18 +102,18 @@ public class GLStateTracker {
}
public final void setEnabled(boolean on) {
- enabled = on;
+ enabled = on;
}
public final boolean isEnabled() {
return enabled;
}
- /** @return true if found in our map, otherwise false,
+ /** @return true if found in our map, otherwise false,
* which forces the caller to query GL. */
public final boolean getInt(int pname, int[] params, int params_offset) {
if(enabled) {
- final int value = pixelStateMap.get(pname);
+ final int value = pixelStateMap.get(pname);
if(0xFFFFFFFF != value) {
params[params_offset] = value;
return true;
@@ -122,7 +122,7 @@ public class GLStateTracker {
return false;
}
- /** @return true if found in our map, otherwise false,
+ /** @return true if found in our map, otherwise false,
* which forces the caller to query GL. */
public final boolean getInt(int pname, IntBuffer params, int dummy) {
if(enabled) {
@@ -158,7 +158,7 @@ public class GLStateTracker {
throw new GLException("stack contains no elements");
}
SavedState state = stack.remove(stack.size()-1); // pop
-
+
if(null==state) {
throw new GLException("null stack element (remaining stack size "+stack.size()+")");
}
@@ -166,7 +166,7 @@ public class GLStateTracker {
if ( null != state.getPixelStateMap() ) {
// use pulled client pixel-store state from stack
pixelStateMap = state.getPixelStateMap();
- } // else: empty-slot, not pushed by GL_CLIENT_PIXEL_STORE_BIT
+ } // else: empty-slot, not pushed by GL_CLIENT_PIXEL_STORE_BIT
}
}
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
index e4187b35b..431c1a387 100644
--- a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
+++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
@@ -43,9 +43,9 @@ public class GLVersionNumber extends VersionNumberString {
super(val[0], val[1], val[2], strEnd, state, versionString);
this.valid = valid;
}
-
+
private static java.util.regex.Pattern getUnderscorePattern() {
- if( null == _Pattern ) { // volatile dbl-checked-locking OK
+ if( null == _Pattern ) { // volatile dbl-checked-locking OK
synchronized( VersionNumber.class ) {
if( null == _Pattern ) {
_Pattern = getVersionNumberPattern("_");
@@ -55,7 +55,7 @@ public class GLVersionNumber extends VersionNumberString {
return _Pattern;
}
private static volatile java.util.regex.Pattern _Pattern = null;
-
+
public static final GLVersionNumber create(String versionString) {
int[] val = new int[] { 0, 0, 0 };
int strEnd = 0;
@@ -73,7 +73,7 @@ public class GLVersionNumber extends VersionNumberString {
strEnd = version.endOfStringMatch();
val[0] = version.getMajor();
val[1] = version.getMinor();
- state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
+ state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
( version.hasMinor() ? VersionNumber.HAS_MINOR : (short)0 ) );
valid = version.hasMajor() && version.hasMinor(); // Requires at least a defined major and minor version component!
} catch (Exception e) {
@@ -82,16 +82,16 @@ public class GLVersionNumber extends VersionNumberString {
val[0] = 1;
val[1] = 0;
}
- }
+ }
return new GLVersionNumber(val, strEnd, state, versionString, valid);
}
public final boolean isValid() {
return valid;
}
-
- /**
- * Returns the optional vendor version at the end of the
+
+ /**
+ * Returns the optional vendor version at the end of the
* GL_VERSION string if exists, otherwise the {@link VersionNumberString#zeroVersion zero version} instance.
*
* 2.1 Mesa 7.0.3-rc2 -> 7.0.3 (7.0.3-rc2)
@@ -105,14 +105,14 @@ public class GLVersionNumber extends VersionNumberString {
if (versionString == null || versionString.length() <= 0) {
return null;
}
-
+
// Skip the 1st GL version
String str;
{
final GLVersionNumber glv = create(versionString);
str = versionString.substring(glv.endOfStringMatch()).trim();
}
-
+
while ( str.length() > 0 ) {
final VersionNumberString version = new VersionNumberString(str, getDefaultVersionNumberPattern());
final int eosm = version.endOfStringMatch();
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 112dfcb64..979c6dc0a 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -67,7 +67,7 @@ public class GLWorkerThread {
private static volatile Runnable work;
// Queue of Runnables to be asynchronously invoked
private static List queue = new ArrayList();
-
+
/** Should only be called by Threading class if creation of the
GLWorkerThread was requested via the opengl.1thread system
property.
@@ -149,7 +149,7 @@ public class GLWorkerThread {
}
}
- public static void invoke(boolean wait, Runnable runnable)
+ public static void invoke(boolean wait, Runnable runnable)
throws InvocationTargetException, InterruptedException {
if(wait) {
invokeAndWait(runnable);
@@ -157,7 +157,7 @@ public class GLWorkerThread {
invokeLater(runnable);
}
}
-
+
public static void invokeAndWait(Runnable runnable)
throws InvocationTargetException, InterruptedException {
if (!started) {
@@ -220,7 +220,7 @@ public class GLWorkerThread {
}
protected static String getThreadName() { return Thread.currentThread().getName(); }
-
+
static class WorkerRunnable implements Runnable {
public void run() {
// Notify starting thread that we're ready
@@ -244,7 +244,7 @@ public class GLWorkerThread {
break;
}
}
-
+
if (shouldTerminate) {
lock.notifyAll();
thread = null;
diff --git a/src/jogl/classes/jogamp/opengl/GLXExtensions.java b/src/jogl/classes/jogamp/opengl/GLXExtensions.java
index 36c6c4665..9325c6f68 100644
--- a/src/jogl/classes/jogamp/opengl/GLXExtensions.java
+++ b/src/jogl/classes/jogamp/opengl/GLXExtensions.java
@@ -28,9 +28,9 @@
package jogamp.opengl;
/**
- * Class holding GLX/WGL/.. extension strings, commonly used by JOGL's implementation.
+ * Class holding GLX/WGL/.. extension strings, commonly used by JOGL's implementation.
*/
-public class GLXExtensions {
+public class GLXExtensions {
public static final String GLX_MESA_swap_control = "GLX_MESA_swap_control";
public static final String GLX_SGI_swap_control = "GLX_SGI_swap_control";
public static final String GLX_NV_swap_group = "GLX_NV_swap_group";
diff --git a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
index 1cde551be..a64a2f5cd 100644
--- a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
+++ b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
@@ -33,9 +33,9 @@ import java.util.ArrayList;
/**
* Simple locked listener implementation stub to be used for listener handler,
* synchronized on it's instance.
- *
+ *
*
Utilizing simple locking via synchronized.
- *
+ *
* @param The listener type
*/
public class ListenerSyncedImplStub {
@@ -48,7 +48,7 @@ public class ListenerSyncedImplStub {
public synchronized final void reset() {
listeners = new ArrayList();
}
-
+
public synchronized final void destroy() {
listeners.clear();
listeners = null;
@@ -57,7 +57,7 @@ public class ListenerSyncedImplStub {
public synchronized final int size() {
return listeners.size();
}
-
+
public synchronized final void addListener(E listener) {
addListener(-1, listener);
}
@@ -68,12 +68,12 @@ public class ListenerSyncedImplStub {
}
listeners.add(index, listener);
}
-
+
public synchronized final void removeListener(E listener) {
listeners.remove(listener);
}
public final ArrayList getListeners() {
return listeners;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
index 439ddc76e..d4fd1c935 100644
--- a/src/jogl/classes/jogamp/opengl/ProjectFloat.java
+++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
@@ -6,9 +6,9 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
** except that Section 2.2 and 11 are omitted. Any differences between
** the Alternative License and the SGI License are offered solely by Sun
** and not by SGI.
-**
+**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,34 +45,34 @@
** $Header$
*/
-/*
+/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
- * * Neither the name of 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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 THE COPYRIGHT OWNER 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
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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
+ * 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.
*/
@@ -80,22 +80,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2011 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:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -108,7 +108,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -129,14 +129,14 @@ import com.jogamp.opengl.math.FloatUtil;
*
* Created 11-jan-2004
*
- *
+ *
* @author Erik Duijs
* @author Kenneth Russell
* @author Sven Gothel
*/
public class ProjectFloat {
public static final int getRequiredFloatBufferSize() { return 1*16; }
-
+
// Note that we have cloned parts of the implementation in order to
// support incoming Buffers. The reason for this is to avoid loading
// non-direct buffer subclasses unnecessarily, because doing so can
@@ -162,22 +162,22 @@ public class ProjectFloat {
public ProjectFloat() {
this(true);
}
-
+
public ProjectFloat(boolean useBackingArray) {
- this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT),
- useBackingArray ? new float[getRequiredFloatBufferSize()] : null,
+ this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT),
+ useBackingArray ? new float[getRequiredFloatBufferSize()] : null,
0);
}
/**
* @param floatBuffer source buffer, may be ByteBuffer (recommended) or FloatBuffer or null.
- * If used, shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
+ * If used, shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
* Buffer's position is ignored and floatPos is being used.
* @param floatArray source float array or null.
* If used, size shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
* @param floatOffset Offset for either of the given sources (buffer or array)
*/
- public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {
+ public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {
matrixBuf = Buffers.slice2Float(floatBuffer, floatArray, floatOffset, 16);
}
@@ -259,7 +259,7 @@ public class ProjectFloat {
/**
* @param src
* @param inverse
- *
+ *
* @return
*/
public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
@@ -268,7 +268,7 @@ public class ProjectFloat {
final int srcPos = src.position();
final int invPos = inverse.position();
-
+
final float[][] temp = tempInvertMatrix;
for (i = 0; i < 4; i++) {
@@ -297,7 +297,7 @@ public class ProjectFloat {
t = temp[i][k];
temp[i][k] = temp[swap][k];
temp[swap][k] = t;
-
+
t = inverse.get(i*4+k + invPos);
inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
inverse.put(swap*4+k + invPos, t);
@@ -335,7 +335,7 @@ public class ProjectFloat {
/**
* Method gluOrtho2D.
- *
+ *
* @param left
* @param right
* @param bottom
@@ -347,7 +347,7 @@ public class ProjectFloat {
/**
* Method gluPerspective.
- *
+ *
* @param fovy
* @param aspect
* @param zNear
@@ -380,7 +380,7 @@ public class ProjectFloat {
/**
* Method gluLookAt
- *
+ *
* @param eyex
* @param eyey
* @param eyez
@@ -436,7 +436,7 @@ public class ProjectFloat {
/**
* Map object coordinates to window coordinates.
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -444,7 +444,7 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(float objx, float objy, float objz,
@@ -518,13 +518,13 @@ public class ProjectFloat {
win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
win_pos[2+win_pos_offset] = in[2];
-
+
return true;
}
-
+
/**
* Map object coordinates to window coordinates.
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -532,7 +532,7 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(float objx, float objy, float objz,
@@ -576,7 +576,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -584,7 +584,7 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(float winx, float winy, float winz,
@@ -633,7 +633,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -646,7 +646,7 @@ public class ProjectFloat {
* @return
*/
public boolean gluUnProject(float winx, float winy, float winz,
- FloatBuffer modelMatrix,
+ FloatBuffer modelMatrix,
FloatBuffer projMatrix,
int[] viewport, int viewport_offset,
float[] obj_pos, int obj_pos_offset) {
@@ -674,7 +674,7 @@ public class ProjectFloat {
in[2] = in[2] * 2 - 1;
FloatUtil.multMatrixVecf(matrixBuf, in, out);
-
+
if (out[3] == 0.0) {
return false;
}
@@ -687,10 +687,10 @@ public class ProjectFloat {
return true;
}
-
+
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -698,11 +698,11 @@ public class ProjectFloat {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(float winx, float winy, float winz,
- FloatBuffer modelMatrix,
+ FloatBuffer modelMatrix,
FloatBuffer projMatrix,
IntBuffer viewport,
FloatBuffer obj_pos) {
@@ -722,7 +722,7 @@ public class ProjectFloat {
// Map x and y from window coordinates
final int vPos = viewport.position();
- final int oPos = obj_pos.position();
+ final int oPos = obj_pos.position();
in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
@@ -749,7 +749,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -760,7 +760,7 @@ public class ProjectFloat {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(float winx,
@@ -815,7 +815,7 @@ public class ProjectFloat {
/**
* Map window coordinates to object coordinates.
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -826,7 +826,7 @@ public class ProjectFloat {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(float winx,
@@ -857,7 +857,7 @@ public class ProjectFloat {
in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
in[2] = (in[2] - near) / (far - near);
-
+
// Map to range -1 to 1
in[0] = in[0] * 2 - 1;
in[1] = in[1] * 2 - 1;
@@ -873,14 +873,14 @@ public class ProjectFloat {
obj_pos.put(0+oPos, out[0]);
obj_pos.put(1+oPos, out[1]);
obj_pos.put(2+oPos, out[2]);
- obj_pos.put(3+oPos, out[3]);
+ obj_pos.put(3+oPos, out[3]);
return true;
}
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
@@ -907,7 +907,7 @@ public class ProjectFloat {
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index e5f5ee09a..eddb36975 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -52,30 +52,30 @@ public class SharedResourceRunner implements Runnable {
*
* Called within synchronized block.
*
- * @param connection for creation a {@link AbstractGraphicsDevice} instance.
- * @return true if the device supports all protocols required for the implementation, otherwise false.
+ * @param connection for creation a {@link AbstractGraphicsDevice} instance.
+ * @return true if the device supports all protocols required for the implementation, otherwise false.
*/
boolean isDeviceSupported(String connection);
-
+
/**
*
* Called within synchronized block.
*
- * @param connection for creation a {@link AbstractGraphicsDevice} instance.
- * @return A new shared resource instance
+ * @param connection for creation a {@link AbstractGraphicsDevice} instance.
+ * @return A new shared resource instance
*/
Resource createSharedResource(String connection);
-
- /** Called within synchronized block. */
+
+ /** Called within synchronized block. */
void releaseSharedResource(Resource shared);
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
void clear();
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
Resource mapPut(String connection, Resource resource);
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
Resource mapGet(String connection);
- /** Called within synchronized block. */
+ /** Called within synchronized block. */
Collection mapValues();
}
@@ -103,7 +103,7 @@ public class SharedResourceRunner implements Runnable {
this.impl = impl;
resetState();
}
-
+
private void resetState() { // synchronized call
devicesTried.clear();
thread = null;
@@ -114,12 +114,12 @@ public class SharedResourceRunner implements Runnable {
releaseConnection = null;
}
- /**
+ /**
* Start the shared resource runner thread, if not running.
*
* Validate the thread upfront and release all related resource if it was killed.
*
- *
+ *
* @return the shared resource runner thread.
*/
public Thread start() {
@@ -132,7 +132,7 @@ public class SharedResourceRunner implements Runnable {
releaseSharedResources();
thread = null;
running = false;
- }
+ }
if( null == thread ) {
if (DEBUG) {
System.err.println("SharedResourceRunner.start() - start new Thread - "+getThreadName());
@@ -150,7 +150,7 @@ public class SharedResourceRunner implements Runnable {
}
return thread;
}
-
+
public void stop() {
synchronized (this) {
if(null != thread) {
@@ -160,7 +160,7 @@ public class SharedResourceRunner implements Runnable {
synchronized (this) {
shouldRelease = true;
this.notifyAll();
-
+
while (running) {
try {
this.wait();
@@ -170,7 +170,7 @@ public class SharedResourceRunner implements Runnable {
}
}
}
-
+
public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
SharedResourceRunner.Resource sr = null;
if(null != device) {
@@ -203,7 +203,7 @@ public class SharedResourceRunner implements Runnable {
if(null != device) {
synchronized (this) {
final String connection = device.getConnection();
- sr = impl.mapGet(connection);
+ sr = impl.mapGet(connection);
if (null != sr) {
removeDeviceTried(connection);
if (DEBUG) {
@@ -261,7 +261,7 @@ public class SharedResourceRunner implements Runnable {
synchronized (this) {
running = true;
-
+
while (!shouldRelease) {
try {
// wait for stop or init
@@ -271,7 +271,7 @@ public class SharedResourceRunner implements Runnable {
}
notifyAll();
this.wait();
- } catch (InterruptedException ex) {
+ } catch (InterruptedException ex) {
shouldRelease = true;
if(DEBUG) {
System.err.println("SharedResourceRunner.run(): INTERRUPTED - "+threadName);
@@ -311,7 +311,7 @@ public class SharedResourceRunner implements Runnable {
} catch (Exception e) {
e.printStackTrace();
}
- }
+ }
}
}
initConnection = null;
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index d55a2c976..6ffe46b36 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.opengl;
@@ -49,14 +49,14 @@ import com.jogamp.common.util.ReflectionUtil;
public class ThreadingImpl {
public enum Mode {
- MT(0), ST_AWT(1), ST_WORKER(2);
-
+ MT(0), ST_AWT(1), ST_WORKER(2);
+
public final int id;
Mode(int id){
this.id = id;
}
- }
+ }
protected static final boolean DEBUG = Debug.debug("Threading");
@@ -68,7 +68,7 @@ public class ThreadingImpl {
private static boolean _isX11;
private static final ToolkitThreadingPlugin threadingPlugin;
-
+
static {
threadingPlugin =
AccessController.doPrivileged(new PrivilegedAction() {
@@ -94,7 +94,7 @@ public class ThreadingImpl {
// default setting
singleThreaded = true;
mode = ( hasAWT ? Mode.ST_AWT : Mode.ST_WORKER );
-
+
if (singleThreadProp != null) {
if (singleThreadProp.equals("true") ||
singleThreadProp.equals("auto")) {
@@ -113,7 +113,7 @@ public class ThreadingImpl {
throw new RuntimeException("Unsupported value for property jogl.1thread: "+singleThreadProp+", should be [true/auto, worker, awt or false]");
}
}
-
+
ToolkitThreadingPlugin threadingPlugin=null;
if(hasAWT) {
// try to fetch the AWTThreadingPlugin
@@ -139,9 +139,9 @@ public class ThreadingImpl {
public static boolean isX11() { return _isX11; }
public static Mode getMode() { return mode; }
- /** If an implementation of the javax.media.opengl APIs offers a
- multithreading option but the default behavior is single-threading,
- this API provides a mechanism for end users to disable single-threading
+ /** If an implementation of the javax.media.opengl APIs offers a
+ multithreading option but the default behavior is single-threading,
+ this API provides a mechanism for end users to disable single-threading
in this implementation. Users are strongly discouraged from
calling this method unless they are aware of all of the
consequences and are prepared to enforce some amount of
@@ -151,7 +151,7 @@ public class ThreadingImpl {
GLPbuffer. Currently there is no supported way to re-enable it
once disabled, partly to discourage careless use of this
method. This method should be called as early as possible in an
- application. */
+ application. */
public static final void disableSingleThreading() {
singleThreaded = false;
if (Debug.verbose()) {
@@ -183,7 +183,7 @@ public class ThreadingImpl {
throw new InternalError("Illegal single-threading mode " + mode);
}
}
-
+
public static final boolean isToolkitThread() throws GLException {
if(null!=threadingPlugin) {
return threadingPlugin.isToolkitThread();
@@ -215,7 +215,7 @@ public class ThreadingImpl {
throw new InternalError("Illegal single-threading mode " + mode);
}
}
-
+
public static final void invokeOnWorkerThread(boolean wait, Runnable r) throws GLException {
GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
try {
@@ -224,6 +224,6 @@ public class ThreadingImpl {
throw new GLException(e.getTargetException());
} catch (InterruptedException e) {
throw new GLException(e);
- }
+ }
}
}
diff --git a/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
index 22972953a..06fb0fe91 100644
--- a/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/ToolkitThreadingPlugin.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 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:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -46,7 +46,7 @@ public interface ToolkitThreadingPlugin {
/** Indicates whether the current thread is the designated toolkit thread,
if such semantics exists. */
public boolean isToolkitThread() throws GLException;
-
+
/** Indicates whether the current thread is the thread on
which this implementation of the javax.media.opengl APIs
performs all of its OpenGL-related work. This method should only
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index 56f00b370..cd1bb45c9 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -57,7 +57,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
public final boolean isToolkitThread() throws GLException {
return EventQueue.isDispatchThread();
}
-
+
public final boolean isOpenGLThread() throws GLException {
switch (ThreadingImpl.getMode()) {
case ST_AWT:
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 9bdceff48..5faee1307 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -67,19 +67,19 @@ import com.jogamp.opengl.util.awt.AWTGLPixelBuffer.AWTGLPixelBufferProvider;
*/
public class AWTTilePainter {
private static final boolean DEBUG_TILES = Debug.debug("TileRenderer.PNG");
-
+
public final TileRenderer renderer;
public final int componentCount;
public final double scaleMatX, scaleMatY;
public final int customTileWidth, customTileHeight, customNumSamples;
public final boolean verbose;
-
+
public boolean flipVertical;
private AWTGLPixelBuffer tBuffer = null;
private BufferedImage vFlipImage = null;
private Graphics2D g2d = null;
- private AffineTransform saveAT = null;
-
+ private AffineTransform saveAT = null;
+
public static void dumpHintsAndScale(Graphics2D g2d) {
final RenderingHints rHints = g2d.getRenderingHints();
final Set> rEntries = rHints.entrySet();
@@ -92,13 +92,13 @@ public class AWTTilePainter {
if( null != aTrans ) {
System.err.println(" type "+aTrans.getType());
System.err.println(" scale "+aTrans.getScaleX()+" x "+aTrans.getScaleY());
- System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());
+ System.err.println(" move "+aTrans.getTranslateX()+" x "+aTrans.getTranslateY());
System.err.println(" mat "+aTrans);
} else {
System.err.println(" null transform");
}
}
-
+
/**
* @return resulting number of samples by comparing w/ {@link #customNumSamples} and the caps-config, 0 if disabled
*/
@@ -114,12 +114,12 @@ public class AWTTilePainter {
return caps.getNumSamples();
}
}
-
- /**
+
+ /**
* Assumes a configured {@link TileRenderer}, i.e.
* an {@link TileRenderer#attachAutoDrawable(GLAutoDrawable) attached}
* {@link GLAutoDrawable} with {@link TileRenderer#setTileSize(int, int, int) set tile size}.
- *
+ *
* Sets the renderer to {@link TileRenderer#TR_TOP_TO_BOTTOM} row order.
*
*
@@ -129,7 +129,7 @@ public class AWTTilePainter {
* @param componentCount
* @param scaleMatX {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatX * width pixels
* @param scaleMatY {@link Graphics2D} {@link Graphics2D#scale(double, double) scaling factor}, i.e. rendering 1/scaleMatY * height pixels
- * @param numSamples custom multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
+ * @param numSamples custom multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
* @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
* @param verbose
@@ -146,13 +146,13 @@ public class AWTTilePainter {
this.verbose = verbose;
this.flipVertical = true;
}
-
+
public String toString() { return renderer.toString(); }
-
+
public void setIsGLOriented(boolean v) {
flipVertical = v;
}
-
+
private static Rectangle2D getClipBounds2D(Graphics2D g) {
final Shape shape = g.getClip();
return null != shape ? shape.getBounds2D() : null;
@@ -170,7 +170,7 @@ public class AWTTilePainter {
}
return new Rectangle2D.Double(x, y, width, height);
}
-
+
/**
* Caches the {@link Graphics2D} instance for rendering.
*
@@ -201,9 +201,9 @@ public class AWTTilePainter {
final Rectangle2D dClipOrigR = getClipBounds2D(g2d);
final Rectangle2D dClipOrig = clipNegative(dClipOrigR);
final Rectangle2D dImageSizeOrig = new Rectangle2D.Double(0, 0, width, height);
-
+
// Retrieve scaled image-size and clip-bounds
- // Note: Clip bounds lie within image-size!
+ // Note: Clip bounds lie within image-size!
final Rectangle2D dImageSizeScaled, dClipScaled;
{
final AffineTransform scaledATI;
@@ -230,10 +230,10 @@ public class AWTTilePainter {
// GL y-offset is lower-left origin, AWT y-offset upper-left.
scaledYOffset = iClipScaled.y;
renderer.setTileOffset(iClipScaled.x, iImageSizeScaled.height - ( iClipScaled.y + clipH ));
-
+
// Scale actual Grahics2D matrix
g2d.scale(scaleMatX, scaleMatY);
-
+
if( verbose ) {
System.err.println("AWT print.0: image "+dImageSizeOrig + " -> " + dImageSizeScaled + " -> " + iImageSizeScaled);
System.err.println("AWT print.0: clip "+dClipOrigR + " -> " + dClipOrig + " -> " + dClipScaled + " -> " + iClipScaled);
@@ -241,12 +241,12 @@ public class AWTTilePainter {
}
}
private int scaledYOffset;
-
+
/** See {@ #setupGraphics2DAndClipBounds(Graphics2D)}. */
- public void resetGraphics2D() {
+ public void resetGraphics2D() {
g2d.setTransform(saveAT);
}
-
+
/**
* Disposes resources and {@link TileRenderer#detachAutoDrawable() detaches}
* the {@link TileRenderer}'s {@link GLAutoDrawable}.
@@ -263,7 +263,7 @@ public class AWTTilePainter {
vFlipImage = null;
}
}
-
+
final GLEventListener preTileGLEL = new GLEventListener() {
@Override
public void init(GLAutoDrawable drawable) {}
@@ -275,7 +275,7 @@ public class AWTTilePainter {
if( null == tBuffer ) {
final int tWidth = renderer.getParam(TileRenderer.TR_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRenderer.TR_TILE_HEIGHT);
- final AWTGLPixelBufferProvider printBufferProvider = new AWTGLPixelBufferProvider( true /* allowRowStride */ );
+ final AWTGLPixelBufferProvider printBufferProvider = new AWTGLPixelBufferProvider( true /* allowRowStride */ );
final GLPixelAttributes pixelAttribs = printBufferProvider.getAttributes(gl, componentCount);
tBuffer = printBufferProvider.allocate(gl, pixelAttribs, tWidth, tHeight, 1, true, 0);
renderer.setTileBuffer(tBuffer);
@@ -300,7 +300,7 @@ public class AWTTilePainter {
@Override
public void dispose(GLAutoDrawable drawable) {}
@Override
- public void display(GLAutoDrawable drawable) {
+ public void display(GLAutoDrawable drawable) {
final DimensionImmutable cis = renderer.getClippedImageSize();
final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
@@ -309,26 +309,26 @@ public class AWTTilePainter {
final int imgYOff = flipVertical ? 0 : renderer.getParam(TileRenderer.TR_TILE_HEIGHT) - tHeight; // imgYOff will be cut-off via sub-image
final int pX = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS); // tileX == pX
final int pY = cis.getHeight() - ( tY - tYOff + tHeight ) + scaledYOffset;
-
+
// Copy temporary data into raster of BufferedImage for faster
// blitting Note that we could avoid this copy in the cases
// where !offscreenDrawable.isGLOriented(),
// but that's the software rendering path which is very slow anyway.
final BufferedImage dstImage;
if( DEBUG_TILES ) {
- final String fname = String.format("file_%03d_0_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
- _counter,
+ final String fname = String.format("file_%03d_0_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
+ _counter,
renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
tWidth, tHeight,
pX, tY, tYOff, pX, pY).replace(' ', '_');
System.err.println("XXX file "+fname);
- final File fout = new File(fname);
+ final File fout = new File(fname);
try {
ImageIO.write(tBuffer.image, "png", fout);
} catch (IOException e) {
e.printStackTrace();
}
- }
+ }
if( flipVertical ) {
final BufferedImage srcImage = tBuffer.image;
dstImage = vFlipImage;
@@ -347,20 +347,20 @@ public class AWTTilePainter {
dstImage = tBuffer.image;
}
if( DEBUG_TILES ) {
- final String fname = String.format("file_%03d_1_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
- _counter,
+ final String fname = String.format("file_%03d_1_tile_[%02d][%02d]_sz_%03dx%03d_pos0_%03d_%03d_yOff_%03d_pos1_%03d_%03d.png",
+ _counter,
renderer.getParam(TileRenderer.TR_CURRENT_COLUMN), renderer.getParam(TileRenderer.TR_CURRENT_ROW),
tWidth, tHeight,
pX, tY, tYOff, pX, pY).replace(' ', '_');
System.err.println("XXX file "+fname);
- final File fout = new File(fname);
+ final File fout = new File(fname);
try {
ImageIO.write(dstImage, "png", fout);
} catch (IOException e) {
e.printStackTrace();
}
_counter++;
- }
+ }
// Draw resulting image in one shot
final BufferedImage outImage = dstImage.getSubimage(0, imgYOff, tWidth, tHeight);
final boolean drawDone = g2d.drawImage(outImage, pX, pY, null); // Null ImageObserver since image data is ready.
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
index e15e538c2..dc286ca59 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -85,7 +85,7 @@ public class AWTUtil {
NativeWindowFactory.getAWTToolkitLock().lock();
}
} catch (Exception e) { j2dOk=false; }
- }
+ }
if(!j2dOk) {
NativeWindowFactory.getAWTToolkitLock().lock();
}
@@ -108,7 +108,7 @@ public class AWTUtil {
NativeWindowFactory.getAWTToolkitLock().unlock();
}
} catch (Exception e) { j2dOk=false; }
- }
+ }
if(!j2dOk) {
NativeWindowFactory.getAWTToolkitLock().unlock();
}
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index edf9e89f8..7a8ddf0b4 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,11 +28,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -144,7 +144,7 @@ public class Java2D {
} else {
if (DEBUG) {
System.err.println("Java2D support disabled: by Property "+java2dOGLDisabledByProp+", by OS "+java2dOGLDisabledByOS);
- }
+ }
cfg = null;
cfgName = "nil";
}
@@ -154,8 +154,8 @@ public class Java2D {
System.err.println("Java2D support: default GraphicsConfiguration = " + cfgName);
}
isOGLPipelineActive = cfgName.startsWith("sun.java2d.opengl");
- isOGLPipelineResourceCompatible = isOGLPipelineActive;
-
+ isOGLPipelineResourceCompatible = isOGLPipelineActive;
+
if (isOGLPipelineActive) {
try {
// Try to get methods we need to integrate
@@ -179,19 +179,19 @@ public class Java2D {
Integer.TYPE
});
getOGLViewportMethod.setAccessible(true);
-
+
getOGLScissorBoxMethod = utils.getDeclaredMethod("getOGLScissorBox",
new Class[] {
Graphics.class
});
getOGLScissorBoxMethod.setAccessible(true);
-
+
getOGLSurfaceIdentifierMethod = utils.getDeclaredMethod("getOGLSurfaceIdentifier",
new Class[] {
Graphics.class
});
getOGLSurfaceIdentifierMethod.setAccessible(true);
-
+
// Try to get additional methods required for proper FBO support
fbObjectSupportInitialized = true;
try {
@@ -201,7 +201,7 @@ public class Java2D {
Runnable.class
});
invokeWithOGLSharedContextCurrentMethod.setAccessible(true);
-
+
getOGLSurfaceTypeMethod = utils.getDeclaredMethod("getOGLSurfaceType",
new Class[] {
Graphics.class
@@ -214,7 +214,7 @@ public class Java2D {
System.err.println("Info: Disabling Java2D/JOGL FBO support");
}
}
-
+
// Try to get an additional method for FBO support in recent Mustang builds
try {
getOGLTextureTypeMethod = utils.getDeclaredMethod("getOGLTextureType",
@@ -228,7 +228,7 @@ public class Java2D {
System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
}
}
-
+
// Try to set up APIs for enabling the bridge on OS X,
// where it isn't possible to create generalized
// external GLDrawables
@@ -244,7 +244,7 @@ public class Java2D {
if (cglSurfaceData != null) {
// FIXME: for now, assume that FBO support is not enabled on OS X
fbObjectSupportInitialized = false;
-
+
// We need to find these methods in order to make the bridge work on OS X
createOGLContextOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("createOGLContextOnSurface",
new Class[] {
@@ -252,14 +252,14 @@ public class Java2D {
Long.TYPE
});
createOGLContextOnSurfaceMethod.setAccessible(true);
-
+
makeOGLContextCurrentOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("makeOGLContextCurrentOnSurface",
new Class[] {
Graphics.class,
Long.TYPE
});
makeOGLContextCurrentOnSurfaceMethod.setAccessible(true);
-
+
destroyOGLContextMethod = cglSurfaceData.getDeclaredMethod("destroyOGLContext",
new Class[] {
Long.TYPE
@@ -273,7 +273,7 @@ public class Java2D {
System.err.println("Info: Disabling Java2D/JOGL integration");
}
isOGLPipelineActive = false;
- isOGLPipelineResourceCompatible = false;
+ isOGLPipelineResourceCompatible = false;
}
}
} catch (HeadlessException e) {
@@ -297,7 +297,7 @@ public class Java2D {
public static boolean isOGLPipelineActive() {
return isOGLPipelineActive;
}
-
+
public static boolean isOGLPipelineResourceCompatible() {
return isOGLPipelineResourceCompatible;
}
@@ -317,7 +317,7 @@ public class Java2D {
throw (InternalError) new InternalError().initCause(e);
}
}
-
+
/** Makes current the OpenGL context associated with the passed
Graphics object and runs the given Runnable on the Queue
Flushing Thread in one atomic action. */
@@ -556,7 +556,7 @@ public class Java2D {
throw new GLException("Java2D OpenGL pipeline not active");
}
}
-
+
private static void checkCompatible() {
if ( !isOGLPipelineResourceCompatible() ) {
throw new GLException("Java2D OpenGL pipeline not resource compatible");
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index 55fb3f9a2..a29d1e6aa 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -42,7 +42,7 @@ public class VersionApplet extends Applet {
va.init();
frame.add(va, BorderLayout.CENTER);
frame.validate();
-
+
frame.setVisible(true);
va.start();
}
@@ -68,7 +68,7 @@ public class VersionApplet extends Applet {
if(null != canvas) { return; }
setEnabled(true);
-
+
GLProfile glp = GLProfile.getDefault();
GLCapabilities glcaps = new GLCapabilities(glp);
@@ -87,7 +87,7 @@ public class VersionApplet extends Applet {
/*
s = NativeWindowVersion.getInstance().toString();
System.err.println(s);
- tareaVersion.append(NativeWindowVersion.getInstance().toString());
+ tareaVersion.append(NativeWindowVersion.getInstance().toString());
*/
s = JoglVersion.getInstance().toString();
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 3d59d1d53..1179e2b7f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl.egl;
import java.util.*;
@@ -60,12 +60,12 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
public final boolean useToolGetProcAdressFirst(String funcName) {
return true;
}
-
+
public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
-
- // Be aware that on DRI systems, eg ATI fglrx, etc,
+
+ // Be aware that on DRI systems, eg ATI fglrx, etc,
// you have to set LIBGL_DRIVERS_PATH env variable.
// Eg on Ubuntu 64bit systems this is:
// export LIBGL_DRIVERS_PATH=/usr/lib/fglrx/dri:/usr/lib32/fglrx/dri
@@ -82,15 +82,15 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
// OSX (guess ES2 on OSX will never happen)
libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
-
+
// last but not least .. the generic one
libsGL.add("GL");
-
+
libsList.add(libsGL);
return libsList;
- }
-
+ }
+
public final List getGlueLibNames() {
return glueLibNames;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index 179cb7504..3de910369 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -115,7 +115,7 @@ public class EGLContext extends GLContextImpl {
if (EGL.eglGetCurrentContext() != contextHandle) {
final long dpy = drawable.getNativeSurface().getDisplayHandle();
if (!EGL.eglMakeCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
- throw new GLException("Error making context " + toHexString(contextHandle) +
+ throw new GLException("Error making context " + toHexString(contextHandle) +
" current on Thread " + getThreadName() +
" with display " + toHexString(dpy) +
", drawableWrite " + toHexString(drawable.getHandle()) +
@@ -128,7 +128,7 @@ public class EGLContext extends GLContextImpl {
@Override
protected void releaseImpl() throws GLException {
if (!EGL.eglMakeCurrent(drawable.getNativeSurface().getDisplayHandle(), EGL.EGL_NO_SURFACE, EGL.EGL_NO_SURFACE, EGL.EGL_NO_CONTEXT)) {
- throw new GLException("Error freeing OpenGL context " + toHexString(contextHandle) +
+ throw new GLException("Error freeing OpenGL context " + toHexString(contextHandle) +
": error code " + toHexString(EGL.eglGetError()));
}
}
@@ -138,7 +138,7 @@ public class EGLContext extends GLContextImpl {
if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), contextHandle)) {
final int eglError = EGL.eglGetError();
if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
- throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) +
+ throw new GLException("Error destroying OpenGL context " + toHexString(contextHandle) +
": error code " + toHexString(eglError));
}
}
@@ -285,11 +285,11 @@ public class EGLContext extends GLContextImpl {
//
// Accessible ..
//
-
+
/* pp */ void mapCurrentAvailableGLVersion(AbstractGraphicsDevice device) {
mapStaticGLVersion(device, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
}
- /* pp */ int getContextOptions() { return ctxOptions; }
+ /* pp */ int getContextOptions() { return ctxOptions; }
/* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps) {
final GLProfile glp = caps.getGLProfile();
final int[] reqMajorCTP = new int[2];
@@ -305,7 +305,7 @@ public class EGLContext extends GLContextImpl {
reqMajorCTP[1] |= GLContext.CTX_IMPL_ACCEL_SOFT;
}
mapStaticGLVersion(device, reqMajorCTP[0], 0, reqMajorCTP[1]);
- }
+ }
/* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, final int major) {
int ctp = GLContext.CTX_PROFILE_ES;
if( major >= 3 ) {
@@ -324,20 +324,20 @@ public class EGLContext extends GLContextImpl {
if(! ( device instanceof EGLGraphicsDevice ) ) {
final EGLGraphicsDevice eglDevice = new EGLGraphicsDevice(device.getHandle(), EGL.EGL_NO_DISPLAY, device.getConnection(), device.getUnitID(), null);
GLContext.mapAvailableGLVersion(eglDevice, reqMajor, reqProfile, major, minor, ctp);
- }
+ }
}
}
protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
return GLContext.getGLVersion(major, minor, ctp, gl_version);
}
-
+
protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
return GLContext.getAvailableGLVersionsSet(device);
}
protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
GLContext.setAvailableGLVersionsSet(device);
}
-
+
protected static String toHexString(int hex) {
return GLContext.toHexString(hex);
}
@@ -358,7 +358,7 @@ public class EGLContext extends GLContextImpl {
public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
throw new GLException("Should not call this");
}
-
+
@Override
public final void glFreeMemoryNV(ByteBuffer pointer) {
throw new GLException("Should not call this");
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index f2efb0479..89f34432d 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -41,8 +41,8 @@ import jogamp.opengl.Debug;
import com.jogamp.common.util.LongObjectHashMap;
import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
-/**
- * This implementation provides recursive calls to
+/**
+ * This implementation provides recursive calls to
* {@link EGL#eglInitialize(long, IntBuffer, IntBuffer)} and {@link EGL#eglTerminate(long)},
* where eglInitialize(..) is issued only for the 1st call per eglDisplay
* and eglTerminate(..) is issued only for the last call.
@@ -53,30 +53,30 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
*/
public class EGLDisplayUtil {
protected static final boolean DEBUG = Debug.debug("EGLDisplayUtil");
-
+
private static class DpyCounter {
final long eglDisplay;
final Throwable createdStack;
int refCount;
-
+
private DpyCounter(long eglDisplay) {
this.eglDisplay = eglDisplay;
this.refCount = 0;
this.createdStack = DEBUG ? new Throwable() : null;
}
-
+
public String toString() {
return "EGLDisplay[0x"+Long.toHexString(eglDisplay)+": refCnt "+refCount+"]";
}
}
static final LongObjectHashMap eglDisplayCounter;
-
+
static {
eglDisplayCounter = new LongObjectHashMap();
eglDisplayCounter.setKeyNotFoundValue(null);
}
- /**
+ /**
* @return number of unclosed EGL Displays.
*/
public static int shutdown(boolean verbose) {
@@ -91,7 +91,7 @@ public class EGLDisplayUtil {
}
return eglDisplayCounter.size();
}
-
+
public static void dumpOpenDisplayConnections() {
System.err.println("EGLDisplayUtil: Open EGL Display Connections: "+eglDisplayCounter.size());
int i=0;
@@ -104,7 +104,7 @@ public class EGLDisplayUtil {
}
}
}
-
+
public static long eglGetDisplay(long nativeDisplay_id) {
final long eglDisplay = EGL.eglGetDisplay(nativeDisplay_id);
if(DEBUG) {
@@ -114,16 +114,16 @@ public class EGLDisplayUtil {
}
return eglDisplay;
}
-
+
/**
* @param eglDisplay
* @param major
* @param minor
* @return true if the eglDisplay is valid and it's reference counter becomes one and {@link EGL#eglInitialize(long, IntBuffer, IntBuffer)} was successful, otherwise false
- *
+ *
* @see EGL#eglInitialize(long, IntBuffer, IntBuffer)
*/
- public static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor) {
+ public static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor) {
if( EGL.EGL_NO_DISPLAY == eglDisplay) {
return false;
}
@@ -157,16 +157,16 @@ public class EGLDisplayUtil {
}
return res;
}
-
+
/**
* @param nativeDisplayID
* @param eglDisplay array of size 1 holding return value if successful, otherwise {@link EGL#EGL_NO_DISPLAY}.
- * @param eglErr array of size 1 holding the EGL error value as retrieved by {@link EGL#eglGetError()} if not successful.
+ * @param eglErr array of size 1 holding the EGL error value as retrieved by {@link EGL#eglGetError()} if not successful.
* @param major
* @param minor
- * @return {@link EGL#EGL_SUCCESS} if successful, otherwise {@link EGL#EGL_BAD_DISPLAY} if {@link #eglGetDisplay(long)} failed
+ * @return {@link EGL#EGL_SUCCESS} if successful, otherwise {@link EGL#EGL_BAD_DISPLAY} if {@link #eglGetDisplay(long)} failed
* or {@link EGL#EGL_NOT_INITIALIZED} if {@link #eglInitialize(long, IntBuffer, IntBuffer)} failed.
- *
+ *
* @see #eglGetDisplay(long)
* @see #eglInitialize(long, IntBuffer, IntBuffer)
*/
@@ -184,7 +184,7 @@ public class EGLDisplayUtil {
eglDisplay[0] = _eglDisplay;
return EGL.EGL_SUCCESS;
}
-
+
/**
* @param nativeDisplayID in/out array of size 1, passing the requested nativeVisualID, may return a different revised nativeVisualID handle
* @return the initialized EGL display ID
@@ -209,7 +209,7 @@ public class EGLDisplayUtil {
}
throw new GLException("Failed to created/initialize EGL display incl. fallback default: native "+EGLContext.toHexString(nativeDisplayID[0])+", error "+EGLContext.toHexString(eglRes)+"/"+EGLContext.toHexString(eglError[0]));
}
-
+
/**
* @param eglDisplay the EGL display handle
* @return true if the eglDisplay is valid and it's reference counter becomes zero and {@link EGL#eglTerminate(long)} was successful, otherwise false
@@ -218,7 +218,7 @@ public class EGLDisplayUtil {
if( EGL.EGL_NO_DISPLAY == eglDisplay) {
return false;
}
- final boolean res;
+ final boolean res;
final int refCnt;
final DpyCounter d;
{
@@ -237,7 +237,7 @@ public class EGLDisplayUtil {
} else {
if(0 < refCnt) { // no negative refCount
d.refCount = refCnt;
- }
+ }
res = true;
}
if(DEBUG) {
@@ -246,7 +246,7 @@ public class EGLDisplayUtil {
}
return res;
}
-
+
public static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
public long eglGetAndInitDisplay(long[] nativeDisplayID) {
return eglGetDisplayAndInitialize(nativeDisplayID);
@@ -255,25 +255,25 @@ public class EGLDisplayUtil {
EGLDisplayUtil.eglTerminate(eglDisplayHandle);
}
};
-
+
/**
* @param nativeDisplayID
* @param connection
* @param unitID
- * @return an initialized EGLGraphicsDevice
+ * @return an initialized EGLGraphicsDevice
* @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails
- * @see EGLGraphicsDevice#EGLGraphicsDevice(long, long, String, int, com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLDisplayLifecycleCallback)
+ * @see EGLGraphicsDevice#EGLGraphicsDevice(long, long, String, int, com.jogamp.nativewindow.egl.EGLGraphicsDevice.EGLDisplayLifecycleCallback)
*/
public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(long nativeDisplayID, String connection, int unitID) {
final EGLGraphicsDevice eglDisplay = new EGLGraphicsDevice(nativeDisplayID, EGL.EGL_NO_DISPLAY, connection, unitID, eglLifecycleCallback);
eglDisplay.open();
return eglDisplay;
}
-
+
/**
* @param surface
- * @return an initialized EGLGraphicsDevice
- * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails incl fallback
+ * @return an initialized EGLGraphicsDevice
+ * @throws GLException if {@link EGL#eglGetDisplay(long)} or {@link EGL#eglInitialize(long, int[], int, int[], int)} fails incl fallback
*/
public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(NativeSurface surface) {
final long nativeDisplayID;
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index 2edf26145..bf269c548 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -59,15 +59,15 @@ public abstract class EGLDrawable extends GLDrawableImpl {
@Override
public abstract GLContext createContext(GLContext shareWith);
- protected abstract long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle);
+ protected abstract long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle);
private final long createEGLSurface() {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
- final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();
+ final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();
final NativeSurface upstreamSurface = eglws.getUpstreamSurface();
-
+
long eglSurface = createSurface(eglConfig, eglws.getWidth(), eglws.getHeight(), upstreamSurface.getSurfaceHandle());
-
+
int eglError0;
if (EGL.EGL_NO_SURFACE == eglSurface) {
eglError0 = EGL.eglGetError();
@@ -104,7 +104,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
if(DEBUG) {
System.err.println(getThreadName() + ": createHandle of "+eglws);
- }
+ }
if( eglws.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
if( EGL.EGL_NO_SURFACE != eglws.getSurfaceHandle() ) {
throw new InternalError("Set surface but claimed to be invalid: "+eglws);
@@ -114,12 +114,12 @@ public abstract class EGLDrawable extends GLDrawableImpl {
throw new InternalError("Nil surface but claimed to be valid: "+eglws);
}
}
-
- protected void destroyHandle() {
+
+ protected void destroyHandle() {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
if(DEBUG) {
System.err.println(getThreadName() + ": destroyHandle of "+eglws);
- }
+ }
if( EGL.EGL_NO_SURFACE == eglws.getSurfaceHandle() ) {
throw new InternalError("Nil surface but claimed to be valid: "+eglws);
}
@@ -134,7 +134,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
if( 0 == surfaceHandle ) {
return false;
}
- final IntBuffer val = Buffers.newDirectIntBuffer(1);
+ final IntBuffer val = Buffers.newDirectIntBuffer(1);
final boolean eglSurfaceValid = EGL.eglQuerySurface(eglDisplayHandle, surfaceHandle, EGL.EGL_CONFIG_ID, val);
if( !eglSurfaceValid ) {
final int eglErr = EGL.eglGetError();
@@ -144,7 +144,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
}
return eglSurfaceValid;
}
-
+
@Override
protected final void setRealizedImpl() {
if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 5d99e3eba..a0d896e3a 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -83,14 +83,14 @@ import com.jogamp.opengl.GLRendererQuirks;
public class EGLDrawableFactory extends GLDrawableFactoryImpl {
protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG; // allow package access
-
+
/* package */ static final boolean QUERY_EGL_ES_NATIVE_TK;
-
+
static {
Debug.initSingleton();
QUERY_EGL_ES_NATIVE_TK = Debug.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
}
-
+
private static GLDynamicLookupHelper eglES1DynamicLookupHelper = null;
private static GLDynamicLookupHelper eglES2DynamicLookupHelper = null;
@@ -109,7 +109,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
dl.isFunctionAvailable("glEnableClientState") &&
dl.isFunctionAvailable("glColorPointer");
}
-
+
public EGLDrawableFactory() {
super();
@@ -189,10 +189,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
} else {
if( isANGLE && ( DEBUG || GLProfile.DEBUG ) ) {
System.err.println("Info: EGLDrawableFactory.init - EGL/ES2 ANGLE enabled");
- }
+ }
sharedMap = new HashMap();
sharedMapCreateAttempt = new HashSet();
-
+
// FIXME: Following triggers eglInitialize(..) which crashed on Windows w/ Chrome/Angle, FF/Angle!
defaultDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
}
@@ -204,8 +204,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
protected final boolean isComplete() {
return null != sharedMap; // null != eglES2DynamicLookupHelper || null != eglES1DynamicLookupHelper;
}
-
-
+
+
@Override
protected final void destroy() {
if(null != sharedMap) {
@@ -247,7 +247,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
EGLGraphicsConfigurationFactory.unregisterFactory();
EGLDisplayUtil.shutdown(DEBUG);
}
-
+
private void dumpMap() {
synchronized(sharedMap) {
System.err.println("EGLDrawableFactory.map "+sharedMap.size());
@@ -265,7 +265,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
private HashMap sharedMap = null;
- private HashSet sharedMapCreateAttempt = null;
+ private HashSet sharedMapCreateAttempt = null;
private EGLGraphicsDevice defaultDevice = null;
private SharedResource defaultSharedResource = null;
private boolean isANGLE = false;
@@ -286,9 +286,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
private final boolean hasPBufferES1;
private final boolean hasPBufferES3ES2;
- SharedResource(EGLGraphicsDevice dev,
- boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
- boolean wasContextES2Created, boolean wasContextES3Created,
+ SharedResource(EGLGraphicsDevice dev,
+ boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
+ boolean wasContextES2Created, boolean wasContextES3Created,
boolean hasPBufferES3ES2, GLRendererQuirks rendererQuirksES3ES2, int ctpES3ES2) {
this.device = dev;
// this.contextES1 = ctxES1;
@@ -296,7 +296,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
this.hasPBufferES1= hasPBufferES1;
this.rendererQuirksES1 = rendererQuirksES1;
this.ctpES1 = ctpES1;
-
+
// this.contextES2 = ctxES2;
// this.contextES3 = ctxES3;
this.wasES2ContextCreated = wasContextES2Created;
@@ -314,7 +314,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
// final EGLContext getContextES1() { return contextES1; }
// final EGLContext getContextES2() { return contextES2; }
// final EGLContext getContextES3() { return contextES3; }
-
+
@Override
public AbstractGraphicsScreen getScreen() {
return null;
@@ -329,7 +329,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
public GLRendererQuirks getRendererQuirks() {
- return null != rendererQuirksES3ES2 ? rendererQuirksES3ES2 : rendererQuirksES1 ;
+ return null != rendererQuirksES3ES2 ? rendererQuirksES3ES2 : rendererQuirksES1 ;
}
}
@@ -359,18 +359,18 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return new ArrayList(0);
}
-
- private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int esProfile,
+
+ private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int esProfile,
boolean[] hasPBuffer, GLRendererQuirks[] rendererQuirks, int[] ctp) {
final String profileString;
switch( esProfile ) {
case 3:
- profileString = GLProfile.GLES3; break;
+ profileString = GLProfile.GLES3; break;
case 2:
- profileString = GLProfile.GLES2; break;
- case 1:
+ profileString = GLProfile.GLES2; break;
+ case 1:
profileString = GLProfile.GLES1; break;
- default:
+ default:
throw new GLException("Invalid ES profile number "+esProfile);
}
if ( !GLProfile.isAvailable(adevice, profileString) ) {
@@ -394,23 +394,23 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
ProxySurface upstreamSurface = null; // X11, GLX, ..
boolean success = false;
boolean deviceFromUpstreamSurface = false;
- try {
+ try {
final GLCapabilities reqCapsAny = new GLCapabilities(glp);
reqCapsAny.setRedBits(5); reqCapsAny.setGreenBits(5); reqCapsAny.setBlueBits(5); reqCapsAny.setAlphaBits(0);
reqCapsAny.setDoubleBuffered(false);
-
+
if( mapsADeviceToDefaultDevice ) {
// In this branch, any non EGL device is mapped to EGL default shared resources (default behavior).
- // Only one default shared resource instance is ever be created.
+ // Only one default shared resource instance is ever be created.
final GLCapabilitiesImmutable reqCapsPBuffer = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(reqCapsAny);
final List availablePBufferCapsL = getAvailableEGLConfigs(defaultDevice, reqCapsPBuffer);
hasPBuffer[0] = availablePBufferCapsL.size() > 0;
-
+
// 1st case: adevice is not the EGL default device, map default shared resources
if( adevice != defaultDevice ) {
if(null == defaultSharedResource) {
return false;
- }
+ }
switch(esProfile) {
case 3:
if( !defaultSharedResource.wasES3ContextCreated ) {
@@ -419,14 +419,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
rendererQuirks[0] = defaultSharedResource.rendererQuirksES3ES2;
ctp[0] = defaultSharedResource.ctpES3ES2;
break;
- case 2:
+ case 2:
if( !defaultSharedResource.wasES2ContextCreated ) {
return false;
}
rendererQuirks[0] = defaultSharedResource.rendererQuirksES3ES2;
ctp[0] = defaultSharedResource.ctpES3ES2;
break;
- case 1:
+ case 1:
if( !defaultSharedResource.wasES1ContextCreated ) {
return false;
}
@@ -437,11 +437,11 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
EGLContext.mapStaticGLVersion(adevice, esProfile, 0, ctp[0]);
return true;
}
-
+
// attempt to created the default shared resources ..
-
+
eglDevice = defaultDevice; // reuse
-
+
if( hasPBuffer[0] ) {
// 2nd case create defaultDevice shared resource using pbuffer surface
surface = createDummySurfaceImpl(eglDevice, false, reqCapsPBuffer, reqCapsPBuffer, null, 64, 64); // egl pbuffer offscreen
@@ -459,15 +459,15 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(DEBUG) {
System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig() no pbuffer config available, detected !pbuffer config: "+success);
EGLGraphicsConfigurationFactory.printCaps("!PBufferCaps", capsAnyL, System.err);
- }
- }
+ }
+ }
} else {
- // 4th case always creates a true mapping of given device to EGL
+ // 4th case always creates a true mapping of given device to EGL
surface = desktopFactory.createDummySurface(adevice, reqCapsAny, null, 64, 64); // X11, WGL, .. dummy window
upstreamSurface = ( surface instanceof ProxySurface ) ? (ProxySurface)surface : null ;
if(null != upstreamSurface) {
upstreamSurface.createNotify();
- }
+ }
eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(surface);
deviceFromUpstreamSurface = true;
hasPBuffer[0] = true;
@@ -482,7 +482,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
context.makeCurrent(); // could cause exception
if(context.isCurrent()) {
final String glVersion = context.getGL().glGetString(GL.GL_VERSION);
- if(null != glVersion) {
+ if(null != glVersion) {
context.mapCurrentAvailableGLVersion(eglDevice);
if(eglDevice != adevice) {
context.mapCurrentAvailableGLVersion(adevice);
@@ -493,7 +493,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
} else {
// Oops .. something is wrong
if(DEBUG) {
- System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+eglDevice+", "+context.getGLVersion()+" - VERSION is null, dropping availability!");
+ System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+eglDevice+", "+context.getGLVersion()+" - VERSION is null, dropping availability!");
}
}
}
@@ -510,7 +510,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
} catch (Throwable t) {
if(DEBUG) {
- System.err.println("Catched Exception on thread "+getThreadName());
+ System.err.println("Catched Exception on thread "+getThreadName());
t.printStackTrace();
}
success = false;
@@ -518,7 +518,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(eglDevice == defaultDevice) {
if(null != upstreamSurface) {
upstreamSurface.destroyNotify();
- }
+ }
} else if( deviceFromUpstreamSurface ) {
if(null != eglDevice) {
eglDevice.close();
@@ -529,7 +529,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
} else {
if(null != upstreamSurface) {
upstreamSurface.destroyNotify();
- }
+ }
if(null != eglDevice) {
eglDevice.close();
}
@@ -553,9 +553,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return false;
}
- }
+ }
}
-
+
@Override
protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
@@ -571,27 +571,27 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
dumpMap();
throw new InternalError("defaultSharedResource already exist: "+defaultSharedResource);
}
- defaultSharedResource = createEGLSharedResourceImpl(defaultDevice);
+ defaultSharedResource = createEGLSharedResourceImpl(defaultDevice);
}
-
+
final String key = adevice.getUniqueID();
if( defaultDevice.getUniqueID().equals(key) ) {
return defaultSharedResource;
} else {
- if( null == defaultSharedResource) { // defaultDevice must be initialized before host-device
+ if( null == defaultSharedResource) { // defaultDevice must be initialized before host-device
dumpMap();
- throw new InternalError("defaultSharedResource does not exist");
+ throw new InternalError("defaultSharedResource does not exist");
}
final SharedResource[] existing = new SharedResource[] { null };
if ( !needsToCreateSharedResource(key, existing) ) {
return existing[0];
- }
+ }
return createEGLSharedResourceImpl(adevice);
}
}
-
+
private SharedResource createEGLSharedResourceImpl(AbstractGraphicsDevice adevice) {
- final boolean madeCurrentES1;
+ final boolean madeCurrentES1;
final boolean madeCurrentES2;
final boolean madeCurrentES3;
boolean[] hasPBufferES1 = new boolean[] { false };
@@ -602,12 +602,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
int[] ctpES1 = new int[] { -1 };
int[] ctpES3ES2 = new int[] { -1 };
-
-
+
+
if (DEBUG) {
System.err.println("EGLDrawableFactory.createShared(): device "+adevice);
}
-
+
if( null != eglES1DynamicLookupHelper ) {
madeCurrentES1 = mapAvailableEGLESConfig(adevice, 1, hasPBufferES1, rendererQuirksES1, ctpES1);
} else {
@@ -625,10 +625,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
madeCurrentES2 = false;
madeCurrentES3 = false;
}
-
+
if( !EGLContext.getAvailableGLVersionsSet(adevice) ) {
// Even though we override the non EGL native mapping intentionally,
- // avoid exception due to double 'set' - carefull exception of the rule.
+ // avoid exception due to double 'set' - carefull exception of the rule.
EGLContext.setAvailableGLVersionsSet(adevice);
}
if( hasX11 ) {
@@ -637,7 +637,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
final SharedResource sr = new SharedResource(defaultDevice, madeCurrentES1, hasPBufferES1[0], rendererQuirksES1[0], ctpES1[0],
madeCurrentES2, madeCurrentES3, hasPBufferES3ES2[0], rendererQuirksES3ES2[0], ctpES3ES2[0]);
-
+
synchronized(sharedMap) {
sharedMap.put(adevice.getUniqueID(), sr);
}
@@ -650,7 +650,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return sr;
}
-
+
private void handleDontCloseX11DisplayQuirk(GLRendererQuirks quirks) {
if( null != quirks && quirks.exist( GLRendererQuirks.DontCloseX11Display ) ) {
jogamp.nativewindow.x11.X11Util.markAllDisplaysUnclosable();
@@ -692,7 +692,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
return new EGLOnscreenDrawable(this, EGLWrappedSurface.get(target));
}
-
+
@Override
protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
if (target == null) {
@@ -715,8 +715,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
+ protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+ GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
final boolean ownDevice;
final EGLGraphicsDevice device;
@@ -732,21 +732,21 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
final DefaultGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
final EGLGraphicsConfiguration config = EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen, VisualIDHolder.VID_UNDEFINED, false);
if(null == config) {
- throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
- }
+ throw new GLException("Choosing GraphicsConfiguration failed w/ "+capsChosen+" on "+screen);
+ }
return new WrappedSurface(config, 0, upstreamHook, ownDevice);
}
-
+
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
+ public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
- chosenCaps = GLGraphicsConfigurationUtil.fixOffscreenBitOnly(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
+ chosenCaps = GLGraphicsConfigurationUtil.fixOffscreenBitOnly(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new EGLDummyUpstreamSurfaceHook(width, height));
}
-
+
/**
- * @param ms {@link MutableSurface} which dimensions and config are being used to create the pbuffer surface.
- * It will also hold the resulting pbuffer surface handle.
+ * @param ms {@link MutableSurface} which dimensions and config are being used to create the pbuffer surface.
+ * It will also hold the resulting pbuffer surface handle.
* @param useTexture
* @return the passed {@link MutableSurface} which now has the EGL pbuffer surface set as it's handle
*/
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
index 162e7166a..eb6578ec5 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
@@ -9,17 +9,17 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
/**
- * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
- * not the actual dummy surface width.
+ * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+ * not the actual dummy surface width.
* The latter is platform specific and small
- * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
+ * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
* not the actual dummy surface height,
* The latter is platform specific and small
*/
public EGLDummyUpstreamSurfaceHook(int width, int height) {
super(width, height);
}
-
+
@Override
public final void create(ProxySurface s) {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
@@ -31,14 +31,14 @@ public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
}
if( EGL.EGL_NO_SURFACE == s.getSurfaceHandle() ) {
s.setSurfaceHandle( EGLDrawableFactory.createPBufferSurfaceImpl((EGLGraphicsConfiguration)s.getGraphicsConfiguration(), 64, 64, false) );
- s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
+ s.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
}
s.addUpstreamOptionBits(ProxySurface.OPT_UPSTREAM_WINDOW_INVISIBLE);
} finally {
eglDevice.unlock();
}
}
-
+
@Override
public final void destroy(ProxySurface s) {
if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
index 778f0cb38..ac880ebc0 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl.egl;
import com.jogamp.common.os.AndroidVersion;
@@ -52,7 +52,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
super();
}
- /**
+ /**
* Returns true on Android,
* and false otherwise.
*/
@@ -65,7 +65,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
// default behavior for other platforms
return false;
}
-
+
@Override
public final List getToolGetProcAddressFuncNameList() {
List res = new ArrayList();
@@ -87,26 +87,26 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
return true;
}
}
-
+
protected final List getEGLLibNamesList() {
List eglLibNames = new ArrayList();
-
- // this is the default EGL lib name, according to the spec
+
+ // this is the default EGL lib name, according to the spec
eglLibNames.add("libEGL.so.1");
-
+
// try these as well, if spec fails
eglLibNames.add("libEGL.so");
eglLibNames.add("EGL");
-
- // for windows distributions using the 'unlike' lib prefix,
+
+ // for windows distributions using the 'unlike' lib prefix,
// where our tool does not add it.
eglLibNames.add("libEGL");
-
+
return eglLibNames;
}
@Override
public final List getGlueLibNames() {
return glueLibNames;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
index dd3d6faea..9ffcea864 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl.egl;
import java.util.*;
@@ -39,29 +39,29 @@ public final class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
final List> libsList = new ArrayList>();
{
final List libsGL = new ArrayList();
-
- // this is the default lib name, according to the spec
+
+ // this is the default lib name, according to the spec
libsGL.add("libGLESv1_CM.so.2");
-
+
// try these as well, if spec fails
libsGL.add("libGLESv1_CM.so");
- libsGL.add("GLESv1_CM");
+ libsGL.add("GLESv1_CM");
// alternative names
libsGL.add("GLES_CM");
libsGL.add("GLES_CL");
-
- // for windows distributions using the 'unlike' lib prefix,
+
+ // for windows distributions using the 'unlike' lib prefix,
// where our tool does not add it.
libsGL.add("libGLESv1_CM");
libsGL.add("libGLES_CM");
libsGL.add("libGLES_CL");
-
+
libsList.add(libsGL);
}
libsList.add(getEGLLibNamesList());
-
+
return libsList;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
index 0d20fd4e8..de1f0a42e 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,17 +20,17 @@
* 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 jogamp.opengl.egl;
import java.util.*;
-/**
+/**
*
* Covering ES3 and ES2.
*
@@ -44,12 +44,12 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
final List> libsList = new ArrayList>();
{
final List libsGL = new ArrayList();
-
- // ES3: This is the default lib name, according to the spec
+
+ // ES3: This is the default lib name, according to the spec
libsGL.add("libGLESv3.so.3");
-
+
// ES3: Try these as well, if spec fails
- libsGL.add("libGLESv3.so");
+ libsGL.add("libGLESv3.so");
libsGL.add("GLESv3");
// ES3: Alternative names
@@ -59,12 +59,12 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
// where our tool does not add it.
libsGL.add("libGLESv3");
libsGL.add("libGLES30");
-
- // ES2: This is the default lib name, according to the spec
+
+ // ES2: This is the default lib name, according to the spec
libsGL.add("libGLESv2.so.2");
-
+
// ES2: Try these as well, if spec fails
- libsGL.add("libGLESv2.so");
+ libsGL.add("libGLESv2.so");
libsGL.add("GLESv2");
// ES2: Alternative names
@@ -75,14 +75,14 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
// where our tool does not add it.
libsGL.add("libGLESv2");
libsGL.add("libGLESv2_CM");
- libsGL.add("libGLES20");
-
+ libsGL.add("libGLES20");
+
libsList.add(libsGL);
}
libsList.add(getEGLLibNamesList());
-
+
return libsList;
- }
-
+ }
+
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index b1ffe608e..f3592c150 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -57,7 +57,7 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
-
+
public final long getNativeConfig() {
return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfig();
}
@@ -66,7 +66,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfigID();
}
- EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
+ EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
EGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
super(absScreen, capsChosen, capsRequested);
this.chooser = chooser;
@@ -77,7 +77,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
* @param absScreen
* @param eglConfigID {@link EGL#EGL_CONFIG_ID} for which the config is being created for.
* @return
- * @throws GLException if invalid EGL display.
+ * @throws GLException if invalid EGL display.
*/
public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int eglConfigID) {
final AbstractGraphicsDevice absDevice = absScreen.getDevice();
@@ -101,9 +101,9 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
public Object clone() {
return super.clone();
}
-
+
void updateGraphicsConfiguration() {
- CapabilitiesImmutable capsChosen = getChosenCapabilities();
+ CapabilitiesImmutable capsChosen = getChosenCapabilities();
EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
GraphicsConfigurationFactory.getFactory(getScreen().getDevice(), capsChosen).chooseGraphicsConfiguration(
capsChosen, getRequestedCapabilities(), chooser, getScreen(), VisualIDHolder.VID_UNDEFINED);
@@ -140,7 +140,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return false;
}
final IntBuffer val = Buffers.newDirectIntBuffer(1);
-
+
// get the configID
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
final int eglErr = EGL.eglGetError();
@@ -169,7 +169,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
}
if ( 0 != ( _stype & EGL.EGL_PBUFFER_BIT ) ) {
val |= GLGraphicsConfigurationUtil.PBUFFER_BIT |
- GLGraphicsConfigurationUtil.FBO_BIT;
+ GLGraphicsConfigurationUtil.FBO_BIT;
}
return val;
}
@@ -189,7 +189,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
final int cfgID;
final int rType;
final int visualID;
-
+
// get the configID
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
if(DEBUG) {
@@ -199,7 +199,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return null;
}
cfgID = val.get(0);
-
+
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_RENDERABLE_TYPE, val)) {
if(DEBUG) {
System.err.println("EGL couldn't retrieve EGL_RENDERABLE_TYPE for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError()));
@@ -213,8 +213,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
} else {
visualID = VisualIDHolder.VID_UNDEFINED;
}
-
- EGLGLCapabilities caps = null;
+
+ EGLGLCapabilities caps = null;
try {
if(null == glp) {
glp = EGLGLCapabilities.getCompatible(device, rType);
@@ -232,8 +232,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
System.err.println("config "+toHexString(config)+": "+gle);
}
return null;
- }
-
+ }
+
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_CAVEAT, val)) {
if( EGL.EGL_SLOW_CONFIG == val.get(0) ) {
caps.setHardwareAccelerated(false);
@@ -244,11 +244,11 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
caps.setNumSamples(val.get(0));
}
if(!caps.getSampleBuffers()) {
- // try NV_coverage_sample extension
+ // try NV_coverage_sample extension
if(EGL.eglGetConfigAttrib(display, config, EGLExt.EGL_COVERAGE_BUFFERS_NV, val)) {
if(val.get(0)>0 &&
EGL.eglGetConfigAttrib(display, config, EGLExt.EGL_COVERAGE_SAMPLES_NV, val)) {
- caps.setSampleExtension(GLGraphicsConfigurationUtil.NV_coverage_sample);
+ caps.setSampleExtension(GLGraphicsConfigurationUtil.NV_coverage_sample);
caps.setSampleBuffers(true);
caps.setNumSamples(val.get(0));
}
@@ -269,7 +269,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_BLUE_VALUE, val)) {
caps.setTransparentBlueValue(val.get(0)==EGL.EGL_DONT_CARE?-1:val.get(0));
}
- /** Not defined in EGL
+ /** Not defined in EGL
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_ALPHA_VALUE, val)) {
caps.setTransparentAlphaValue(val.get(0)==EGL.EGL_DONT_CARE?-1:val.get(0));
} */
@@ -294,16 +294,16 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
caps.setDepthBits(val.get(0));
}
- // Since the passed GLProfile may be null,
+ // Since the passed GLProfile may be null,
// we use EGL_RENDERABLE_TYPE derived profile as created in the EGLGLCapabilities constructor.
- final int availableTypeBits = EGLConfigDrawableTypeBits(device, config);
+ final int availableTypeBits = EGLConfigDrawableTypeBits(device, config);
final int drawableTypeBits = winattrmask & availableTypeBits;
if( 0 == drawableTypeBits ) {
return null;
}
-
- return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
+
+ return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
}
public static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
@@ -313,7 +313,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
attrs.put(idx++, EGL.EGL_SURFACE_TYPE);
final int surfaceType;
if( caps.isOnscreen() ) {
- surfaceType = EGL.EGL_WINDOW_BIT;
+ surfaceType = EGL.EGL_WINDOW_BIT;
} else if( caps.isFBO() ) {
surfaceType = EGL.EGL_PBUFFER_BIT; // native replacement!
} else if( caps.isPBuffer() ) {
@@ -338,7 +338,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
attrs.put(idx++, EGL.EGL_ALPHA_SIZE);
attrs.put(idx++, caps.getAlphaBits());
}
-
+
if(caps.getStencilBits()>0) {
attrs.put(idx++, EGL.EGL_STENCIL_SIZE);
attrs.put(idx++, caps.getStencilBits());
@@ -382,7 +382,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
attrs.put(idx++, caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():EGL.EGL_DONT_CARE; */
}
- // 28
+ // 28
attrs.put(idx++, EGL.EGL_RENDERABLE_TYPE);
if(caps.getGLProfile().usesNativeGLES1()) {
attrs.put(idx++, EGL.EGL_OPENGL_ES_BIT);
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index b44e08500..5764a6178 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -75,10 +75,10 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
static GraphicsConfigurationFactory nativeGraphicsConfigurationFactory = null;
static GraphicsConfigurationFactory kdeglGraphicsConfigurationFactory = null;
static GraphicsConfigurationFactory fallbackGraphicsConfigurationFactory = null;
-
+
static void registerFactory() {
GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
-
+
// become the pre-selector for X11/.. to match the native visual id w/ EGL, if native ES is selected
final String nwType = NativeWindowFactory.getNativeWindowType(false);
if(NativeWindowFactory.TYPE_X11 == nwType) {
@@ -86,32 +86,32 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(null != nativeGraphicsConfigurationFactory) {
fallbackGraphicsConfigurationFactory = nativeGraphicsConfigurationFactory;
} else {
- fallbackGraphicsConfigurationFactory = GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class);
+ fallbackGraphicsConfigurationFactory = GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class);
}
} /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) {
nativeGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, eglFactory);
- } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
+ } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
} */
-
+
// become the selector for KD/EGL ..
- kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, eglFactory);
+ kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, eglFactory);
}
-
+
static void unregisterFactory() {
final String nwType = NativeWindowFactory.getNativeWindowType(false);
if(NativeWindowFactory.TYPE_X11 == nwType) {
- GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, GLCapabilitiesImmutable.class, nativeGraphicsConfigurationFactory);
+ GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, GLCapabilitiesImmutable.class, nativeGraphicsConfigurationFactory);
} /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) {
GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, nativeGraphicsConfigurationFactory);
- } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
+ } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
} */
nativeGraphicsConfigurationFactory = null;
fallbackGraphicsConfigurationFactory = null;
-
+
GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, GLCapabilitiesImmutable.class, kdeglGraphicsConfigurationFactory);
kdeglGraphicsConfigurationFactory = null;
}
-
+
private EGLGraphicsConfigurationFactory() {
}
@@ -139,21 +139,21 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
AbstractGraphicsDevice absDevice = absScreen.getDevice();
if(null==absDevice) {
throw new GLException("Null AbstractGraphicsDevice");
- }
-
+ }
+
AbstractGraphicsConfiguration cfg = null;
-
+
if( absDevice instanceof EGLGraphicsDevice ) {
cfg = chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable) capsChosen,
(GLCapabilitiesImmutable) capsRequested,
(GLCapabilitiesChooser) chooser,
- absScreen, nativeVisualID, false);
+ absScreen, nativeVisualID, false);
} else {
- // handle non native cases (X11, ..)
+ // handle non native cases (X11, ..)
if(null == fallbackGraphicsConfigurationFactory) {
throw new InternalError("Native fallback GraphicsConfigurationFactory is null, but call issued for device: "+absDevice+" of type "+absDevice.getClass().getSimpleName());
}
-
+
if(glCapsChosen.getGLProfile().usesNativeGLES()) {
if(DEBUG) {
System.err.println("EGLGraphicsConfigurationFactory.choose..: Handle native device "+absDevice.getClass().getSimpleName());
@@ -175,7 +175,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
System.err.println("EGLGraphicsConfigurationFactory.choose..: Delegate to "+fallbackGraphicsConfigurationFactory.getClass().getSimpleName());
}
cfg = fallbackGraphicsConfigurationFactory.chooseGraphicsConfiguration(capsChosen, capsRequested, chooser, absScreen, nativeVisualID);
- }
+ }
}
return cfg;
}
@@ -219,7 +219,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
public static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
GLCapabilitiesImmutable capsReq,
GLCapabilitiesChooser chooser,
- AbstractGraphicsScreen absScreen, int nativeVisualID,
+ AbstractGraphicsScreen absScreen, int nativeVisualID,
boolean forceTransparentFlag) {
if (capsChosen == null) {
capsChosen = new GLCapabilities(null);
@@ -232,7 +232,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(null==absDevice) {
throw new GLException("Null AbstractGraphicsDevice");
}
-
+
final EGLGraphicsDevice eglDevice;
final boolean ownEGLDisplay;
if( absDevice instanceof EGLGraphicsDevice ) {
@@ -253,7 +253,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
if(DEBUG) {
System.err.println("eglChooseConfig failed with given capabilities "+capsChosen);
}
-
+
// Last try .. add a fixed embedded profile [ATI, Nokia, Intel, ..]
//
// rgb888 - d16, s4
@@ -268,7 +268,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
fixedCaps.setOnscreen(false);
fixedCaps.setPBuffer(capsChosen.isPBuffer());
fixedCaps.setFBO(capsChosen.isFBO());
- }
+ }
if(DEBUG) {
System.err.println("trying fixed caps (1): "+fixedCaps);
}
@@ -286,7 +286,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
fixedCaps.setOnscreen(false);
fixedCaps.setPBuffer(capsChosen.isPBuffer());
fixedCaps.setFBO(capsChosen.isFBO());
- }
+ }
if(DEBUG) {
System.err.println("trying fixed caps (2): "+fixedCaps);
}
@@ -306,7 +306,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
fixedCaps.setOnscreen(false);
fixedCaps.setPBuffer(capsChosen.isPBuffer());
fixedCaps.setFBO(capsChosen.isFBO());
- }
+ }
if(DEBUG) {
System.err.println("trying fixed caps (3): "+fixedCaps);
}
@@ -322,8 +322,8 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
return res;
}
-
- static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
+
+ static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
GLCapabilitiesChooser chooser,
AbstractGraphicsScreen absScreen,
@@ -354,7 +354,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
final IntBuffer attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen);
PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
- // 1st choice: get GLCapabilities based on users GLCapabilities
+ // 1st choice: get GLCapabilities based on users GLCapabilities
// setting recommendedIndex as preferred choice
// skipped if nativeVisualID is given
if( VisualIDHolder.VID_UNDEFINED != nativeVisualID || !EGL.eglChooseConfig(eglDisplay, attrs, configs, configs.capacity(), numConfigs) ) {
@@ -387,7 +387,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
throw new GLException("EGLGraphicsConfiguration.eglChooseConfig: #2 Get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
}
if (numConfigs.get(0) > 0) {
- availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag);
+ availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag);
}
}
@@ -400,7 +400,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
}
return null;
}
-
+
if(DEBUG) {
System.err.println("EGLGraphicsConfiguration.eglChooseConfig: got configs: "+availableCaps.size());
for(int i=0; i this "+surface.getClass().getSimpleName()+" ): ";
- System.err.println(dbgPrefix+this);
+ System.err.println(dbgPrefix+this);
} else {
dbgPrefix = null;
}
-
+
if(upstreamSurface instanceof ProxySurface) {
- // propagate createNotify(..) so upstreamSurface will be created
+ // propagate createNotify(..) so upstreamSurface will be created
((ProxySurface)upstreamSurface).createNotify();
}
-
+
// lock upstreamSurface, so it can be used in case EGLDisplay is derived from it!
if(NativeSurface.LOCK_SURFACE_NOT_READY >= upstreamSurface.lockSurface()) {
throw new GLException("Could not lock: "+upstreamSurface);
@@ -73,16 +73,16 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
evalUpstreamSurface(dbgPrefix, surface);
} finally {
upstreamSurface.unlockSurface();
- }
+ }
}
-
+
private final void evalUpstreamSurface(String dbgPrefix, ProxySurface surface) {
//
// evaluate nature of upstreamSurface, may create EGL instances if required
//
-
+
boolean isEGLSurfaceValid = true; // assume yes
-
+
final EGLGraphicsDevice eglDevice;
final AbstractGraphicsConfiguration aConfig;
{
@@ -92,14 +92,14 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
System.err.println(dbgPrefix+"SurfaceDevice: "+surfaceDevice.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(surfaceDevice.hashCode())+", "+surfaceDevice);
System.err.println(dbgPrefix+"SurfaceConfig: "+surfaceConfig.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(surfaceConfig.hashCode())+", "+surfaceConfig);
}
-
- final AbstractGraphicsConfiguration upstreamConfig = upstreamSurface.getGraphicsConfiguration();
+
+ final AbstractGraphicsConfiguration upstreamConfig = upstreamSurface.getGraphicsConfiguration();
final AbstractGraphicsDevice upstreamDevice = upstreamConfig.getScreen().getDevice();
if(DEBUG) {
System.err.println(dbgPrefix+"UpstreamDevice: "+upstreamDevice.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(upstreamDevice.hashCode())+", "+upstreamDevice);
System.err.println(dbgPrefix+"UpstreamConfig: "+upstreamConfig.getClass().getSimpleName()+", hash 0x"+Integer.toHexString(upstreamConfig.hashCode())+", "+upstreamConfig);
}
-
+
if( surfaceDevice instanceof EGLGraphicsDevice ) {
eglDevice = (EGLGraphicsDevice) surfaceDevice;
aConfig = surfaceConfig;
@@ -129,13 +129,13 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
surface.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
}
}
-
+
final GLCapabilitiesImmutable capsRequested = (GLCapabilitiesImmutable) aConfig.getRequestedCapabilities();
final EGLGraphicsConfiguration eglConfig;
if( aConfig instanceof EGLGraphicsConfiguration ) {
// Config is already in EGL type - reuse ..
final EGLGLCapabilities capsChosen = (EGLGLCapabilities) aConfig.getChosenCapabilities();
- if( !isEGLSurfaceValid || !EGLGraphicsConfiguration.isEGLConfigValid(eglDevice.getHandle(), capsChosen.getEGLConfig()) ) {
+ if( !isEGLSurfaceValid || !EGLGraphicsConfiguration.isEGLConfigValid(eglDevice.getHandle(), capsChosen.getEGLConfig()) ) {
// 'refresh' the native EGLConfig handle
capsChosen.setEGLConfig(EGLGraphicsConfiguration.EGLConfigId2EGLConfig(eglDevice.getHandle(), capsChosen.getEGLConfigID()));
if( 0 == capsChosen.getEGLConfig() ) {
@@ -166,7 +166,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
isEGLSurfaceValid = false;
}
surface.setGraphicsConfiguration(eglConfig);
-
+
if(isEGLSurfaceValid) {
isEGLSurfaceValid = EGLDrawable.isValidEGLSurface(eglDevice.getHandle(), upstreamSurface.getSurfaceHandle());
}
@@ -182,15 +182,15 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
if(DEBUG) {
System.err.println(dbgPrefix+"Fin: EGL surface n/a - TBD: "+upstreamSurface);
}
- }
+ }
}
@Override
public final void destroy(ProxySurface surface) {
if(EGLDrawableFactory.DEBUG) {
- System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
+ System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
}
- surface.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
+ surface.clearUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE );
if(upstreamSurface instanceof ProxySurface) {
((ProxySurface)upstreamSurface).destroyNotify();
}
@@ -205,7 +205,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
public final int getHeight(ProxySurface s) {
return upstreamSurface.getHeight();
}
-
+
@Override
public String toString() {
final String us_s = null != upstreamSurface ? ( upstreamSurface.getClass().getName() + ": 0x" + Long.toHexString(upstreamSurface.getSurfaceHandle()) ) : "nil";
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
index f816151c7..e6d43d957 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
@@ -19,16 +19,16 @@ public class EGLWrappedSurface extends WrappedSurface {
}
return new EGLWrappedSurface(surface);
}
-
+
public EGLWrappedSurface(NativeSurface surface) {
super(surface.getGraphicsConfiguration(), EGL.EGL_NO_SURFACE, new EGLUpstreamSurfaceHook(surface), false /* tbd in UpstreamSurfaceHook */);
if(EGLDrawableFactory.DEBUG) {
- System.err.println("EGLWrappedSurface.ctor(): "+this);
+ System.err.println("EGLWrappedSurface.ctor(): "+this);
}
}
@Override
- public final NativeSurface getUpstreamSurface() {
- return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface();
- }
+ public final NativeSurface getUpstreamSurface() {
+ return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface();
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
index 9165dbc4b..a4aa1c7c5 100644
--- a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
+++ b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
@@ -6,9 +6,9 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
** except that Section 2.2 and 11 are omitted. Any differences between
** the Alternative License and the SGI License are offered solely by Sun
** and not by SGI.
-**
+**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,56 +45,56 @@
** $Header$
*/
-/*
+/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
- * * Neither the name of 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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 THE COPYRIGHT OWNER 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
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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
+ * 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.
*/
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -107,7 +107,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -125,7 +125,7 @@ import com.jogamp.common.nio.Buffers;
*
*
* Created 11-jan-2004
- *
+ *
* @author Erik Duijs
* @author Kenneth Russell
*/
@@ -155,7 +155,7 @@ public class ProjectDouble {
private final double[] forward = new double[3];
private final double[] side = new double[3];
private final double[] up = new double[3];
-
+
// Buffer-based implementation
private DoubleBuffer locbuf;
private final DoubleBuffer matrixBuf;
@@ -227,7 +227,7 @@ public class ProjectDouble {
/**
* Method __gluMultMatrixVecd
- *
+ *
* @param matrix
* @param in
* @param out
@@ -244,7 +244,7 @@ public class ProjectDouble {
/**
* Method __gluMultMatrixVecd
- *
+ *
* @param matrix
* @param in
* @param out
@@ -265,7 +265,7 @@ public class ProjectDouble {
/**
* @param src
* @param inverse
- *
+ *
* @return
*/
private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
@@ -335,7 +335,7 @@ public class ProjectDouble {
/**
* @param src
* @param inverse
- *
+ *
* @return
*/
private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
@@ -525,7 +525,7 @@ public class ProjectDouble {
/**
* Method gluOrtho2D.
- *
+ *
* @param left
* @param right
* @param bottom
@@ -537,7 +537,7 @@ public class ProjectDouble {
/**
* Method gluPerspective.
- *
+ *
* @param fovy
* @param aspect
* @param zNear
@@ -570,7 +570,7 @@ public class ProjectDouble {
/**
* Method gluLookAt
- *
+ *
* @param eyex
* @param eyey
* @param eyez
@@ -631,7 +631,7 @@ public class ProjectDouble {
/**
* Method gluProject
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -639,7 +639,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(double objx,
@@ -685,7 +685,7 @@ public class ProjectDouble {
/**
* Method gluProject
- *
+ *
* @param objx
* @param objy
* @param objz
@@ -693,7 +693,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param win_pos
- *
+ *
* @return
*/
public boolean gluProject(double objx,
@@ -738,7 +738,7 @@ public class ProjectDouble {
/**
* Method gluUnproject
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -746,7 +746,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(double winx,
@@ -799,7 +799,7 @@ public class ProjectDouble {
/**
* Method gluUnproject
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -807,7 +807,7 @@ public class ProjectDouble {
* @param projMatrix
* @param viewport
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject(double winx,
@@ -858,7 +858,7 @@ public class ProjectDouble {
/**
* Method gluUnproject4
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -869,7 +869,7 @@ public class ProjectDouble {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(double winx,
@@ -923,7 +923,7 @@ public class ProjectDouble {
/**
* Method gluUnproject4
- *
+ *
* @param winx
* @param winy
* @param winz
@@ -934,7 +934,7 @@ public class ProjectDouble {
* @param near
* @param far
* @param obj_pos
- *
+ *
* @return
*/
public boolean gluUnProject4(double winx,
@@ -987,7 +987,7 @@ public class ProjectDouble {
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
@@ -1014,7 +1014,7 @@ public class ProjectDouble {
/**
* Method gluPickMatrix
- *
+ *
* @param x
* @param y
* @param deltaX
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index 7cd7da53e..b4383c2e6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -6,15 +6,15 @@
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
+**
** http://oss.sgi.com/projects/FreeB
-**
+**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
+**
** NOTE: The Original Code (as defined below) has been licensed to Sun
** Microsystems, Inc. ("Sun") under the SGI Free Software License B
** (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
-**
+**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -45,56 +45,56 @@
** $Header$
*/
-/*
+/*
* Copyright (c) 2002-2004 LWJGL Project
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
+ * modification, are permitted provided that the following conditions are
* met:
- *
- * * Redistributions of source code must retain the above copyright
+ *
+ * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * 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.
*
- * * Neither the name of 'LWJGL' nor the names of
- * its contributors may be used to endorse or promote products derived
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "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 THE COPYRIGHT OWNER 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
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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
+ * 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.
*/
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -107,7 +107,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -124,8 +124,8 @@ import com.jogamp.opengl.util.glsl.ShaderState;
/**
* GLUquadricImpl.java
- *
- *
+ *
+ *
* Created 22-dec-2003 (originally Quadric.java)
* @author Erik Duijs
* @author Kenneth Russell, Sven Gothel
@@ -197,19 +197,19 @@ public class GLUquadricImpl implements GLUquadric {
ImmModeSink res = immModeSink;
if(useGLSL) {
if(null != shaderState) {
- immModeSink = ImmModeSink.createGLSL (32,
- 3, GL.GL_FLOAT, // vertex
+ immModeSink = ImmModeSink.createGLSL (32,
+ 3, GL.GL_FLOAT, // vertex
0, GL.GL_FLOAT, // color
USE_NORM?3:0, normalType, // normal
USE_TEXT?2:0, GL.GL_FLOAT, // texCoords
GL.GL_STATIC_DRAW, shaderState);
} else {
- immModeSink = ImmModeSink.createGLSL (32,
- 3, GL.GL_FLOAT, // vertex
+ immModeSink = ImmModeSink.createGLSL (32,
+ 3, GL.GL_FLOAT, // vertex
0, GL.GL_FLOAT, // color
USE_NORM?3:0, normalType, // normal
USE_TEXT?2:0, GL.GL_FLOAT, // texCoords
- GL.GL_STATIC_DRAW, shaderProgram);
+ GL.GL_STATIC_DRAW, shaderProgram);
}
} else {
immModeSink = ImmModeSink.createFixed(32,
@@ -229,7 +229,7 @@ public class GLUquadricImpl implements GLUquadric {
}
/**
- * specifies the draw style for quadrics.
+ * specifies the draw style for quadrics.
*
* The legal values are as follows:
*
@@ -243,7 +243,7 @@ public class GLUquadricImpl implements GLUquadric {
* separating coplanar faces will not be drawn.
*
* GLU.POINT: Quadrics are rendered as a set of points.
- *
+ *
* @param drawStyle The drawStyle to set
*/
public void setDrawStyle(int drawStyle) {
@@ -260,7 +260,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* GLU.SMOOTH: One normal is generated for every vertex of a quadric. This
* is the default.
- *
+ *
* @param normals The normals to set
*/
public void setNormals(int normals) {
@@ -277,7 +277,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* Note that the interpretation of outward and inward depends on the quadric
* being drawn.
- *
+ *
* @param orientation The orientation to set
*/
public void setOrientation(int orientation) {
@@ -292,7 +292,7 @@ public class GLUquadricImpl implements GLUquadric {
*
* The manner in which texture coordinates are generated depends upon the
* specific quadric rendered.
- *
+ *
* @param textureFlag The textureFlag to set
*/
public void setTextureFlag(boolean textureFlag) {
@@ -512,10 +512,10 @@ public class GLUquadricImpl implements GLUquadric {
glNormal3f(gl, 0.0f, 0.0f, -1.0f);
}
}
-
+
da = 2.0f * PI / slices;
dr = (outerRadius - innerRadius) / loops;
-
+
switch (drawStyle) {
case GLU.GLU_FILL:
{
@@ -648,18 +648,18 @@ public class GLUquadricImpl implements GLUquadric {
* through startAngle + sweepAngle is included (where 0 degrees is along
* the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and
* 270 along the -x axis).
- *
+ *
* The partial disk has a radius of outerRadius, and contains a concentric
* circular hole with a radius of innerRadius. If innerRadius is zero, then
* no hole is generated. The partial disk is subdivided around the z axis
* into slices (like pizza slices), and also about the z axis into rings
* (as specified by slices and loops, respectively).
- *
+ *
* With respect to orientation, the +z side of the partial disk is
* considered to be outside (see gluQuadricOrientation). This means that if
* the orientation is set to GLU.GLU_OUTSIDE, then any normals generated point
* along the +z axis. Otherwise, they point along the -z axis.
- *
+ *
* If texturing is turned on (with gluQuadricTexture), texture coordinates
* are generated linearly such that where r=outerRadius, the value at (r, 0, 0)
* is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
@@ -1204,7 +1204,7 @@ public class GLUquadricImpl implements GLUquadric {
*/
private void normal3f(GL gl, float x, float y, float z) {
float mag;
-
+
mag = (float)Math.sqrt(x * x + y * y + z * z);
if (mag > 0.00001F) {
x /= mag;
diff --git a/src/jogl/classes/jogamp/opengl/glu/Glue.java b/src/jogl/classes/jogamp/opengl/glu/Glue.java
index 636d17f29..2ad3d8c89 100644
--- a/src/jogl/classes/jogamp/opengl/glu/Glue.java
+++ b/src/jogl/classes/jogamp/opengl/glu/Glue.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -89,15 +89,15 @@ public class Glue {
"null control point reference",
"duplicate point on piecewise linear trimming curve"
} ;
-
+
/** Creates a new instance of Glue */
public Glue() {
}
-
+
public static String __gluNURBSErrorString( int errno ) {
return( __gluNurbsErrors[ errno ] );
}
-
+
private static String[] __gluTessErrors = {
" ",
"gluTessBeginPolygon() must precede a gluTessEndPolygon",
@@ -107,7 +107,7 @@ public class Glue {
"a coordinate is too large",
"need combine callback"
};
-
+
public static String __gluTessErrorString( int errno ) {
return( __gluTessErrors[ errno ] );
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/error/Error.java b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
index 2f49db9a4..ffb8d9471 100644
--- a/src/jogl/classes/jogamp/opengl/glu/error/Error.java
+++ b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
@@ -6,9 +6,9 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
@@ -24,13 +24,13 @@
* except that Section 2.2 and 11 are omitted. Any differences between
* the Alternative License and the SGI License are offered solely by Sun
* and not by SGI.
- *
+ *
* Original Code. The Original Code is: OpenGL Sample Implementation,
* Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -53,7 +53,7 @@ import jogamp.opengl.glu.Glue;
* @author Administrator
*/
public class Error {
-
+
private static String[] glErrorStrings = {
"invalid enumerant",
"invalid value",
@@ -63,7 +63,7 @@ public class Error {
"out of memory",
"invalid framebuffer operation"
};
-
+
private static String[] gluErrorStrings = {
"invalid enumerant",
"invalid value",
@@ -71,11 +71,11 @@ public class Error {
"",
"invalid operation"
};
-
+
/** Creates a new instance of Error */
public Error() {
}
-
+
public static String gluErrorString( int errorCode ) {
if( errorCode == 0 ) {
return( "no error" );
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index 2ef4468e5..f57c2310f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -48,7 +48,7 @@ import javax.media.opengl.glu.gl2.GLUgl2;
class GL2CurveEvaluator implements CurveEvaluator {
/**
- * Output triangles (for callback) or render curve
+ * Output triangles (for callback) or render curve
*/
private boolean output_triangles;
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
index 58b565484..f83b3a805 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -43,9 +43,9 @@ import javax.media.opengl.glu.GLUnurbs;
/**
* Base object for working with NURBS curves and surfaces
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class GLUgl2nurbsImpl implements GLUnurbs {
@@ -272,7 +272,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Sets domain distance for dom.dist. sampling in u direction
- *
+ *
* @param d
* distance
*/
@@ -283,7 +283,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Sets domain distance for dom.dist. sampling in v direction
- *
+ *
* @param d
* distance
*/
@@ -303,7 +303,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Calls a method with given name and passes argumet
- *
+ *
* @param name
* name of a method to be called
* @param arg
@@ -329,7 +329,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Calls a method with given name
- *
+ *
* @param name
* name of a method to be called
*/
@@ -349,7 +349,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Begins a NURBS curve
- *
+ *
* @param o_curve
* curve object
*/
@@ -381,7 +381,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Begins new surface
- *
+ *
* @param o_surface
* surface object
*/
@@ -503,7 +503,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Method for handling error codes
- *
+ *
* @param i
* error code
*/
@@ -539,7 +539,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Make a NURBS curve
- *
+ *
* @param nknots
* number of knots in knot vector
* @param knot
@@ -587,7 +587,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Check knot vector specification
- *
+ *
* @param knots
* knot vector
* @param msg
@@ -607,7 +607,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Draw a curve
- *
+ *
* @param o_nurbscurve
* NURBS curve object
*/
@@ -660,7 +660,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Draw NURBS surface
- *
+ *
* @param o_nurbssurface
* NURBS surface object
*/
@@ -704,7 +704,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Define a map of given properties
- *
+ *
* @param type
* map type
* @param rational
@@ -719,7 +719,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Set NURBS property
- *
+ *
* @param type
* property type
* @param tag
@@ -744,7 +744,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Set parameters of existing property
- *
+ *
* @param prop
* property
*/
@@ -755,7 +755,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Set given property to rendering hints
- *
+ *
* @param prop
* property to be set
*/
@@ -767,7 +767,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Sets wheteher we use domain distance sampling
- *
+ *
* @param i
* domain distance sampling flag
*/
@@ -805,7 +805,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
/**
* Make NURBS surface
- *
+ *
* @param sknot_count
* number of knots in s direction
* @param sknot
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
index f5fe17a7b..81a99beab 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -64,7 +64,7 @@ public class BuildMipmap {
/** Creates a new instance of BuildMipmap */
public BuildMipmap() {
}
-
+
public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
int width, int widthPowerOf2, int format, int type, int userLevel,
int baseLevel, int maxLevel, ByteBuffer data ) {
@@ -78,34 +78,34 @@ public class BuildMipmap {
int maxsize;
int cmpts;
PixelStorageModes psm = new PixelStorageModes();
-
+
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 );
-
+
newwidth = widthPowerOf2;
levels = Mipmap.computeLog( newwidth );
-
+
levels += userLevel;
-
+
Mipmap.retrieveStoreModes( gl, psm );
try {
- newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
-
+
Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
cmpts = Mipmap.elements_per_group( format, type );
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-
+
// if swap_bytes was set, swapping occurred in fill_image
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-
+
for( level = userLevel; level <= levels; level++ ) {
if( newImage_width == newwidth ) {
// user newimage for this level
@@ -132,10 +132,10 @@ public class BuildMipmap {
imageTemp = otherImage;
otherImage = newImage;
newImage = imageTemp;
-
+
newImage_width = newwidth;
if( baseLevel <= level && level <= maxLevel ) {
- gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
+ gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
format, GL2.GL_UNSIGNED_SHORT, newImage );
}
}
@@ -148,10 +148,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-
+
return( 0 );
}
-
+
public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
int width, int height, int format, int type, ByteBuffer data ) {
int newwidth[] = new int[1];
@@ -166,37 +166,37 @@ public class BuildMipmap {
int maxsize;
int cmpts;
PixelStorageModes psm = new PixelStorageModes();
-
+
Mipmap.retrieveStoreModes( gl, psm );
-
+
Mipmap.closestFit( gl, target, width, height, internalFormat, format, type, newwidth, newheight );
-
+
levels = Mipmap.computeLog( newwidth[0] );
level = Mipmap.computeLog( newheight[0] );
if( level > levels ) {
levels = level;
}
-
+
try {
- newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
+ newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError ome ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
newImage_width = width;
newImage_height = height;
-
+
Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
-
+
cmpts = Mipmap.elements_per_group( format, type );
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-
+
// if swap_bytes is set, swapping occurred in fill_image
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-
+
for( level = 0; level < levels; level++ ) {
if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
newImage.rewind();
@@ -216,13 +216,13 @@ public class BuildMipmap {
return( GLU.GLU_OUT_OF_MEMORY );
}
}
- ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height,
+ ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height,
newImage, newwidth[0], newheight[0], otherImage );
// swap newImage and otherImage
tempImage = otherImage;
otherImage = newImage;
newImage = tempImage;
-
+
newImage_width = newwidth[0];
newImage_height = newheight[0];
newImage.rewind();
@@ -241,10 +241,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-
+
return( 0 );
}
-
+
public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
int width, int height, int widthPowerOf2, int heightPowerOf2,
int format, int type, int userLevel, int baseLevel, int maxLevel,
@@ -263,19 +263,19 @@ public class BuildMipmap {
int maxsize;
int cmpts;
int mark=-1;
-
+
boolean myswap_bytes;
int groups_per_line, element_size, group_size;
int rowsize, padding;
PixelStorageModes psm = new PixelStorageModes();
-
+
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 && height >= 1 );
-
+
if( type == GL2.GL_BITMAP ) {
return( bitmapBuild2DMipmaps( gl, target, internalFormat, width, height, format, type, data ) );
}
-
+
newwidth = widthPowerOf2;
newheight = heightPowerOf2;
levels = Mipmap.computeLog( newwidth );
@@ -283,9 +283,9 @@ public class BuildMipmap {
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
-
+
Mipmap.retrieveStoreModes( gl, psm );
myswap_bytes = psm.getUnpackSwapBytes();
cmpts = Mipmap.elements_per_group( format, type );
@@ -294,28 +294,28 @@ public class BuildMipmap {
} else {
groups_per_line = width;
}
-
+
element_size = Mipmap.bytes_per_element( type );
group_size = element_size * cmpts;
if( element_size == 1 ) {
myswap_bytes = false;
}
-
+
rowsize = groups_per_line * group_size;
padding = ( rowsize % psm.getUnpackAlignment() );
if( padding != 0 ) {
rowsize += psm.getUnpackAlignment() - padding;
}
-
+
mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
data.position( mark );
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-
+
level = userLevel;
-
+
// already power of two square
if( width == newwidth && height == newheight ) {
// use usersImage for level userLevel
@@ -333,7 +333,7 @@ public class BuildMipmap {
}
int nextWidth = newwidth / 2;
int nextHeight = newheight / 2;
-
+
// clamp to 1
if( nextWidth < 1 ) {
nextWidth = 1;
@@ -342,7 +342,7 @@ public class BuildMipmap {
nextHeight = 1;
}
memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
-
+
try {
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
@@ -452,7 +452,7 @@ public class BuildMipmap {
if( newheight < 1 ) {
newheight = 1;
}
-
+
myswap_bytes = false;
rowsize = newwidth * group_size;
memReq = Mipmap.image_size( newwidth, newheight, format, type );
@@ -498,7 +498,7 @@ public class BuildMipmap {
level = userLevel + 1;
} else { // user's image is not nice powerof2 size square
memReq = Mipmap.image_size( newwidth, newheight, format, type );
- try {
+ try {
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
case( GL2.GL_BYTE ):
@@ -535,15 +535,15 @@ public class BuildMipmap {
data.position( mark );
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
- ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
+ ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
newwidth, newheight, dstImage, element_size, rowsize, group_size );
break;
case( GL2.GL_BYTE ):
- ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
+ ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
newheight, dstImage, element_size, rowsize, group_size );
break;
case( GL2.GL_UNSIGNED_SHORT ):
- ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
+ ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
break;
case( GL2.GL_SHORT ):
@@ -620,7 +620,7 @@ public class BuildMipmap {
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( levels != 0 ) { // use as little memory as possible
int nextWidth = newwidth / 2;
int nextHeight = newheight / 2;
@@ -630,7 +630,7 @@ public class BuildMipmap {
if( nextHeight < 1 ) {
nextHeight = 1;
}
-
+
memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
try {
switch( type ) {
@@ -670,7 +670,7 @@ public class BuildMipmap {
// level userLevel is in srcImage; nothing saved yet
level = userLevel;
}
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
if( baseLevel <= level && level <= maxLevel ) {
srcImage.rewind();
@@ -685,7 +685,7 @@ public class BuildMipmap {
}
}
}
-
+
level++; // update current level for the loop
for( ; level <= levels; level++ ) {
srcImage.rewind();
@@ -754,12 +754,12 @@ public class BuildMipmap {
assert( false );
break;
}
-
+
// swap dstImage and srcImage
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( newwidth > 1 ) {
newwidth /= 2;
rowsize /= 2;
@@ -769,7 +769,7 @@ public class BuildMipmap {
}
// compute amount to pad per row if any
int rowPad = rowsize % psm.getUnpackAlignment();
-
+
// should row be padded
if( rowPad == 0 ) {
// call teximage with srcImage untouched since its not padded
@@ -792,7 +792,7 @@ public class BuildMipmap {
int ii, jj;
int dstTrav;
int srcTrav;
-
+
// allocate new image for mipmap of size newRowLength x newheight
ByteBuffer newMipmapImage = null;
try {
@@ -813,7 +813,7 @@ public class BuildMipmap {
newMipmapImage.put( srcImage.get() );
}
}
-
+
// and use this new image for mipmapping instead
if( baseLevel <= level && level <= maxLevel ) {
newMipmapImage.rewind();
@@ -833,10 +833,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
-
+
return( 0 );
}
-
+
public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
int components, int width, int height, int format, int type, ByteBuffer data ) {
int[] newwidth = new int[1];
@@ -850,22 +850,22 @@ public class BuildMipmap {
int memReq;
int maxsize;
int cmpts;
-
- Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
+
+ Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
newheight );
-
+
levels = Mipmap.computeLog( newwidth[0] );
level = Mipmap.computeLog( newheight[0] );
if( level > levels ) {
levels = level;
}
-
+
cmpts = Mipmap.elements_per_group( format, type );
-
+
otherImage = null;
// No need to copy the user data if its packed correctly.
// Make sure that later routines don't change that data.
-
+
if( psm.getUnpackSkipRows() == 0 && psm.getUnpackSkipPixels() == 0 ) {
newImage = data;
newImage_width = width;
@@ -878,7 +878,7 @@ public class BuildMipmap {
int iter;
int iter2;
int i, j;
-
+
try {
newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
} catch( OutOfMemoryError err ) {
@@ -896,7 +896,7 @@ public class BuildMipmap {
rowsize = group_per_line * cmpts;
elements_per_line = width * cmpts;
start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * cmpts;
-
+
for( i = 0; i < height; i++ ) {
iter = start;
data.position( iter );
@@ -906,13 +906,13 @@ public class BuildMipmap {
start += rowsize;
}
}
-
+
gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
-
+
for( level = 0; level <= levels; level++ ) {
if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
// use newImage for this level
@@ -937,7 +937,7 @@ public class BuildMipmap {
imageTemp = otherImage;
otherImage = newImage;
newImage = imageTemp;
-
+
newImage_width = newwidth[0];
newImage_height = newheight[0];
newImage.rewind();
@@ -956,10 +956,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
-
+
return( 0 );
}
-
+
public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
@@ -977,19 +977,19 @@ public class BuildMipmap {
int maxSize;
int cmpts;
int mark=-1;
-
+
boolean myswapBytes;
int groupsPerLine, elementSize, groupSize;
int rowsPerImage, imageSize;
int rowSize, padding;
PixelStorageModes psm = new PixelStorageModes();
-
+
assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
assert( width >= 1 && height >= 1 && depth >= 1 );
assert( type != GL2.GL_BITMAP );
-
+
srcImage = dstImage = null;
-
+
newWidth = widthPowerOf2;
newHeight = heightPowerOf2;
newDepth = depthPowerOf2;
@@ -1002,9 +1002,9 @@ public class BuildMipmap {
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
-
+
Mipmap.retrieveStoreModes3D( gl, psm );
myswapBytes = psm.getUnpackSwapBytes();
cmpts = Mipmap.elements_per_group( format, type );
@@ -1013,42 +1013,42 @@ public class BuildMipmap {
} else {
groupsPerLine = width;
}
-
+
elementSize = Mipmap.bytes_per_element( type );
groupSize = elementSize * cmpts;
if( elementSize == 1 ) {
myswapBytes = false;
}
-
+
// 3dstuff
if( psm.getUnpackImageHeight() > 0 ) {
rowsPerImage = psm.getUnpackImageHeight();
} else {
rowsPerImage = height;
}
-
+
rowSize = groupsPerLine * groupSize;
padding = ( rowSize % psm.getUnpackAlignment() );
if( padding != 0 ) {
rowSize += psm.getUnpackAlignment() - padding;
}
-
+
imageSize = rowsPerImage * rowSize;
-
+
usersImage = ByteBuffer.wrap(data.array());
mark = psm.getUnpackSkipRows() * rowSize +
psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize;
usersImage.position( mark );
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
-
+
level = userLevel;
-
+
if( width == newWidth && height == newHeight && depth == newDepth ) {
// use usersImage for level userlevel
if( baseLevel <= level && level <= maxLevel ) {
@@ -1068,7 +1068,7 @@ public class BuildMipmap {
int nextWidth = newWidth / 2;
int nextHeight = newHeight / 2;
int nextDepth = newDepth / 2;
-
+
// clamp to one
if( nextWidth < 1 ) {
nextWidth = 1;
@@ -1116,13 +1116,13 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
if( dstImage != null ) {
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
if( depth > 1 ) {
HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
- usersImage, dstImage, elementSize,
+ usersImage, dstImage, elementSize,
groupSize, rowSize, imageSize, myswapBytes );
} else {
HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
@@ -1145,7 +1145,7 @@ public class BuildMipmap {
usersImage, dstImage, elementSize, groupSize, rowSize,
imageSize, myswapBytes );
} else {
- HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
+ HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
}
break;
@@ -1257,7 +1257,7 @@ public class BuildMipmap {
if( newDepth < 1 ) {
newDepth = 1;
}
-
+
myswapBytes = false;
rowSize = newWidth * groupSize;
imageSize = rowSize * newHeight;
@@ -1302,7 +1302,7 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
// level userLevel + 1 is in srcImage; level userLevel already saved
level = userLevel + 1;
} else {
@@ -1343,10 +1343,10 @@ public class BuildMipmap {
gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
ScaleInternal.gluScaleImage3D( gl, format, width, height, depth, type,
usersImage, newWidth, newHeight, newDepth, type, dstImage );
-
+
myswapBytes = false;
rowSize = newWidth * groupSize;
imageSize = rowSize * newHeight;
@@ -1354,7 +1354,7 @@ public class BuildMipmap {
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( levels != 0 ) {
int nextWidth = newWidth / 2;
int nextHeight = newHeight / 2;
@@ -1409,7 +1409,7 @@ public class BuildMipmap {
// level userLevel is in srcImage; nothing saved yet
level = userLevel;
}
-
+
gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
if( baseLevel <= level && level <= maxLevel ) {
usersImage.position( mark );
@@ -1541,11 +1541,11 @@ public class BuildMipmap {
assert( false );
break;
}
-
+
tempImage = srcImage;
srcImage = dstImage;
dstImage = tempImage;
-
+
if( newWidth > 1 ) {
newWidth /= 2;
rowSize /= 2;
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
index a564269fb..0eee9bf32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 10ea1d729..5269024b4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract1010102 implements Extract {
-
+
/** Creates a new instance of Extract1010102 */
public Extract1010102() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111111,11000000,00000000,00000000 == 0xFFC00000
// 00000000,00111111,11110000,00000000 == 0x003F0000
// 00000000,00000000,00001111,11111100 == 0x00000FFC
// 00000000,00000000,00000000,00000011 == 0x00000003
-
+
extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
extractComponents[2] = (float)( ( uint & 0x00000FFC ) >> 2 ) / 1023.0f;
extractComponents[3] = (float)( ( uint & 0x00000003 ) ) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) << 22) & 0xFFC00000 );
uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) << 12) & 0x003FF000 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 1234da5f8..6982931d3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract1555rev implements Extract {
-
+
/** Creates a new instance of Extract1555rev */
public Extract1555rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 00000000,00011111 == 0x001F
// 00000011,11100000 == 0x03E0
// 01111100,00000000 == 0x7C00
// 10000000,00000000 == 0x8000
-
+
extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x003E ) >> 5 ) / 31.0f;
extractComponents[2] = (float)( ( ushort & 0x7C00 ) >> 10) / 31.0f;
extractComponents[3] = (float)( ( ushort & 0x8000 ) >> 15);
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 00000000,00011111 == 0x001F
// 00000011,11100000 == 0x03E0
// 01111100,00000000 == 0x7C00
// 10000000,00000000 == 0x8000
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) << 5) & 0x000003E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 226254f99..1c7db6218 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract2101010rev implements Extract {
-
+
/** Creates a new instance of Extract2101010 */
public Extract2101010rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111111,11000000,00000000,00000000 == 0xFFC00000
// 00000000,00111111,11110000,00000000 == 0x003F0000
// 00000000,00000000,00001111,11111100 == 0x00000FFC
// 00000000,00000000,00000000,00000011 == 0x00000003
-
+
extractComponents[0] = (float)( ( uint & 0x000003FF ) ) / 1023.0f;
extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) ) & 0x000003FF );
uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) << 10) & 0x000FFC00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index 9fa2a3a54..672c86c32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract233rev implements Extract {
-
+
/** Creates a new instance of Extract223rev */
public Extract233rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
@@ -65,16 +65,16 @@ public class Extract233rev implements Extract {
extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
// 00000011 == 0x03
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) ) & 0x07 );
b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 3 ) & 0x38 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 92d141be5..6cdbc5cb0 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class Extract332 implements Extract {
-
+
/** Creates a new instance of Extract332 */
public Extract332() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
@@ -65,16 +65,16 @@ public class Extract332 implements Extract {
extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
// 00000011 == 0x03
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) << 5 ) & 0xE0 );
b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 2 ) & 0x1C );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index af99d154c..b36b9fb82 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,41 +51,41 @@ import java.nio.*;
* @author Administrator
*/
public class Extract4444 implements Extract {
-
+
/** Creates a new instance of Extract4444 */
public Extract4444() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
extractComponents[3] = (float)( ( ushort & 0x000F ) ) / 15.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) << 12) & 0x0000F000 );
ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 8) & 0x00000F00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index e5bce60d8..b7a3ed55f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract4444rev implements Extract {
-
+
/** Creates a new instance of Extract4444rev */
public Extract4444rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 00000000,00001111 == 0x000F
// 00000000,11110000 == 0x00F0
// 00001111,00000000 == 0x0F00
// 11110000,00000000 == 0xF000
-
+
extractComponents[0] = (float)( ( ushort & 0x000F ) ) / 15.0f;
extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) ) & 0x0000000F );
ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 4) & 0x000000F0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 5c383103e..4dc566b25 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract5551 implements Extract {
-
+
/** Creates a new instance of Extract5551 */
public Extract5551() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11000000 == 0x07C0
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
-
+
extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 6 ) / 31.0f;
extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 1 ) / 31.0f;
extractComponents[3] = (float)( ( ushort & 0xF000 ) );
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) << 6) & 0x000007C0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index f6193dd2d..e198e46d4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,38 +51,38 @@ import java.nio.*;
* @author Administrator
*/
public class Extract565 implements Extract {
-
+
/** Creates a new instance of Extract565 */
public Extract565() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11100000 == 0x07E0
// 00000000,00111111 == 0x001F
-
+
extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11111000,00000000 == 0xF800
// 00000111,11100000 == 0x07E0
// 00000000,00111111 == 0x001F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index 2e455adfa..fe19540ee 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,38 +51,38 @@ import java.nio.*;
* @author Administrator
*/
public class Extract565rev implements Extract {
-
+
/** Creates a new instance of Extract565rev */
public Extract565rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
-
+
if( isSwap ) {
ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
} else {
ushort = 0x0000FFFF & packedPixel.getShort();
}
-
+
// 00000000,00011111 == 0x001F
// 00000111,11100000 == 0x07E0
// 11111000,00000000 == 0xF800
-
+
extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 00000000,00111111 == 0x001F
// 00000111,11100000 == 0x07E0
// 11111000,00000000 == 0xF800
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index 137fa3c21..4602f2af9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract8888 implements Extract {
-
+
/** Creates a new instance of Extract8888 */
public Extract8888() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11000000 == 0x07C0
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
-
+
extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
extractComponents[3] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 255) + 0.5f) << 24) & 0xFF000000 );
uint |= (((int)((shoveComponents[1] * 255) + 0.5f) << 16) & 0x00FF0000 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 2ac942c84..373cb102a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,42 +51,42 @@ import java.nio.*;
* @author Administrator
*/
public class Extract8888rev implements Extract {
-
+
/** Creates a new instance of Extract8888rev */
public Extract8888rev() {
}
-
+
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
-
+
if( isSwap ) {
uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
} else {
uint = 0x00000000FFFFFFFF & packedPixel.getInt();
}
-
+
// 11111000,00000000 == 0xF800
// 00000111,11000000 == 0x07C0
// 00000000,00111110 == 0x003E
// 00000000,00000001 == 0x0001
-
+
extractComponents[0] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
}
-
+
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
// 00000000,11110000 == 0x00F0
// 00000000,00001111 == 0x000F
-
+
assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
-
+
// due to limited precision, need to round before shoving
long uint = (((int)((shoveComponents[0] * 255) + 0.5f) ) & 0x000000FF );
uint |= (((int)((shoveComponents[1] * 255) + 0.5f) << 8) & 0x0000FF00 );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index 52c2191b9..ac0f2f290 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractFloat implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractFloat */
public ExtractFloat() {
}
-
+
public double extract( boolean isSwap, ByteBuffer data ) {
float f = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractFloat implements ExtractPrimitive {
assert( f <= 1.0f );
return( f );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 1.0);
data.asFloatBuffer().put( index, (float)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
index 926096649..a44fb9508 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractPrimitive.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index 2e1a9a0a6..399386e30 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,17 +51,17 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class ExtractSByte implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractUByte */
public ExtractSByte() {
}
-
+
public double extract( boolean isSwap, ByteBuffer sbyte ) {
byte b = sbyte.get();
assert( b <= 127 );
return( b );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
data.position( index );
data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index ca80747c4..be3fb3092 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractSInt implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractSInt */
public ExtractSInt() {
}
-
+
public double extract( boolean isSwap, ByteBuffer uint ) {
int i = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractSInt implements ExtractPrimitive {
assert( i <= 0x7FFFFFFF );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < Integer.MAX_VALUE);
IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 979c3b449..1e123c9b4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractSShort implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractSShort */
public ExtractSShort() {
}
-
+
public double extract( boolean isSwap, ByteBuffer ushort ) {
short s = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractSShort implements ExtractPrimitive {
assert( s <= 32767 );
return( s );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 32768.0);
ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 4d14212ab..26ca5cd40 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,17 +51,17 @@ import java.nio.ByteBuffer;
* @author Administrator
*/
public class ExtractUByte implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractUByte */
public ExtractUByte() {
}
-
+
public double extract( boolean isSwap, ByteBuffer ubyte ) {
int i = 0x000000FF & ubyte.get();
assert( i <= 255 );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 256.0);
data.position( index );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index c088ca301..8c94c89fc 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractUInt implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtractUInt */
public ExtractUInt() {
}
-
+
public double extract( boolean isSwap, ByteBuffer uint ) {
long i = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractUInt implements ExtractPrimitive {
assert( i <= 0xFFFFFFFF );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 0xFFFFFFFF);
IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 81db60f0f..55115c6f7 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import java.nio.*;
* @author Administrator
*/
public class ExtractUShort implements ExtractPrimitive {
-
+
/** Creates a new instance of ExtracUShort */
public ExtractUShort() {
}
-
+
public double extract( boolean isSwap, ByteBuffer ushort ) {
int i = 0;
if( isSwap ) {
@@ -66,7 +66,7 @@ public class ExtractUShort implements ExtractPrimitive {
assert( i <= 65535 );
return( i );
}
-
+
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 65536.0);
ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
index 7549044ba..184c5fda8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -52,11 +52,11 @@ import java.nio.*;
* @author Administrator
*/
public class HalveImage {
-
+
private static final int BOX2 = 2;
private static final int BOX4 = 4;
private static final int BOX8 = 8;
-
+
public static void halveImage( int components, int width, int height,
ShortBuffer datain, ShortBuffer dataout ) {
int i, j, k;
@@ -64,11 +64,11 @@ public class HalveImage {
int delta;
int t = 0;
short temp = 0;
-
+
newwidth = width / 2;
newheight = height /2;
delta = width * components;
-
+
// Piece of cake
for( i = 0; i < newheight; i++ ) {
for( j = 0; j < newwidth; j++ ) {
@@ -91,7 +91,7 @@ public class HalveImage {
t += delta;
}
}
-
+
public static void halveImage_ubyte( int components, int width, int height,
ByteBuffer datain, ByteBuffer dataout,
int element_size, int ysize, int group_size ) {
@@ -99,19 +99,19 @@ public class HalveImage {
int newwidth, newheight;
int s;
int t;
-
+
// Handle case where there is only 1 column/row
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) ); // can't be 1x1
halve1Dimage_ubyte( components, width, height, datain, dataout, element_size, ysize, group_size );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
s = 0;
t = 0;
-
+
int temp = 0;
// piece of cake
for( i = 0; i < newheight; i++ ) {
@@ -133,9 +133,9 @@ public class HalveImage {
t += ysize;
}
}
-
+
public static void halve1Dimage_ubyte( int components, int width, int height,
- ByteBuffer datain, ByteBuffer dataout,
+ ByteBuffer datain, ByteBuffer dataout,
int element_size, int ysize, int group_size ) {
int halfWidth = width / 2;
int halfHeight = height / 2;
@@ -143,14 +143,14 @@ public class HalveImage {
int dest = 0;
int jj;
int temp = 0;
-
+
assert( width == 1 || height == 1 ); // Must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -161,7 +161,7 @@ public class HalveImage {
temp /= 2;
dataout.put( (byte)temp );
/*
- dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
+ dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
(0x000000FF & datain.setIndexInBytes( src + group_size ).getByte())) / 2 ) );
*/
src += element_size;
@@ -188,7 +188,7 @@ public class HalveImage {
temp /= 2;
dataout.put( (byte)temp );
/*
- dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
+ dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
(0x000000FF & datain.setIndexInBytes(src + ysize).getByte()) ) / 2 ) );
*/
src += element_size;
@@ -202,7 +202,7 @@ public class HalveImage {
assert( src == ysize * height );
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_byte( int components, int width, int height,
ByteBuffer datain, ByteBuffer dataout, int element_size,
int ysize, int group_size ) {
@@ -211,7 +211,7 @@ public class HalveImage {
int s = 0;
int t = 0;
byte temp = (byte)0;
-
+
// handle case where there is only 1 column
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) );
@@ -219,10 +219,10 @@ public class HalveImage {
ysize, group_size );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
for( i = 0; i < newheight; i++ ) {
for( j = 0; j < newwidth; j++ ) {
for( k = 0; k < components; k++ ) {
@@ -244,7 +244,7 @@ public class HalveImage {
t += ysize;
}
}
-
+
public static void halve1Dimage_byte( int components, int width, int height,
ByteBuffer datain, ByteBuffer dataout,
int element_size, int ysize, int group_size ) {
@@ -254,14 +254,14 @@ public class HalveImage {
int dest = 0;
int jj;
byte temp = (byte)0;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -284,7 +284,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -303,7 +303,7 @@ public class HalveImage {
}
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_ushort( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -319,10 +319,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -364,7 +364,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_ushort( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -373,14 +373,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < halfHeight; kk++ ) {
@@ -410,7 +410,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -437,7 +437,7 @@ public class HalveImage {
}
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_short( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -453,10 +453,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -504,7 +504,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_short( int components, int width, int height,
ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -513,14 +513,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -550,7 +550,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -577,7 +577,7 @@ public class HalveImage {
}
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
-
+
public static void halveImage_uint( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -586,7 +586,7 @@ public class HalveImage {
int s = 0;
int t = 0;
double temp = 0;
-
+
// handle case where there is only 1 column/row
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) ); // can't be 1x1
@@ -594,10 +594,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -643,7 +643,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_uint( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -652,14 +652,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // widthxheight can't be 1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < halfHeight; kk++ ) {
@@ -689,7 +689,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -716,7 +716,7 @@ public class HalveImage {
}
assert( dest == components * element_size * halfWidth * halfHeight );
}
-
+
public static void halveImage_int( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -725,7 +725,7 @@ public class HalveImage {
int s = 0;
int t = 0;
int temp = 0;
-
+
// handle case where there is only 1 column/row
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) ); // can't be 1x1
@@ -733,10 +733,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -785,7 +785,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_int( int components, int width, int height,
ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -794,14 +794,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -831,7 +831,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -858,7 +858,7 @@ public class HalveImage {
}
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
-
+
public static void halveImage_float( int components, int width, int height,
ByteBuffer datain, FloatBuffer dataout, int element_size,
int ysize, int group_size, boolean myswap_bytes ) {
@@ -874,10 +874,10 @@ public class HalveImage {
ysize, group_size, myswap_bytes );
return;
}
-
+
newwidth = width / 2;
newheight = height / 2;
-
+
// Piece of cake
if( !myswap_bytes ) {
for( i = 0; i < newheight; i++ ) {
@@ -920,7 +920,7 @@ public class HalveImage {
}
}
}
-
+
public static void halve1Dimage_float( int components, int width, int height,
ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
@@ -929,14 +929,14 @@ public class HalveImage {
int src = 0;
int dest = 0;
int jj;
-
+
assert( width == 1 || height == 1 ); // must be 1D
assert( width != height ); // can't be square
-
+
if( height == 1 ) { // 1 row
assert( width != 1 ); // can't be 1x1
halfHeight = 1;
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -966,7 +966,7 @@ public class HalveImage {
halfWidth = 1;
// one vertical column with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
int kk;
for( kk = 0; kk < components; kk++ ) {
@@ -993,9 +993,9 @@ public class HalveImage {
}
assert( dest == ( components * element_size * halfWidth * halfHeight ) );
}
-
- public static void halveImagePackedPixel( int components, Extract extract, int width,
- int height, ByteBuffer datain, ByteBuffer dataout,
+
+ public static void halveImagePackedPixel( int components, Extract extract, int width,
+ int height, ByteBuffer datain, ByteBuffer dataout,
int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
if( width == 1 || height == 1 ) {
assert( !( width == 1 && height == 1 ) );
@@ -1004,19 +1004,19 @@ public class HalveImage {
return;
}
int ii, jj;
-
+
int halfWidth = width / 2;
int halfHeight = height / 2;
int src = 0;
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
-
+
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX4][4];
int cc;
-
+
datain.position( src );
extract.extract( isSwap, datain, extractTotals[0] );
datain.position( src + pixelSizeInBytes );
@@ -1045,7 +1045,7 @@ public class HalveImage {
assert( src == rowSizeInBytes * height );
assert( outIndex == halfWidth * halfHeight );
}
-
+
public static void halve1DimagePackedPixel( int components, Extract extract, int width,
int height, ByteBuffer datain, ByteBuffer dataout,
int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
@@ -1053,23 +1053,23 @@ public class HalveImage {
int halfHeight = height / 2;
int src = 0;
int jj;
-
+
assert( width == 1 || height == 1 );
assert( width != height );
-
+
if( height == 1 ) {
int outIndex = 0;
-
+
assert( width != 1 );
halfHeight = 1;
-
+
// one horizontal row with possible pad bytes
-
+
for( jj = 0; jj < halfWidth; jj++ ) {
float[] totals = new float[4];
float[][] extractTotals = new float[BOX2][4];
int cc;
-
+
datain.position( src );
extract.extract( isSwap, datain, extractTotals[0] );
datain.position( src + pixelSizeInBytes );
@@ -1090,17 +1090,17 @@ public class HalveImage {
}
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
src += padBytes;
-
+
assert( src == rowSizeInBytes );
assert( outIndex == halfWidth * halfHeight );
} else if( width == 1 ) {
int outIndex = 0;
-
+
assert( height != 1 );
halfWidth = 1;
// one vertical volumn with possible pad bytes per row
// average two at a time
-
+
for( jj = 0; jj < halfHeight; jj++ ) {
float[] totals = new float[4];
float[][] extractTotals = new float[BOX2][4];
@@ -1128,7 +1128,7 @@ public class HalveImage {
assert( outIndex == halfWidth * halfHeight );
}
}
-
+
public static void halveImagePackedPixelSlice( int components, Extract extract,
int width, int height, int depth, ByteBuffer dataIn,
ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
@@ -1140,26 +1140,26 @@ public class HalveImage {
int src = 0;
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
-
+
assert( (width == 1 || height == 1) && depth >= 2 );
-
+
if( width == height ) {
assert( width == 1 && height == 1 );
assert( depth >= 2 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX2][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[1] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
-
+
// average only 2 pixels since a column
totals[cc]= 0.0f;
for( kk = 0; kk < BOX2; kk++ ) {
@@ -1167,7 +1167,7 @@ public class HalveImage {
}
totals[cc] /= BOX2;
} // for cc
-
+
extract.shove( totals, outIndex, dataOut );
outIndex++;
// skip over to next group of 2
@@ -1175,13 +1175,13 @@ public class HalveImage {
} // for ii
} else if( height == 1 ) {
assert( width != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX4][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + pixelSizeInBytes );
@@ -1190,10 +1190,10 @@ public class HalveImage {
extract.extract( isSwap, dataIn, extractTotals[2] );
dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[3] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
-
+
// grab 4 pixels to average
totals[cc] = 0.0f;
for( kk = 0; kk < BOX4; kk++ ) {
@@ -1209,13 +1209,13 @@ public class HalveImage {
}
} else if( width == 1 ) {
assert( height != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4];
float extractTotals[][] = new float[BOX4][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + rowSizeInBytes );
@@ -1224,10 +1224,10 @@ public class HalveImage {
extract.extract( isSwap, dataIn, extractTotals[2] );
dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[3] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
-
+
// grab 4 pixels to average
totals[cc] = 0.0f;
for( kk = 0; kk < BOX4; kk++ ) {
@@ -1243,7 +1243,7 @@ public class HalveImage {
}
}
}
-
+
public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
@@ -1255,25 +1255,25 @@ public class HalveImage {
int src = 0;
int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
int outIndex = 0;
-
+
assert( (width == 1 || height == 1) && depth >= 2 );
-
+
if( width == height ) {
assert( width == 1 && height == 1 );
assert( depth >= 2 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
int cc;
for( cc = 0; cc < components; cc++ ) {
double[] totals = new double[4];
double[][] extractTotals = new double[BOX2][4];
int kk;
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + imageSizeInBytes );
extractTotals[1][cc] = extract.extract( isSwap, dataIn );
-
+
// average 2 pixels since only a column
totals[cc] = 0.0f;
// totals[red] = extractTotals[0][red] + extractTotals[1][red];
@@ -1282,7 +1282,7 @@ public class HalveImage {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX2;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
src += elementSizeInBytes;
@@ -1290,12 +1290,12 @@ public class HalveImage {
// skip over next group of 2
src += rowSizeInBytes;
} // for ii
-
+
assert( src == rowSizeInBytes * height * depth );
assert( outIndex == halfDepth * components );
} else if( height == 1 ) {
assert( width != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
int cc;
@@ -1303,7 +1303,7 @@ public class HalveImage {
int kk;
double totals[] = new double[4];
double extractTotals[][] = new double[BOX4][4];
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + groupSizeInBytes );
@@ -1312,7 +1312,7 @@ public class HalveImage {
extractTotals[2][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-
+
// grab 4 pixels to average
totals[cc] = 0.0f;
// totals[red] = extractTotals[0][red] + extractTotals[1][red] +
@@ -1322,7 +1322,7 @@ public class HalveImage {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX4;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
src += elementSizeInBytes;
@@ -1337,7 +1337,7 @@ public class HalveImage {
assert( outIndex == halfWidth * halfDepth * components );
} else if( width == 1 ) {
assert( height != 1 );
-
+
for( ii = 0; ii < halfDepth; ii++ ) {
for( jj = 0; jj < halfHeight; jj++ ) {
int cc;
@@ -1345,7 +1345,7 @@ public class HalveImage {
int kk;
double totals[] = new double[4];
double extractTotals[][] = new double[BOX4][4];
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + rowSizeInBytes );
@@ -1354,8 +1354,8 @@ public class HalveImage {
extractTotals[2][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
extractTotals[3][cc] = extract.extract( isSwap, dataIn );
-
-
+
+
// grab 4 pixels to average
totals[cc] = 0.0f;
// totals[red] = extractTotals[0][red] + extractTotals[1][red] +
@@ -1365,7 +1365,7 @@ public class HalveImage {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX4;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
src += elementSizeInBytes;
@@ -1380,32 +1380,32 @@ public class HalveImage {
assert( outIndex == halfWidth * halfDepth * components );
}
}
-
+
public static void halveImage3D( int components, ExtractPrimitive extract,
int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
int imageSizeInBytes, boolean isSwap ) {
assert( depth > 1 );
-
+
// horizontal/vertical/onecolumn slice viewed from top
if( width == 1 || height == 1 ) {
assert( 1 <= depth );
-
+
halveImageSlice( components, extract, width, height, depth, dataIn, dataOut,
elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes,
isSwap );
return;
}
-
+
int ii, jj, dd;
-
+
int halfWidth = width / 2;
int halfHeight = height / 2;
int halfDepth = depth / 2;
int src = 0;
int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
int outIndex = 0;
-
+
for( dd = 0; dd < halfDepth; dd++ ) {
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
@@ -1414,7 +1414,7 @@ public class HalveImage {
int kk;
double totals[] = new double[4];
double extractTotals[][] = new double[BOX8][4];
-
+
dataIn.position( src );
extractTotals[0][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + groupSizeInBytes );
@@ -1431,17 +1431,17 @@ public class HalveImage {
extractTotals[6][cc] = extract.extract( isSwap, dataIn );
dataIn.position( src + rowSizeInBytes + imageSizeInBytes + groupSizeInBytes );
extractTotals[7][cc] = extract.extract( isSwap, dataIn );
-
+
totals[cc] = 0.0f;
-
+
for( kk = 0; kk < BOX8; kk++ ) {
totals[cc] += extractTotals[kk][cc];
}
totals[cc] /= (double)BOX8;
-
+
extract.shove( totals[cc], outIndex, dataOut );
outIndex++;
-
+
src += elementSizeInBytes;
} // for cc
// skip over to next square of 4
@@ -1456,40 +1456,40 @@ public class HalveImage {
assert( src == rowSizeInBytes * height * depth );
assert( outIndex == halfWidth * halfHeight * halfDepth * components );
}
-
+
public static void halveImagePackedPixel3D( int components, Extract extract,
- int width, int height, int depth, ByteBuffer dataIn,
+ int width, int height, int depth, ByteBuffer dataIn,
ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
int imageSizeInBytes, boolean isSwap ) {
if( depth == 1 ) {
assert( 1 <= width && 1 <= height );
-
+
halveImagePackedPixel( components, extract, width, height, dataIn, dataOut,
pixelSizeInBytes, rowSizeInBytes, isSwap );
return;
} else if( width == 1 || height == 1 ) { // a horizontal or vertical slice viewed from top
assert( 1 <= depth );
-
+
halveImagePackedPixelSlice( components, extract, width, height, depth, dataIn,
dataOut, pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap );
return;
}
int ii, jj, dd;
-
+
int halfWidth = width / 2;
int halfHeight = height / 2;
int halfDepth = depth / 2;
int src = 0;
int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
int outIndex = 0;
-
+
for( dd = 0; dd < halfDepth; dd++ ) {
for( ii = 0; ii < halfHeight; ii++ ) {
for( jj = 0; jj < halfWidth; jj++ ) {
float totals[] = new float[4]; // 4 is max components
float extractTotals[][] = new float[BOX8][4];
int cc;
-
+
dataIn.position( src );
extract.extract( isSwap, dataIn, extractTotals[0] );
dataIn.position( src + pixelSizeInBytes );
@@ -1506,7 +1506,7 @@ public class HalveImage {
extract.extract( isSwap, dataIn, extractTotals[6] );
dataIn.position( src + rowSizeInBytes + pixelSizeInBytes + imageSizeInBytes );
extract.extract( isSwap, dataIn, extractTotals[7] );
-
+
for( cc = 0; cc < components; cc++ ) {
int kk;
// grab 8 pixels to average
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
index b610ce86b..18f814dde 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -53,18 +53,18 @@ import java.nio.*;
* @author Administrator
*/
public class Image {
-
+
/** Creates a new instance of Image */
public Image() {
}
-
+
public static short getShortFromByteArray( byte[] array, int index ) {
short s;
s = (short)(array[index] << 8 );
s |= (short)(0x00FF & array[index+1]);
return( s );
}
-
+
public static int getIntFromByteArray( byte[] array, int index ) {
int i;
i = ( array[index] << 24 ) & 0xFF000000;
@@ -73,12 +73,12 @@ public class Image {
i |= ( array[index+3] ) & 0x000000FF;
return( i );
}
-
+
public static float getFloatFromByteArray( byte[] array, int index ) {
int i = getIntFromByteArray( array, index );
return( Float.intBitsToFloat(i) );
}
-
+
/*
* Extract array from user's data applying all pixel store modes.
* The internal format used is an array of unsigned shorts.
@@ -98,7 +98,7 @@ public class Image {
int iter2;
int i, j, k;
boolean myswap_bytes;
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -139,7 +139,7 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
myswap_bytes = psm.getUnpackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getUnpackRowLength() > 0 ) {
@@ -147,12 +147,12 @@ public class Image {
} else {
groups_per_line = width;
}
-
+
// All formats except GL_BITMAP fall out trivially
if( type == GL2.GL_BITMAP ) {
int bit_offset;
int current_bit;
-
+
rowsize = ( groups_per_line * components + 7 ) / 8;
padding = ( rowsize % psm.getUnpackAlignment() );
if( padding != 0 ) {
@@ -200,7 +200,7 @@ public class Image {
if( element_size == 1 ) {
myswap_bytes = false;
}
-
+
rowsize = groups_per_line * group_size;
padding = ( rowsize % psm.getUnpackAlignment() );
if( padding != 0 ) {
@@ -208,7 +208,7 @@ public class Image {
}
start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
elements_per_line = width * components;
-
+
iter2 = 0;
for( i = 0; i < height; i++ ) {
iter = start;
@@ -364,7 +364,7 @@ public class Image {
// want iter pointing at start, not within, row for assertion purposes
iter = start;
} // for i
-
+
// iterators should be one byte past end
if( !Mipmap.isTypePackedPixel( type ) ) {
assert( iter2 == ( width * height * components ) );
@@ -374,16 +374,16 @@ public class Image {
assert( iter == ( rowsize * height + psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size ) );
}
}
-
+
/*
* Insert array into user's data applying all pixel store modes.
* Theinternal format is an array of unsigned shorts.
* empty_image() because it is the opposet of fill_image().
*/
- public static void empty_image( PixelStorageModes psm, int width, int height,
- int format, int type, boolean index_format,
+ public static void empty_image( PixelStorageModes psm, int width, int height,
+ int format, int type, boolean index_format,
ShortBuffer oldimage, ByteBuffer userdata ) {
-
+
int components;
int element_size;
int rowsize;
@@ -396,7 +396,7 @@ public class Image {
int iter2;
int i, j, k;
boolean myswap_bytes;
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -437,7 +437,7 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
myswap_bytes = psm.getPackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getPackRowLength() > 0 ) {
@@ -445,12 +445,12 @@ public class Image {
} else {
groups_per_line = width;
}
-
+
// all formats except GL_BITMAP fall out trivially
if( type == GL2.GL_BITMAP ) {
int bit_offset;
int current_bit;
-
+
rowsize = ( groups_per_line * components + 7 ) / 8;
padding = ( rowsize % psm.getPackAlignment() );
if( padding != 0 ) {
@@ -472,7 +472,7 @@ public class Image {
current_bit = 0;
}
}
-
+
if( current_bit != 0 ) {
if( psm.getPackLsbFirst() ) {
userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 1 << bit_offset ) ) ) );
@@ -488,7 +488,7 @@ public class Image {
userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 7 - bit_offset ) ) ) );
}
}
-
+
bit_offset++;
if( bit_offset == 8 ) {
bit_offset = 0;
@@ -500,13 +500,13 @@ public class Image {
}
} else {
float shoveComponents[] = new float[4];
-
+
element_size = Mipmap.bytes_per_element( type );
group_size = element_size * components;
if( element_size == 1 ) {
myswap_bytes = false;
}
-
+
rowsize = groups_per_line * group_size;
padding = ( rowsize % psm.getPackAlignment() );
if( padding != 0 ) {
@@ -514,13 +514,13 @@ public class Image {
}
start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size;
elements_per_line = width * components;
-
+
iter2 = 0;
for( i = 0; i < height; i++ ) {
iter = start;
for( j = 0; j < elements_per_line; j++ ) {
Type_Widget widget = new Type_Widget();
-
+
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
for( k = 0; k < 3; k++ ) {
@@ -799,7 +799,7 @@ public class Image {
assert( iter == rowsize * height + psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size );
}
}
-
+
public static void fillImage3D( PixelStorageModes psm, int width, int height,
int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
ShortBuffer newImage ) {
@@ -819,7 +819,7 @@ public class Image {
int ww, hh, dd, k;
Type_Widget widget = new Type_Widget();
float extractComponents[] = new float[4];
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -860,7 +860,7 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
myswapBytes = psm.getUnpackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getUnpackRowLength() > 0 ) {
@@ -873,7 +873,7 @@ public class Image {
if( elementSize == 1 ) {
myswapBytes = false;
}
-
+
// 3dstuff begin
if( psm.getUnpackImageHeight() > 0 ) {
rowsPerImage = psm.getUnpackImageHeight();
@@ -881,27 +881,27 @@ public class Image {
rowsPerImage = height;
}
// 3dstuff end
-
+
rowSize = groupsPerLine * groupSize;
padding = rowSize % psm.getUnpackAlignment();
if( padding != 0 ) {
rowSize += psm.getUnpackAlignment() - padding;
}
-
+
imageSize = rowsPerImage * rowSize; // 3dstuff
-
- start = psm.getUnpackSkipRows() * rowSize +
- psm.getUnpackSkipPixels() * groupSize +
+
+ start = psm.getUnpackSkipRows() * rowSize +
+ psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize;
elementsPerLine = width * components;
-
+
iter2 = 0;
for( dd = 0; dd < depth; dd++ ) {
rowStart = start;
for( hh = 0; hh < height; hh++ ) {
iter = rowStart;
for( ww = 0; ww < elementsPerLine; ww++ ) {
-
+
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
if( indexFormat ) {
@@ -1063,18 +1063,18 @@ public class Image {
} // for hh
start += imageSize;
}// for dd
-
+
// iterators should be one byte past end
if( !Mipmap.isTypePackedPixel( type ) ) {
assert( iter2 == width * height * depth * components );
} else {
assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
}
- assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize +
+ assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize +
psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize );
}
-
+
public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
boolean myswapBytes;
@@ -1092,7 +1092,7 @@ public class Image {
int imageSize;
Type_Widget widget = new Type_Widget();
float[] shoveComponents = new float[4];
-
+
// Create a Extract interface object
Extract extract = null;
switch( type ) {
@@ -1133,9 +1133,9 @@ public class Image {
extract = new Extract2101010rev();
break;
}
-
+
iter = 0;
-
+
myswapBytes = psm.getPackSwapBytes();
components = Mipmap.elements_per_group( format, type );
if( psm.getPackRowLength() > 0 ) {
@@ -1143,44 +1143,44 @@ public class Image {
} else {
groupsPerLine = width;
}
-
+
elementSize = Mipmap.bytes_per_element( type );
groupSize = elementSize * components;
if( elementSize == 1 ) {
myswapBytes = false;
}
-
+
// 3dstuff begin
if( psm.getPackImageHeight() > 0 ) {
rowsPerImage = psm.getPackImageHeight();
} else {
rowsPerImage = height;
}
-
+
// 3dstuff end
-
+
rowSize = groupsPerLine * groupSize;
padding = rowSize % psm.getPackAlignment();
if( padding != 0 ) {
rowSize += psm.getPackAlignment() - padding;
}
-
+
imageSize = rowsPerImage * rowSize;
-
+
start = psm.getPackSkipRows() * rowSize +
psm.getPackSkipPixels() * groupSize +
psm.getPackSkipImages() * imageSize;
elementsPerLine = width * components;
-
+
iter2 = 0;
for( dd = 0; dd < depth; dd++ ) {
rowStart = start;
-
+
for( ii = 0; ii < height; ii++ ) {
iter = rowStart;
-
+
for( jj = 0; jj < elementsPerLine; jj++ ) {
-
+
switch( type ) {
case( GL2.GL_UNSIGNED_BYTE ):
if( indexFormat ) {
@@ -1392,20 +1392,20 @@ public class Image {
default:
assert( false );
}
-
+
iter += elementSize;
} // for jj
rowStart += rowSize;
} // for ii
start += imageSize;
} // for dd
-
+
if( !Mipmap.isTypePackedPixel( type ) ) {
assert( iter2 == width * height * depth * components );
} else {
assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
}
- assert( iter == rowSize * height * depth +
+ assert( iter == rowSize * height * depth +
psm.getUnpackSkipRows() * rowSize +
psm.getUnpackSkipPixels() * groupSize +
psm.getUnpackSkipImages() * imageSize );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
index b74d0a6b8..938873ec5 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -57,11 +57,11 @@ import com.jogamp.common.nio.Buffers;
* @author Administrator
*/
public class Mipmap {
-
+
/** Creates a new instance of Mipmap */
public Mipmap() {
}
-
+
public static int computeLog( int value ) {
int i = 0;
// Error
@@ -79,7 +79,7 @@ public class Mipmap {
i++;
}
}
-
+
/* Compute the nearest power of 2 number. This algorithm is a little strange
* but it works quite well.
*/
@@ -99,7 +99,7 @@ public class Mipmap {
i *= 2;
}
}
-
+
public static short GLU_SWAP_2_BYTES( short s ) {
byte b = 0;
b = (byte)( s >>> 8 );
@@ -107,7 +107,7 @@ public class Mipmap {
s = (short)( s | (0x00FF & b) );
return( s );
}
-
+
public static int GLU_SWAP_4_BYTES( int i ) {
int t = i << 24;
t |= 0x00FF0000 & ( i << 8 );
@@ -115,13 +115,13 @@ public class Mipmap {
t |= 0x000000FF & ( i >>> 24 );
return( t );
}
-
+
public static float GLU_SWAP_4_BYTES( float f ) {
int i = Float.floatToRawIntBits( f );
float temp = Float.intBitsToFloat( i );
return( temp );
}
-
+
public static int checkMipmapArgs( int internalFormat, int format, int type ) {
if( !legalFormat( format ) || !legalType( type ) ) {
return( GLU.GLU_INVALID_ENUM );
@@ -134,7 +134,7 @@ public class Mipmap {
}
return( 0 );
}
-
+
public static boolean legalFormat( int format ) {
switch( format ) {
case( GL2.GL_COLOR_INDEX ):
@@ -155,7 +155,7 @@ public class Mipmap {
return( false );
}
}
-
+
public static boolean legalType( int type ) {
switch( type ) {
case( GL2.GL_BITMAP ):
@@ -183,10 +183,10 @@ public class Mipmap {
return( false );
}
}
-
+
public static boolean isTypePackedPixel( int type ) {
assert( legalType( type ) );
-
+
if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
@@ -203,20 +203,20 @@ public class Mipmap {
}
return( false );
}
-
+
public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
// if not a packed pixel type then return true
if( isTypePackedPixel( type ) ) {
return( true );
}
-
+
// 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
& format != GL2GL3.GL_RGB ) {
return( false );
}
-
+
// 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
// 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
@@ -232,7 +232,7 @@ public class Mipmap {
}
return( true );
}
-
+
public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
int totalLevels ) {
if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
@@ -241,7 +241,7 @@ public class Mipmap {
}
return( true );
}
-
+
/* Given user requested textures size, determine if it fits. If it doesn't then
* halve both sides and make the determination again until it does fit ( for
* IR only ).
@@ -257,7 +257,7 @@ public class Mipmap {
int heightPowerOf2 = nearestPower( height );
int[] proxyWidth = new int[1];
boolean noProxyTextures = false;
-
+
// Some drivers (in particular, ATI's) seem to set a GL error
// when proxy textures are used even though this is in violation
// of the spec. Guard against this and interactions with the
@@ -268,20 +268,20 @@ public class Mipmap {
int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
int proxyTarget;
-
+
assert( widthAtLevelOne > 0 );
assert( heightAtLevelOne > 0 );
-
+
// does width x height at level 1 & all their mipmaps fit?
if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
heightAtLevelOne, 0, format, type, null );
- } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
- (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
+ } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
+ (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
(target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
@@ -289,7 +289,7 @@ public class Mipmap {
} else {
assert( target == GL2GL3.GL_TEXTURE_1D || target == GL2GL3.GL_PROXY_TEXTURE_1D );
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_1D;
- gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne,
+ gl.getGL2GL3().glTexImage1D( proxyTarget, 1, internalFormat, widthAtLevelOne,
0, format, type, null );
}
if(gl.isGL2GL3()) {
@@ -336,15 +336,15 @@ public class Mipmap {
newHeight[0] = maxsize[0];
}
}
-
- public static void closestFit3D( GL gl, int target, int width, int height, int depth,
+
+ public static void closestFit3D( GL gl, int target, int width, int height, int depth,
int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
int[] newDepth ) {
int widthPowerOf2 = nearestPower( width );
int heightPowerOf2 = nearestPower( height );
int depthPowerOf2 = nearestPower( depth );
int[] proxyWidth = new int[1];
-
+
do {
// compute level 1 width & height & depth, clamping each at 1
int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
@@ -354,7 +354,7 @@ public class Mipmap {
assert( widthAtLevelOne > 0 );
assert( heightAtLevelOne > 0 );
assert( depthAtLevelOne > 0 );
-
+
// does width x height x depth at level 1 & all their mipmaps fit?
if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
@@ -378,16 +378,16 @@ public class Mipmap {
}
} while( proxyWidth[0] == 0 );
// loop must terminate
-
+
// return the width & height at level 0 that fits
newWidth[0] = widthPowerOf2;
newHeight[0] = heightPowerOf2;
newDepth[0] = depthPowerOf2;
}
-
+
public static int elements_per_group( int format, int type ) {
// Return the number of elements per grtoup of a specified gromat
-
+
// If the type is packedpixels then answer is 1
if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
@@ -403,7 +403,7 @@ public class Mipmap {
type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
return( 1 );
}
-
+
// Types are not packed pixels so get elements per group
switch( format ) {
case( GL2GL3.GL_RGB ):
@@ -418,10 +418,10 @@ public class Mipmap {
return( 1 );
}
}
-
+
public static int bytes_per_element( int type ) {
// return the number of bytes per element, based on the element type
-
+
switch( type ) {
case( GL2.GL_BITMAP ):
case( GL2GL3.GL_BYTE ):
@@ -450,17 +450,17 @@ public class Mipmap {
return( 4 );
}
}
-
+
public static boolean is_index( int format ) {
return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
}
-
+
/* Compute memory required for internal packed array of data of given type and format. */
-
+
public static int image_size( int width, int height, int format, int type ) {
int bytes_per_row;
int components;
-
+
assert( width > 0 );
assert( height > 0 );
components = elements_per_group( format, type );
@@ -471,17 +471,17 @@ public class Mipmap {
}
return( bytes_per_row * height * components );
}
-
+
public static int imageSize3D( int width, int height, int depth, int format, int type ) {
int components = elements_per_group( format, type );
int bytes_per_row = bytes_per_element( type ) * width;
-
+
assert( width > 0 && height > 0 && depth > 0 );
assert( type != GL2.GL_BITMAP );
-
+
return( bytes_per_row * height * depth * components );
}
-
+
public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
int[] a = new int[1];
gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
@@ -496,7 +496,7 @@ public class Mipmap {
psm.setUnpackLsbFirst( ( a[0] == 1 ) );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
psm.setUnpackSwapBytes( ( a[0] == 1 ) );
-
+
gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
psm.setPackAlignment( a[0] );
gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
@@ -510,7 +510,7 @@ public class Mipmap {
gl.glGetIntegerv( GL2GL3.GL_PACK_SWAP_BYTES, a, 0);
psm.setPackSwapBytes( ( a[0] == 1 ) );
}
-
+
public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
int[] a = new int[1];
gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
@@ -529,7 +529,7 @@ public class Mipmap {
psm.setUnpackSkipImages( a[0] );
gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
psm.setUnpackImageHeight( a[0] );
-
+
gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
psm.setPackAlignment( a[0] );
gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
@@ -547,9 +547,9 @@ public class Mipmap {
gl.glGetIntegerv( GL2GL3.GL_PACK_IMAGE_HEIGHT, a, 0 );
psm.setPackImageHeight( a[0] );
}
-
- public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
- int typein, ByteBuffer datain, int widthout, int heightout,
+
+ public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
+ int typein, ByteBuffer datain, int widthout, int heightout,
int typeout, ByteBuffer dataout ) {
int datainPos = datain.position();
int dataoutPos = dataout.position();
@@ -559,7 +559,7 @@ public class Mipmap {
ByteBuffer beforeimage;
ByteBuffer afterimage;
PixelStorageModes psm = new PixelStorageModes();
-
+
if( (widthin == 0) || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
return( 0 );
}
@@ -580,20 +580,20 @@ public class Mipmap {
if( beforeimage == null || afterimage == null ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
-
+
retrieveStoreModes( gl, psm );
Image.fill_image( psm, widthin, heightin, format, typein, is_index( format ), datain, beforeimage.asShortBuffer() );
components = elements_per_group( format, 0 );
ScaleInternal.scale_internal( components, widthin, heightin, beforeimage.asShortBuffer(), widthout, heightout, afterimage.asShortBuffer() );
Image.empty_image( psm, widthout, heightout, format, typeout, is_index( format ), afterimage.asShortBuffer(), dataout );
-
+
return( 0 );
} finally {
datain.position(datainPos);
dataout.position(dataoutPos);
}
}
-
+
public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
int width, int format, int type, int userLevel, int baseLevel,
int maxLevel, ByteBuffer data ) {
@@ -601,30 +601,30 @@ public class Mipmap {
try {
int levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
levels = computeLog( width );
-
+
levels += userLevel;
if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, width,
width, format, type, userLevel, baseLevel, maxLevel, data ) );
} finally {
data.position(dataPos);
}
}
-
+
public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
int format, int type, ByteBuffer data ) {
int dataPos = data.position();
@@ -633,54 +633,54 @@ public class Mipmap {
int[] widthPowerOf2 = new int[1];
int levels;
int[] dummy = new int[1];
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
closestFit( gl, target, width, 1, internalFormat, format, type, widthPowerOf2, dummy );
levels = computeLog( widthPowerOf2[0] );
-
- return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat,
+
+ return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat,
width, widthPowerOf2[0], format, type, 0, 0, levels, data ) );
} finally {
data.position(dataPos);
}
}
-
+
public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
int width, int height, int format, int type, int userLevel,
int baseLevel, int maxLevel, Object data ) {
int dataPos = 0;
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
levels = computeLog( width );
level = computeLog( height );
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
//PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
ByteBuffer buffer = null;
if( data instanceof ByteBuffer ) {
@@ -706,7 +706,7 @@ public class Mipmap {
FloatBuffer fb = buffer.asFloatBuffer();
fb.put( array );
}
-
+
try {
return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
width, height, width, height, format, type, userLevel, baseLevel,
@@ -716,7 +716,7 @@ public class Mipmap {
}
}
-
+
public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
int width, int height, int format, int type, Object data ) {
int dataPos = 0;
@@ -724,25 +724,25 @@ public class Mipmap {
int[] widthPowerOf2 = new int[1];
int[] heightPowerOf2 = new int[1];
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
- closestFit( gl, target, width, height, internalFormat, format, type,
+
+ closestFit( gl, target, width, height, internalFormat, format, type,
widthPowerOf2, heightPowerOf2 );
-
+
levels = computeLog( widthPowerOf2[0] );
level = computeLog( heightPowerOf2[0] );
if( level > levels ) {
levels = level;
}
-
+
//PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
ByteBuffer buffer = null;
if( data instanceof ByteBuffer ) {
@@ -768,17 +768,17 @@ public class Mipmap {
FloatBuffer fb = buffer.asFloatBuffer();
fb.put( array );
}
-
+
try {
- return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
- width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
+ return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
+ width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
0, levels, buffer ) );
} finally {
buffer.position(dataPos);
}
}
-
-
+
+
public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
int width, int height, int depth, int format, int type, ByteBuffer data ) {
int dataPos = data.position();
@@ -788,23 +788,23 @@ public class Mipmap {
int[] heightPowerOf2 = new int[1];
int[] depthPowerOf2 = new int[1];
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 || depth < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
if( type == GL2.GL_BITMAP ) {
return( GLU.GLU_INVALID_ENUM );
}
-
+
closestFit3D( gl, target, width, height, depth, internalFormat, format,
type, widthPowerOf2, heightPowerOf2, depthPowerOf2 );
-
+
levels = computeLog( widthPowerOf2[0] );
level = computeLog( heightPowerOf2[0] );
if( level > levels ) {
@@ -814,7 +814,7 @@ public class Mipmap {
if( level > levels ) {
levels = level;
}
-
+
return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
height, depth, widthPowerOf2[0], heightPowerOf2[0], depthPowerOf2[0],
format, type, 0, 0, levels, data ) );
@@ -822,27 +822,27 @@ public class Mipmap {
data.position(dataPos);
}
}
-
+
public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
int width, int height, int depth, int format, int type, int userLevel,
int baseLevel, int maxLevel, ByteBuffer data ) {
int dataPos = data.position();
try {
int level, levels;
-
+
int rc = checkMipmapArgs( internalFormat, format, type );
if( rc != 0 ) {
return( rc );
}
-
+
if( width < 1 || height < 1 || depth < 1 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
if( type == GL2.GL_BITMAP ) {
return( GLU.GLU_INVALID_ENUM );
}
-
+
levels = computeLog( width );
level = computeLog( height );
if( level > levels ) {
@@ -852,12 +852,12 @@ public class Mipmap {
if( level > levels ) {
levels = level;
}
-
+
levels += userLevel;
if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
return( GLU.GLU_INVALID_VALUE );
}
-
+
return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
height, depth, width, height, depth, format, type, userLevel,
baseLevel, maxLevel, data ) );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
index 0b1af8323..7eb98db35 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -129,7 +129,7 @@ public class PixelStorageModes {
* Holds value of property unpackImageHeight.
*/
private int unpackImageHeight;
-
+
/** Creates a new instance of PixelStorageModes */
public PixelStorageModes() {
}
@@ -421,6 +421,6 @@ public class PixelStorageModes {
this.unpackImageHeight = unpackImageHeight;
}
-
-
+
+
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
index 9c95ae304..9aca1fb03 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -55,9 +55,9 @@ import com.jogamp.common.nio.Buffers;
* @author Administrator
*/
public class ScaleInternal {
-
+
public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
-
+
public static void scale_internal( int components, int widthin, int heightin,
ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
float x, lowx, highx, convx, halfconvx;
@@ -69,7 +69,7 @@ public class ScaleInternal {
float area;
int i, j, k, yint, xint, xindex, yindex;
int temp;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
HalveImage.halveImage( components, widthin, heightin, datain, dataout );
return;
@@ -101,7 +101,7 @@ public class ScaleInternal {
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
area = 0.0f;
-
+
y = lowy;
yint = (int)Math.floor( y );
while( y < highy ) {
@@ -111,10 +111,10 @@ public class ScaleInternal {
} else {
ypercent = yint + 1 - y;
}
-
+
x = lowx;
xint = (int)Math.floor( x );
-
+
while( x < highx ) {
xindex = ( xint + widthin ) % widthin;
if( highx < xint + 1 ) {
@@ -122,21 +122,21 @@ public class ScaleInternal {
} else {
xpercent = xint + 1 - x;
}
-
+
percent = xpercent * ypercent;
area += percent;
temp = ( xindex + ( yindex * widthin) ) * components;
for( k = 0; k < components; k++ ) {
- totals[k] += datain.get( temp + k ) * percent;
+ totals[k] += datain.get( temp + k ) * percent;
}
-
+
xint++;
x = xint;
}
yint++;
y = yint;
}
-
+
temp = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
// totals[] should be rounded in the case of enlarging an RGB
@@ -146,9 +146,9 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_ubyte( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
+ ByteBuffer datain, int widthout, int heightout,
ByteBuffer dataout, int element_size, int ysize, int group_size ) {
float x, convx;
float y, convy;
@@ -157,11 +157,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -169,9 +169,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size );
return;
}
@@ -181,14 +181,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -204,19 +204,19 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -239,7 +239,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += ( 0x000000FF & datain.get() ) * percent;
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -261,7 +261,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += ( 0x000000FF & datain.get() ) * percent;
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -339,7 +339,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -371,9 +371,9 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_byte( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
+ ByteBuffer datain, int widthout, int heightout,
ByteBuffer dataout, int element_size, int ysize,
int group_size ) {
float x, convx;
@@ -383,11 +383,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -395,9 +395,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size );
return;
}
@@ -407,14 +407,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -430,18 +430,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -464,7 +464,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += datain.get() * percent;
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -486,7 +486,7 @@ public class ScaleInternal {
datain.position( temp_index );
totals[k] += datain.get() * percent;
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -550,7 +550,7 @@ public class ScaleInternal {
totals[k] += datain.get() * percent;
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -564,7 +564,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -596,10 +596,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_ushort( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- ShortBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ ShortBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -608,11 +608,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -620,9 +620,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -632,14 +632,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -655,18 +655,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -701,7 +701,7 @@ public class ScaleInternal {
totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -735,7 +735,7 @@ public class ScaleInternal {
totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -834,7 +834,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -852,7 +852,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -884,10 +884,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_short( int components, int widthin, int heightin,
ByteBuffer datain, int widthout, int heightout,
- ShortBuffer dataout, int element_size, int ysize,
+ ShortBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -896,11 +896,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -908,11 +908,11 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
int swapbuf; // unsigned buffer
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_short( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_short( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -922,14 +922,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -945,18 +945,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -994,7 +994,7 @@ public class ScaleInternal {
totals[k] += datain.getShort() * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1031,7 +1031,7 @@ public class ScaleInternal {
totals[k] += datain.getShort() * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -1137,7 +1137,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1156,7 +1156,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -1188,10 +1188,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_uint( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- IntBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -1200,11 +1200,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -1212,9 +1212,9 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -1224,14 +1224,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -1247,18 +1247,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -1293,7 +1293,7 @@ public class ScaleInternal {
totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1327,7 +1327,7 @@ public class ScaleInternal {
totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -1427,7 +1427,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1445,7 +1445,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
float value = 0.0f;
for( k = 0; k < components; k++ ) {
@@ -1483,10 +1483,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_int( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- IntBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ IntBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -1495,11 +1495,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -1507,11 +1507,11 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
long swapbuf; // unsigned buffer
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_int( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_int( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -1521,14 +1521,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -1544,18 +1544,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -1593,7 +1593,7 @@ public class ScaleInternal {
totals[k] += datain.getInt() * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1630,7 +1630,7 @@ public class ScaleInternal {
totals[k] += datain.getInt() * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -1736,7 +1736,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -1755,7 +1755,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -1787,10 +1787,10 @@ public class ScaleInternal {
}
}
}
-
+
public static void scale_internal_float( int components, int widthin, int heightin,
- ByteBuffer datain, int widthout, int heightout,
- FloatBuffer dataout, int element_size, int ysize,
+ ByteBuffer datain, int widthout, int heightout,
+ FloatBuffer dataout, int element_size, int ysize,
int group_size, boolean myswap_bytes ) {
float x, convx;
float y, convy;
@@ -1799,11 +1799,11 @@ public class ScaleInternal {
float[] totals = new float[4];
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outindex;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -1811,11 +1811,11 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
float swapbuf; // unsigned buffer
-
+
if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
- HalveImage.halveImage_float( components, widthin, heightin, datain, dataout,
+ HalveImage.halveImage_float( components, widthin, heightin, datain, dataout,
element_size, ysize, group_size, myswap_bytes );
return;
}
@@ -1825,14 +1825,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convy_float;
-
+
for( i = 0; i < heightout; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightin)
@@ -1848,18 +1848,18 @@ public class ScaleInternal {
highx_int = convx_int;
highx_float = convx_float;
}
-
+
for( j = 0; j < widthout; j++ ) {
-
+
// Ok, now apply box filter to box that goes from (lowx, lowy)
// to (highx, highy) on input data into this pixel on output
// data.
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// caulate the value for pixels in the 1st row
xindex = lowx_int * group_size;
if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * ysize;
percent = y_percent * ( 1 - lowx_float );
@@ -1897,7 +1897,7 @@ public class ScaleInternal {
totals[k] += datain.getFloat() * percent;
}
}
-
+
// calculate the value for pixels in the last row
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
@@ -1934,7 +1934,7 @@ public class ScaleInternal {
totals[k] += datain.getFloat() * percent;
}
}
-
+
// calculate the value for the pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += ysize;
@@ -2040,7 +2040,7 @@ public class ScaleInternal {
}
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -2059,7 +2059,7 @@ public class ScaleInternal {
}
temp0 += ysize;
}
-
+
outindex = ( j + ( i * widthout ) ) * components;
for( k = 0; k < components; k++ ) {
dataout.position( outindex + k );
@@ -2091,28 +2091,28 @@ public class ScaleInternal {
}
}
}
-
- public static void scaleInternalPackedPixel( int components, Extract extract,
+
+ public static void scaleInternalPackedPixel( int components, Extract extract,
int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
int rowSizeInBytes, boolean isSwap ) {
float x, convx;
float y, convy;
float percent;
-
+
// max components in a format is 4, so
float[] totals = new float[4];
float[] extractTotals = new float[4];
float[] extractMoreTotals = new float[4];
float[] shoveTotals = new float[4];
-
+
float area;
int i, j, k, xindex;
-
+
int temp, temp0;
int temp_index;
int outIndex = 0;
-
+
int lowx_int, highx_int, lowy_int, highy_int;
float x_percent, y_percent;
float lowx_float, highx_float, lowy_float, highy_float;
@@ -2120,7 +2120,7 @@ public class ScaleInternal {
int convy_int, convx_int;
int l, m;
int left, right;
-
+
if( widthIn == widthOut * 2 && heightIn == heightOut * 2 ) {
HalveImage.halveImagePackedPixel( components, extract, widthIn, heightIn, dataIn, dataOut,
pixelSizeInBytes, rowSizeInBytes, isSwap );
@@ -2132,14 +2132,14 @@ public class ScaleInternal {
convy_float = convy - convy_int;
convx_int = (int)Math.floor( convx );
convx_float = convx - convx_int;
-
+
area = convx * convy;
-
+
lowy_int = 0;
lowy_float = 0.0f;
highy_int = convy_int;
highy_float = convx_float;
-
+
for( i = 0; i < heightOut; i++ ) {
// Clamp here to be sure we don't read beyond input buffer.
if (highy_int >= heightIn)
@@ -2148,16 +2148,16 @@ public class ScaleInternal {
lowx_float = 0.0f;
highx_int = convx_int;
highx_float = convx_float;
-
+
for( j = 0; j < widthOut; j++ ) {
// ok now apply box filter to box that goes from( lowx, lowy )
// to ( highx, highy ) on input data into this pixel on output data
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
-
+
// calculate that value for pixels in the 1st row
xindex = lowx_int * pixelSizeInBytes;
if( (highy_int > lowy_int) && (highx_int > lowx_int) ) {
-
+
y_percent = 1 - lowy_float;
temp = xindex + lowy_int * rowSizeInBytes;
percent = y_percent * ( 1 - lowx_float );
@@ -2184,7 +2184,7 @@ public class ScaleInternal {
totals[k] += extractTotals[k] * percent;
}
// calculate the value for pixels in the last row
-
+
y_percent = highy_float;
percent = y_percent * ( 1 - lowx_float );
temp = xindex + highy_int * rowSizeInBytes;
@@ -2207,7 +2207,7 @@ public class ScaleInternal {
for( k = 0; k < components; k++ ) {
totals[k] += extractTotals[k] * percent;
}
-
+
// calculate the value for pixels in the 1st and last column
for( m = lowy_int + 1; m < highy_int; m++ ) {
left += rowSizeInBytes;
@@ -2277,7 +2277,7 @@ public class ScaleInternal {
totals[k] += extractTotals[k] * percent;
}
}
-
+
// this is for the pixels in the body
temp0 = xindex + pixelSizeInBytes + ( lowy_int + 1 ) * rowSizeInBytes;
for( m = lowy_int + 1; m < highy_int; m++ ) {
@@ -2292,7 +2292,7 @@ public class ScaleInternal {
}
temp0 += rowSizeInBytes;
}
-
+
outIndex = ( j + ( i * widthOut ) );
for( k = 0; k < components; k++ ) {
shoveTotals[k] = totals[k] / area;
@@ -2325,7 +2325,7 @@ public class ScaleInternal {
}
assert( outIndex == ( widthOut * heightOut - 1) );
}
-
+
public static void scaleInternal3D( int components, int widthIn, int heightIn,
int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
int depthOut, ShortBuffer dataOut ) {
@@ -2339,9 +2339,9 @@ public class ScaleInternal {
float volume;
int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
int temp;
-
+
lowy = highy = lowx = highx = 0.0f;
-
+
convz = (float)depthIn / depthOut;
convy = (float)heightIn / heightOut;
convx = (float)widthIn / widthOut;
@@ -2375,13 +2375,13 @@ public class ScaleInternal {
highz = x + 0.5f;
lowz = x - 0.5f;
}
-
+
// Ok, now apply box filter to box that goes from ( lowx, lowy, lowz )
// to ( highx, highy, highz ) on input data into this pixel on output data
-
+
totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
volume = 0.0f;
-
+
z = lowz;
zint = (int)(Math.floor( z ) );
while( z < highz ) {
@@ -2391,7 +2391,7 @@ public class ScaleInternal {
} else {
zpercent = zint + 1 - z;
}
-
+
y = lowy;
yint = (int)(Math.floor( y ) );
while( y < highy ) {
@@ -2401,10 +2401,10 @@ public class ScaleInternal {
} else {
ypercent = yint + 1 - y;
}
-
+
x = lowx;
xint = (int)(Math.floor( x ) );
-
+
while( x < highx ) {
xindex = (xint + widthIn ) % widthIn;
if( highx < xint + 1 ) {
@@ -2412,10 +2412,10 @@ public class ScaleInternal {
} else {
xpercent = xint + 1 - x;
}
-
+
percent = xpercent * ypercent * zpercent;
volume += percent;
-
+
temp = (xindex + ( yindex *widthIn) + (zindex * widthIn *heightIn)) * components;
for( k = 0; k < components; k++ ) {
assert( 0 <= (temp+k) && (temp+k) < (widthIn * heightIn * depthIn * components) );
@@ -2430,7 +2430,7 @@ public class ScaleInternal {
zint++;
z = zint;
} // while z
-
+
temp = ( j + ( i * widthOut ) + (d * widthOut * heightOut ) ) * components;
for( k = 0; k < components; k++ ) {
// totals should be rounded in the case of enlarging an rgb ramp when the type is 332 or 4444
@@ -2441,48 +2441,48 @@ public class ScaleInternal {
}
}
}
-
- public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
- int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
+
+ public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
+ int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
int depthOut, int typeOut, ByteBuffer dataOut ) {
int components;
ShortBuffer beforeImage, afterImage;
PixelStorageModes psm = new PixelStorageModes();
-
+
if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
return( 0 );
}
-
+
if( widthIn < 0 || heightIn < 0 || depthIn < 0 ||
widthOut < 0 || heightOut < 0 || depthOut < 0 ) {
return( GLU.GLU_INVALID_VALUE );
}
-
- if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) ||
+
+ if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) ||
!Mipmap.legalType(typeOut) || typeIn == GL2.GL_BITMAP ||
typeOut == GL2.GL_BITMAP ) {
return( GLU.GLU_INVALID_ENUM );
}
-
+
if( !Mipmap.isLegalFormatForPackedPixelType( format, typeIn ) ) {
return( GLU.GLU_INVALID_OPERATION );
}
-
+
if( !Mipmap.isLegalFormatForPackedPixelType( format, typeOut ) ) {
return( GLU.GLU_INVALID_OPERATION );
}
-
+
try {
- beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
+ beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
- afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
+ afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
} catch( OutOfMemoryError err ) {
return( GLU.GLU_OUT_OF_MEMORY );
}
Mipmap.retrieveStoreModes3D( gl, psm );
-
+
Image.fillImage3D( psm, widthIn, heightIn, depthIn, format, typeIn,
Mipmap.is_index( format ), dataIn, beforeImage );
components = Mipmap.elements_per_group( format, 0 );
@@ -2490,7 +2490,7 @@ public class ScaleInternal {
beforeImage, widthOut, heightOut, depthOut, afterImage );
Image.emptyImage3D( psm, widthOut, heightOut, depthOut, format, typeOut,
Mipmap.is_index( format ), afterImage, dataOut );
-
+
return( 0 );
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
index 38113f601..dc401880d 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,176 +51,176 @@ import java.nio.*;
* @author Administrator
*/
public class Type_Widget {
-
+
ByteBuffer buffer;
-
+
/** Creates a new instance of Type_Widget */
public Type_Widget() {
// can't make this direct, because JVM doesn't allocate small direct buffers efficiently
// see https://jogamp.org/bugzilla/show_bug.cgi?id=463 for details
buffer = ByteBuffer.allocate( 4 );
}
-
+
public void setUB0( byte b ) {
buffer.position( 0 );
buffer.put( b );
}
-
+
public byte getUB0() {
buffer.position( 0 );
return( buffer.get() );
}
-
+
public void setUB1( byte b ) {
buffer.position( 1 );
buffer.put( b );
}
-
+
public byte getUB1() {
buffer.position( 1 );
return( buffer.get() );
}
-
+
public void setUB2( byte b ) {
buffer.position( 2 );
buffer.put( b );
}
-
+
public byte getUB2() {
buffer.position( 2 );
return( buffer.get() );
}
-
+
public void setUB3( byte b ) {
buffer.position( 3 );
buffer.put( b );
}
-
+
public byte getUB3() {
buffer.position( 3 );
return( buffer.get() );
}
-
+
public void setUS0( short s ) {
buffer.position( 0 );
buffer.putShort( s );
}
-
+
public short getUS0() {
buffer.position( 0 );
return( buffer.getShort() );
}
-
+
public void setUS1( short s ) {
buffer.position( 2 );
buffer.putShort( s );
}
-
+
public short getUS1() {
buffer.position( 2 );
return( buffer.getShort() );
}
-
+
public void setUI( int i ) {
buffer.position( 0 );
buffer.putInt( i );
}
-
+
public int getUI() {
buffer.position( 0 );
return( buffer.getInt() );
}
-
+
public void setB0( byte b ) {
buffer.position( 0 );
buffer.put( b );
}
-
+
public byte getB0() {
buffer.position( 0 );
return( buffer.get() );
}
-
+
public void setB1( byte b ) {
buffer.position( 1 );
buffer.put( b );
}
-
+
public byte getB1() {
buffer.position( 1 );
return( buffer.get() );
}
-
+
public void setB2( byte b ) {
buffer.position( 2 );
buffer.put( b );
}
-
+
public byte getB2() {
buffer.position( 2 );
return( buffer.get() );
}
-
+
public void setB3( byte b ) {
buffer.position( 3 );
buffer.put( b );
}
-
+
public byte getB3() {
buffer.position( 3 );
return( buffer.get() );
}
-
+
public void setS0( short s ) {
buffer.position( 0 );
buffer.putShort( s );
}
-
+
public short getS0() {
buffer.position( 0 );
return( buffer.getShort() );
}
-
+
public void setS1( short s ) {
buffer.position( 2 );
buffer.putShort( s );
}
-
+
public short getS1() {
buffer.position( 2 );
return( buffer.getShort() );
}
-
+
public void setI( int i ) {
buffer.position( 0 );
buffer.putInt( i );
}
-
+
public int getI() {
buffer.position( 0 );
return( buffer.getInt() );
}
-
+
public void setF( float f ) {
buffer.position( 0 );
buffer.putFloat( f );
}
-
+
public float getF() {
buffer.position( 0 );
return( buffer.getFloat() );
}
-
+
public ByteBuffer getBuffer() {
buffer.rewind();
return( buffer );
}
-
+
public static void main( String args[] ) {
Type_Widget t = new Type_Widget();
t.setI( 1000000 );
-
+
System.out.println("int: " + Integer.toHexString( t.getI() ) );
-
+
}
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
index 422f8d4df..df2b9a147 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
@@ -72,7 +72,7 @@ public class Arc {
/**
* Makes new arc at specified side
- *
+ *
* @param side
* which side doeas this arc form
*/
@@ -86,7 +86,7 @@ public class Arc {
/**
* Sets side the arc is at
- *
+ *
* @param side
* arc side
*/
@@ -104,7 +104,7 @@ public class Arc {
type &= ~(0x7 << 8);
}
- // this one replaces enum arc_side
+ // this one replaces enum arc_side
/**
* Side not specified
*/
@@ -147,7 +147,7 @@ public class Arc {
/**
* Appends arc to the list
- *
+ *
* @param jarc
* arc to be append
* @return this
@@ -169,7 +169,7 @@ public class Arc {
/**
* Unused
- *
+ *
* @return true
*/
public boolean check() {
@@ -187,7 +187,7 @@ public class Arc {
/**
* Returns tail of linked list coords
- *
+ *
* @return tail coords
*/
public float[] tail() {
@@ -197,7 +197,7 @@ public class Arc {
/**
* Returns head of linked list coords
- *
+ *
* @return head coords
*/
public float[] head() {
@@ -207,7 +207,7 @@ public class Arc {
/**
* Returns whether arc is marked with arc_tag
- *
+ *
* @return is arc marked with arc_tag
*/
public boolean ismarked() {
@@ -241,7 +241,7 @@ public class Arc {
/**
* Returns whether arc is marked tail
- *
+ *
* @return is tail
*/
public boolean getitail() {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
index f4ad70193..c299b10af 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -44,7 +44,7 @@ public class ArcSdirSorter {
/**
* Makes new ArcSdirSorter with Subdivider
* @param subdivider subdivider
- */
+ */
public ArcSdirSorter(Subdivider subdivider) {
//TODO
// System.out.println("TODO arcsdirsorter.constructor");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
index be72c53d2..1a584c396 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -43,7 +43,7 @@ public class ArcTdirSorter {
/**
* Makes new ArcSdirSorter with Subdivider
* @param subdivider subdivider
- */
+ */
public ArcTdirSorter(Subdivider subdivider) {
// TODO Auto-generated constructor stub
// System.out.println("TODO arcTsorter.konstruktor");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
index 610a19556..3e974247b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -67,7 +67,7 @@ public abstract class Backend {
protected SurfaceEvaluator surfaceEvaluator;
/**
- * Makes new backend
+ * Makes new backend
*/
public Backend() {
// curveEvaluator = new OpenGLCurveEvaluator();
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
index df8b16ab5..17437ef01 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
@@ -143,7 +143,7 @@ public class Bin {
/**
* Returns next arc in linked list
* @return next arc
- *
+ *
*/
private Arc nextarc() {
// DONE
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
index f45571dac..f84640d28 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Breakpt.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class holding break point parameters
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Breakpt {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
index aaa8cb5f2..b67764c30 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfArcs {
/**
@@ -24,7 +24,7 @@ public class CArrayOfArcs {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -38,7 +38,7 @@ public class CArrayOfArcs {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -50,7 +50,7 @@ public class CArrayOfArcs {
/**
* Makes new CArray with pointer set to 0
- *
+ *
* @param ctlarray
* underlaying array
*/
@@ -61,7 +61,7 @@ public class CArrayOfArcs {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public Arc get() {
@@ -78,7 +78,7 @@ public class CArrayOfArcs {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -89,7 +89,7 @@ public class CArrayOfArcs {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -100,7 +100,7 @@ public class CArrayOfArcs {
/**
* Returns array element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @return element at relative index
@@ -111,7 +111,7 @@ public class CArrayOfArcs {
/**
* Sets value of element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @param value
@@ -123,7 +123,7 @@ public class CArrayOfArcs {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -134,7 +134,7 @@ public class CArrayOfArcs {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -143,7 +143,7 @@ public class CArrayOfArcs {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -156,7 +156,7 @@ public class CArrayOfArcs {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
@@ -175,7 +175,7 @@ public class CArrayOfArcs {
/**
* Returns underlaying array
- *
+ *
* @return underlaying array
*/
public Arc[] getArray() {
@@ -184,7 +184,7 @@ public class CArrayOfArcs {
/**
* Sets underlaying array
- *
+ *
* @param array
* underlaying array
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
index 5112b07fc..b5f588960 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfBreakpts {
/**
@@ -19,7 +19,7 @@ public class CArrayOfBreakpts {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -32,7 +32,7 @@ public class CArrayOfBreakpts {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -43,7 +43,7 @@ public class CArrayOfBreakpts {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public Breakpt get() {
@@ -59,7 +59,7 @@ public class CArrayOfBreakpts {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -70,7 +70,7 @@ public class CArrayOfBreakpts {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -81,7 +81,7 @@ public class CArrayOfBreakpts {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -92,7 +92,7 @@ public class CArrayOfBreakpts {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -101,7 +101,7 @@ public class CArrayOfBreakpts {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -111,7 +111,7 @@ public class CArrayOfBreakpts {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
index 39ef841ec..d9e4d0ff1 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfFloats {
@@ -25,7 +25,7 @@ public class CArrayOfFloats {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -39,7 +39,7 @@ public class CArrayOfFloats {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -51,7 +51,7 @@ public class CArrayOfFloats {
/**
* Makes new CArray with pointer set to 0
- *
+ *
* @param ctlarray
* underlaying array
*/
@@ -62,7 +62,7 @@ public class CArrayOfFloats {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public float get() {
@@ -79,7 +79,7 @@ public class CArrayOfFloats {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -90,7 +90,7 @@ public class CArrayOfFloats {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -101,7 +101,7 @@ public class CArrayOfFloats {
/**
* Returns array element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @return element at relative index
@@ -112,7 +112,7 @@ public class CArrayOfFloats {
/**
* Sets value of element at specified index relatively to pointer
- *
+ *
* @param i
* relative index
* @param value
@@ -124,7 +124,7 @@ public class CArrayOfFloats {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -135,7 +135,7 @@ public class CArrayOfFloats {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -144,7 +144,7 @@ public class CArrayOfFloats {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -157,7 +157,7 @@ public class CArrayOfFloats {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
@@ -176,7 +176,7 @@ public class CArrayOfFloats {
/**
* Returns underlaying array
- *
+ *
* @return underlaying array
*/
public float[] getArray() {
@@ -185,7 +185,7 @@ public class CArrayOfFloats {
/**
* Sets underlaying array
- *
+ *
* @param array
* underlaying array
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
index 4b21f2d50..e7bbac16a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -2,9 +2,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class replacing C language pointer
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class CArrayOfQuiltspecs {
/**
@@ -19,7 +19,7 @@ public class CArrayOfQuiltspecs {
/**
* Makes new CArray
- *
+ *
* @param array
* underlaying array
* @param pointer
@@ -32,7 +32,7 @@ public class CArrayOfQuiltspecs {
/**
* Makes new CArray from other CArray
- *
+ *
* @param carray
* reference array
*/
@@ -43,7 +43,7 @@ public class CArrayOfQuiltspecs {
/**
* Makes new CArray with pointer set to 0
- *
+ *
* @param array
* underlaying array
*/
@@ -54,7 +54,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns element at pointer
- *
+ *
* @return element at pointer
*/
public Quiltspec get() {
@@ -70,7 +70,7 @@ public class CArrayOfQuiltspecs {
/**
* Sets element at pointer
- *
+ *
* @param f
* desired value
*/
@@ -81,7 +81,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns array element at specified index
- *
+ *
* @param i
* array index
* @return element at index
@@ -92,7 +92,7 @@ public class CArrayOfQuiltspecs {
/**
* Lessens pointer by value
- *
+ *
* @param i
* lessen by
*/
@@ -103,7 +103,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns pointer value
- *
+ *
* @return pointer value
*/
public int getPointer() {
@@ -112,7 +112,7 @@ public class CArrayOfQuiltspecs {
/**
* Sets ponter value
- *
+ *
* @param pointer
* pointer value to be set
*/
@@ -122,7 +122,7 @@ public class CArrayOfQuiltspecs {
/**
* Raises pointer by value
- *
+ *
* @param i
* raise by
*/
@@ -141,7 +141,7 @@ public class CArrayOfQuiltspecs {
/**
* Returns underlaying array
- *
+ *
* @return underlaying array
*/
public Quiltspec[] getArray() {
@@ -150,7 +150,7 @@ public class CArrayOfQuiltspecs {
/**
* Sets underlaying array
- *
+ *
* @param array
* underlaying array
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
index 786781723..ea3a3d14e 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -103,7 +103,7 @@ public class Curve {
/**
* Makes new Curve
- *
+ *
* @param geo
* @param pta
* @param ptb
@@ -143,7 +143,7 @@ public class Curve {
range[0] = qs.get().breakpoints[qs.get().index];
range[1] = qs.get().breakpoints[qs.get().index + 1];
range[2] = range[1] - range[0];
- // TODO it is necessary to solve problem with "this" pointer here
+ // TODO it is necessary to solve problem with "this" pointer here
if (range[0] != pta[0]) {
// System.out.println("TODO curve.Curve-range0");
// Curve lower=new Curve(this,pta,0);
@@ -229,7 +229,7 @@ public class Curve {
/**
* Tells whether curve needs subdivision
- *
+ *
* @return curve needs subdivison
*/
public boolean needsSamplingSubdivision() {
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
index 6983691d9..f9c4c2d6f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
@@ -45,12 +45,12 @@ public class Flist {
/**
* Data elements end index
- *
+ *
*/
public int end;
/**
- *Data elements start index
+ *Data elements start index
*/
public int start;
@@ -80,7 +80,7 @@ public class Flist {
}
/**
- * Removes duplicate array elemnts
+ * Removes duplicate array elemnts
*/
public void filter() {
// INFO the aim of this method is to remove duplicates from array
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
index 114832a1c..1dcf393a9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Knot vector specification
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Knotspec {
@@ -314,7 +314,7 @@ public class Knotspec {
/**
* Copies control points
- *
+ *
* @param _inpt
* input control points
* @param _outpt
@@ -346,7 +346,7 @@ public class Knotspec {
/**
* Copies one control point to other
- *
+ *
* @param topt
* source control point
* @param frompt
@@ -374,7 +374,7 @@ public class Knotspec {
/**
* Inserts a knot
- *
+ *
* @param _p
* inserted knot
*/
@@ -402,7 +402,7 @@ public class Knotspec {
}
}
- } else {//code for curve
+ } else {//code for curve
if (this.equals(kspectotrans)) {
insert(p);
} else {
@@ -428,7 +428,7 @@ public class Knotspec {
/**
* Inserts a knot and computes new control points
- *
+ *
* @param p
* inserted knot
*/
@@ -490,7 +490,7 @@ public class Knotspec {
/**
* Copies one control point to another
- *
+ *
* @param topt
* source ctrl point
* @param frompt
@@ -519,7 +519,7 @@ public class Knotspec {
/**
* Computes new control point
- *
+ *
* @param x
* first point
* @param y
@@ -549,7 +549,7 @@ public class Knotspec {
* z.getRelative(0)));
break;
default:
- //no need of default - see previous method and its case statement
+ //no need of default - see previous method and its case statement
// System.out.println("TODO pt_oo_sum default");
break;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
index aac4dfc52..571f44f06 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Knot vector used in curve specification
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Knotvector {
@@ -75,7 +75,7 @@ public class Knotvector {
/**
* Makes new knotvector
- *
+ *
* @param nknots
* number of knots
* @param stride
@@ -92,7 +92,7 @@ public class Knotvector {
/**
* Initializes knotvector
- *
+ *
* @param nknots
* number of knots
* @param stride
@@ -116,7 +116,7 @@ public class Knotvector {
/**
* Validates knot vector parameters
- *
+ *
* @return knot vector validity
*/
public int validate() {
@@ -154,7 +154,7 @@ public class Knotvector {
/**
* Show specified message
- *
+ *
* @param msg
* message to be shown
*/
@@ -166,7 +166,7 @@ public class Knotvector {
/**
* Compares two knots for equality
- *
+ *
* @param a
* first knot
* @param b
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
index bd5d2db98..86638a827 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -112,7 +112,7 @@ public class Mapdesc {
float clampfactor;
/**
- * Value of N_MINSAVINGS property
+ * Value of N_MINSAVINGS property
*/
private float minsavings;
@@ -162,7 +162,7 @@ public class Mapdesc {
private float[] bboxsize;
/**
- * Makes new mapdesc
+ * Makes new mapdesc
* @param type map type
* @param rational is rational
* @param ncoords number of control points coords
@@ -318,7 +318,7 @@ public class Mapdesc {
}
/**
- * Tells whether map is culling
+ * Tells whether map is culling
* @return is map culling
*/
public boolean isCulling() {
@@ -327,7 +327,7 @@ public class Mapdesc {
}
/**
- * Tells whether map is constantly sampling
+ * Tells whether map is constantly sampling
* @return is map constant sampling
*/
public boolean isConstantSampling() {
@@ -335,7 +335,7 @@ public class Mapdesc {
}
/**
- * Tells whether map is domain sampling
+ * Tells whether map is domain sampling
* @return is map domain sampling
*/
public boolean isDomainSampling() {
@@ -343,7 +343,7 @@ public class Mapdesc {
}
/**
- * Returns property of specified tag value
+ * Returns property of specified tag value
* @param tag property tag
* @return property value
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
index 05c89ebcf..a686da696 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
@@ -68,7 +68,7 @@ public class O_nurbscurve {
/**
* Makes new O_nurbscurve
- * @param realType type of curve
+ * @param realType type of curve
*/
public O_nurbscurve(int realType) {
// DONE
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
index f1e499a28..8c2922565 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -52,7 +52,7 @@ public class Patchlist {
private Patch patch;
/**
- * Makes new list of patches
+ * Makes new list of patches
* @param quilts list of quilts
* @param pta low border
* @param ptb high border
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
index 25b4dc441..79f36ce43 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Class representing property
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class Property {
@@ -59,7 +59,7 @@ public class Property {
/**
* Makes new property with given parameters
- *
+ *
* @param type
* property type
* @param tag
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
index 4729e2421..7c636122f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
@@ -35,7 +35,7 @@ package jogamp.opengl.glu.nurbs;
*/
/**
- * Class holding rendering params
+ * Class holding rendering params
* @author Tomas Hrasky
*
*/
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
index 37774f811..4d8296cca 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -41,7 +41,7 @@ package jogamp.opengl.glu.nurbs;
*/
public class Subdivider {
/**
- * Cull type
+ * Cull type
*/
public static final int CULL_TRIVIAL_REJECT = 0;
@@ -76,7 +76,7 @@ public class Subdivider {
private int subdivisions;
/**
- * U step when using domain distance sampling
+ * U step when using domain distance sampling
*/
private float domain_distance_u_rate;
@@ -375,7 +375,7 @@ public class Subdivider {
}
/**
- * Sample
+ * Sample
* @param source
* @param patchlist
* @param subdivisions
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
index e88d69709..1025afb7c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/TrimVertex.java
@@ -36,9 +36,9 @@ package jogamp.opengl.glu.nurbs;
/**
* Holds vertex used in trim
- *
+ *
* @author Tomas Hrasky
- *
+ *
*/
public class TrimVertex {
diff --git a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
index 3d669d9bb..9c8523e51 100644
--- a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
+++ b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
@@ -6,15 +6,15 @@
* this file except in compliance with the License. You may obtain a copy
* of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
* Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- *
+ *
* http://oss.sgi.com/projects/FreeB
- *
+ *
* Note that, as provided in the License, the Software is distributed on an
* "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
* DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
* CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
* PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- *
+ *
* NOTE: The Original Code (as defined below) has been licensed to Sun
* Microsystems, Inc. ("Sun") under the SGI Free Software License B
* (Version 1.1), shown above ("SGI License"). Pursuant to Section
@@ -30,7 +30,7 @@
* Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
* Copyright in any portions created by third parties is as indicated
* elsewhere herein. All Rights Reserved.
- *
+ *
* Additional Notice Provisions: The application programming interfaces
* established by SGI in conjunction with the Original Code are The
* OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
@@ -51,11 +51,11 @@ import javax.media.opengl.glu.GLU;
* @author Administrator
*/
public class Registry {
-
+
/** Creates a new instance of Registry */
public Registry() {
}
-
+
public static String gluGetString(int name) {
if( name == GLU.GLU_VERSION ) {
return( "1.3" );
@@ -64,7 +64,7 @@ public class Registry {
}
return( null );
}
-
+
public static boolean gluCheckExtension( String extName, String extString ) {
if( extName == null || extString == null ) {
return( false );
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 0828d1dc3..5cc4003fe 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -80,7 +80,7 @@ import com.jogamp.opengl.util.glsl.ShaderCode;
import com.jogamp.opengl.util.glsl.ShaderProgram;
public class MacOSXCGLContext extends GLContextImpl
-{
+{
// Abstract interface for implementation of this context (either
// NSOpenGL-based or CGL-based)
protected interface GLBackendImpl {
@@ -140,13 +140,13 @@ public class MacOSXCGLContext extends GLContextImpl
}
private static final String shaderBasename = "texture01_xxx";
-
+
private static ShaderProgram createCALayerShader(GL3ES3 gl) {
// Create & Link the shader program
final ShaderProgram sp = new ShaderProgram();
- final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
+ final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
"../../shader", "../../shader/bin", shaderBasename, true);
- final ShaderCode fp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MacOSXCGLContext.class,
+ final ShaderCode fp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MacOSXCGLContext.class,
"../../shader", "../../shader/bin", shaderBasename, true);
vp.defaultShaderCustomization(gl, true, true);
fp.defaultShaderCustomization(gl, true, true);
@@ -162,7 +162,7 @@ public class MacOSXCGLContext extends GLContextImpl
pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
pmvMatrix.glLoadIdentity();
pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
- pmvMatrix.glLoadIdentity();
+ pmvMatrix.glLoadIdentity();
final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
pmvMatrixUniform.setLocation(gl, sp.program());
gl.glUniform(pmvMatrixUniform);
@@ -170,8 +170,8 @@ public class MacOSXCGLContext extends GLContextImpl
sp.useProgram(gl, false);
return sp;
}
-
-
+
+
private boolean haveSetOpenGLMode = false;
private GLBackendType openGLMode = GLBackendType.NSOPENGL;
@@ -185,7 +185,7 @@ public class MacOSXCGLContext extends GLContextImpl
private long updateHandle = 0;
private int lastWidth, lastHeight;
-
+
protected MacOSXCGLContext(GLDrawableImpl drawable,
GLContext shareWith) {
super(drawable, shareWith);
@@ -303,7 +303,7 @@ public class MacOSXCGLContext extends GLContextImpl
@Override
protected void makeCurrentImpl() throws GLException {
/** FIXME: won't work w/ special drawables (like FBO) - check for CGL mode regressions!
- *
+ *
if (getOpenGLMode() != ((MacOSXCGLDrawable)drawable).getOpenGLMode()) {
setOpenGLMode(((MacOSXCGLDrawable)drawable).getOpenGLMode());
} */
@@ -327,7 +327,7 @@ public class MacOSXCGLContext extends GLContextImpl
throw new GLException("Error destroying OpenGL Context: "+this);
}
}
-
+
private final long getUpdateHandle() {
if( 0 == updateHandle ) {
lastWidth = -1;
@@ -340,7 +340,7 @@ public class MacOSXCGLContext extends GLContextImpl
} else {
incompleteView = false;
}
- if(!incompleteView) {
+ if(!incompleteView) {
updateHandle = CGL.updateContextRegister(contextHandle, drawable.getHandle());
if(0 == updateHandle) {
throw new InternalError("XXX2");
@@ -350,14 +350,14 @@ public class MacOSXCGLContext extends GLContextImpl
}
return updateHandle;
}
-
+
private final void releaseUpdateHandle() {
if ( 0 != updateHandle ) {
CGL.updateContextUnregister(updateHandle);
updateHandle = 0;
- }
+ }
}
-
+
@Override
protected void drawableUpdatedNotify() throws GLException {
if( drawable.getChosenGLCapabilities().isOnscreen() ) {
@@ -376,7 +376,7 @@ public class MacOSXCGLContext extends GLContextImpl
}
}
}
-
+
@Override
protected void associateDrawable(boolean bound) {
// context stuff depends on drawable stuff
@@ -390,12 +390,12 @@ public class MacOSXCGLContext extends GLContextImpl
super.associateDrawable(false); // 2) free drawable stuff
}
}
-
+
/* pp */ void detachPBuffer() {
impl.detachPBuffer();
}
-
+
@Override
protected void copyImpl(GLContext source, int mask) throws GLException {
if( isNSContext() != ((MacOSXCGLContext)source).isNSContext() ) {
@@ -429,7 +429,7 @@ public class MacOSXCGLContext extends GLContextImpl
// FIXME: apparently the Apple extension doesn't require a custom memory allocator
throw new GLException("Not yet implemented");
}
-
+
@Override
protected final void updateGLXProcAddressTable() {
final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration();
@@ -520,11 +520,11 @@ public class MacOSXCGLContext extends GLContextImpl
private int lastWidth=0, lastHeight=0; // allowing to detect size change
private boolean needsSetContextPBuffer = false;
private ShaderProgram gl3ShaderProgram = null;
-
+
@Override
public boolean isNSContext() { return true; }
-
+
/** Only returns a valid NSView. If !NSView, return null and mark either pbuffer and FBO. */
private long getNSViewHandle(boolean[] isPBuffer, boolean[] isFBO) {
final long nsViewHandle;
@@ -558,11 +558,11 @@ public class MacOSXCGLContext extends GLContextImpl
needsSetContextPBuffer = isPBuffer[0];
return nsViewHandle;
}
-
+
@Override
public long create(long share, int ctp, int major, int minor) {
long ctx = 0;
- final NativeSurface surface = drawable.getNativeSurface();
+ final NativeSurface surface = drawable.getNativeSurface();
final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) surface.getGraphicsConfiguration();
final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
final long nsViewHandle;
@@ -606,7 +606,7 @@ public class MacOSXCGLContext extends GLContextImpl
if( !_fixedCaps.isPBuffer() && isPBuffer ) {
throw new InternalError("handle is PBuffer, fixedCaps not: "+drawable);
}
- // determine on-/offscreen caps, since pformat is ambiguous
+ // determine on-/offscreen caps, since pformat is ambiguous
_fixedCaps.setPBuffer( isPBuffer ); // exclusive
_fixedCaps.setBitmap( false ); // n/a in our OSX impl.
_fixedCaps.setOnscreen( !isFBO && !isPBuffer );
@@ -632,7 +632,7 @@ public class MacOSXCGLContext extends GLContextImpl
// Thread.dumpStack();
}
config.setChosenCapabilities(fixedCaps);
-
+
final IntBuffer viewNotReady = Buffers.newDirectIntBuffer(1);
// Try to allocate a context with this
ctx = CGL.createContext(share, nsViewHandle, incompleteView,
@@ -665,12 +665,12 @@ public class MacOSXCGLContext extends GLContextImpl
*
* Since NSOpenGLLayer creation requires this context for it's shared context creation,
* this method attempts to acquire the surface and context lock with {@link #screenVSyncTimeout}/2 maximum wait time.
- * If the surface and context lock could not be acquired, this runnable is being re-queued for later execution.
+ * If the surface and context lock could not be acquired, this runnable is being re-queued for later execution.
*
*
* Hence this method blocks the main-thread only for a short period of time.
*
- */
+ */
class AttachGLLayerCmd implements Runnable {
final OffscreenLayerSurface ols;
final long ctx;
@@ -685,7 +685,7 @@ public class MacOSXCGLContext extends GLContextImpl
long nsOpenGLLayer;
/** Synchronized by instance's monitor */
boolean valid;
-
+
AttachGLLayerCmd(OffscreenLayerSurface ols, long ctx, int shaderProgram, long pfmt, long pbuffer, int texID, boolean isOpaque, int width, int height) {
this.ols = ols;
this.ctx = ctx;
@@ -699,23 +699,23 @@ public class MacOSXCGLContext extends GLContextImpl
this.valid = false;
this.nsOpenGLLayer = 0;
}
-
+
public final String contentToString() {
return "valid "+valid+", size "+width+"x"+height+", ctx "+toHexString(ctx)+", opaque "+isOpaque+", texID "+texID+", pbuffer "+toHexString(pbuffer)+", nsOpenGLLayer "+toHexString(nsOpenGLLayer);
}
-
+
@Override
public final String toString() {
return "AttachGLLayerCmd["+contentToString()+"]";
}
-
+
@Override
public void run() {
synchronized(this) {
if( !valid ) {
try {
final int maxwait = screenVSyncTimeout/2000; // TO 1/2 of current screen-vsync in [ms]
- final RecursiveLock surfaceLock = ols.getLock();
+ final RecursiveLock surfaceLock = ols.getLock();
if( surfaceLock.tryLock( maxwait ) ) {
try {
if( MacOSXCGLContext.this.lock.tryLock( maxwait ) ) {
@@ -752,19 +752,19 @@ public class MacOSXCGLContext extends GLContextImpl
}
}
AttachGLLayerCmd attachGLLayerCmd = null;
-
+
class DetachGLLayerCmd implements Runnable {
final AttachGLLayerCmd cmd;
-
+
DetachGLLayerCmd(AttachGLLayerCmd cmd) {
this.cmd = cmd;
}
-
+
@Override
public final String toString() {
return "DetachGLLayerCmd["+cmd.contentToString()+"]";
}
-
+
@Override
public void run() {
synchronized( cmd ) {
@@ -777,7 +777,7 @@ public class MacOSXCGLContext extends GLContextImpl
ols.detachSurfaceLayer();
}
} catch(Throwable t) {
- System.err.println("Catched Exception on thread "+getThreadName());
+ System.err.println("Catched Exception on thread "+getThreadName());
t.printStackTrace();
}
CGL.releaseNSOpenGLLayer(cmd.nsOpenGLLayer);
@@ -790,27 +790,27 @@ public class MacOSXCGLContext extends GLContextImpl
System.err.println("NSOpenGLLayer.Detach: Skipped "+toHexString(cmd.nsOpenGLLayer)+" - "+getThreadName());
}
}
- }
+ }
}
-
+
@Override
public void associateDrawable(boolean bound) {
backingLayerHost = NativeWindowFactory.getOffscreenLayerSurface(drawable.getNativeSurface(), true);
-
+
if(DEBUG) {
System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable: "+bound+", ctx "+toHexString(contextHandle)+
", hasBackingLayerHost "+(null!=backingLayerHost)+", attachGLLayerCmd "+attachGLLayerCmd);
// Thread.dumpStack();
- }
-
- if( bound ) {
+ }
+
+ if( bound ) {
if( null != backingLayerHost ) {
final GLCapabilitiesImmutable chosenCaps;
final long ctx;
final int texID;
final long pbufferHandle;
final int gl3ShaderProgramName;
-
+
//
// handled layered surface
//
@@ -823,8 +823,8 @@ public class MacOSXCGLContext extends GLContextImpl
pbufferHandle = 0;
fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
public void swapBuffers(boolean doubleBuffered) {
- MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
- } } ) ;
+ MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
+ } } ) ;
} else if( CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
texID = 0;
pbufferHandle = drawableHandle;
@@ -847,19 +847,19 @@ public class MacOSXCGLContext extends GLContextImpl
gl3ShaderProgramName = gl3ShaderProgram.program();
} else {
gl3ShaderProgramName = 0;
- }
-
+ }
+
// All CALayer lifecycle ops are deferred on main-thread
- attachGLLayerCmd = new AttachGLLayerCmd(
- backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID,
+ attachGLLayerCmd = new AttachGLLayerCmd(
+ backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID,
chosenCaps.isBackgroundOpaque(), lastWidth, lastHeight );
if(DEBUG) {
System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(true): "+attachGLLayerCmd);
- }
+ }
OSXUtil.RunOnMainThread(false, attachGLLayerCmd);
- } else { // -> null == backingLayerHost
+ } else { // -> null == backingLayerHost
lastWidth = drawable.getWidth();
- lastHeight = drawable.getHeight();
+ lastHeight = drawable.getHeight();
boolean[] isPBuffer = { false };
boolean[] isFBO = { false };
CGL.setContextView(contextHandle, getNSViewHandle(isPBuffer, isFBO));
@@ -882,7 +882,7 @@ public class MacOSXCGLContext extends GLContextImpl
final DetachGLLayerCmd dCmd = new DetachGLLayerCmd(cmd);
if(DEBUG) {
System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(false): "+dCmd);
- }
+ }
OSXUtil.RunOnMainThread(false, dCmd);
if( null != gl3ShaderProgram ) {
gl3ShaderProgram.destroy(MacOSXCGLContext.this.gl.getGL3());
@@ -903,11 +903,11 @@ public class MacOSXCGLContext extends GLContextImpl
needsSetContextPBuffer = false;
CGL.setContextPBuffer(ctx, drawableHandle);
if(DEBUG) {
- System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx));
+ System.err.println("NS.validateDrawableConfig bind pbuffer "+toHexString(drawableHandle)+" -> ctx "+toHexString(ctx));
}
}
}
-
+
/** Returns true if size has been updated, otherwise false (same size). */
private final boolean validateDrawableSizeConfig(long ctx) {
final int width = drawable.getWidth();
@@ -916,13 +916,13 @@ public class MacOSXCGLContext extends GLContextImpl
lastWidth = drawable.getWidth();
lastHeight = drawable.getHeight();
if(DEBUG) {
- System.err.println("NS.validateDrawableConfig size changed");
+ System.err.println("NS.validateDrawableConfig size changed");
}
return true;
}
return false;
}
-
+
@Override
public boolean copyImpl(long src, int mask) {
CGL.copyContext(contextHandle, src, mask);
@@ -975,7 +975,7 @@ public class MacOSXCGLContext extends GLContextImpl
// CGL.setContextPBuffer(contextHandle, 0); // doesn't work, i.e. not taking nil
return true;
}
-
+
@Override
public boolean setSwapInterval(int interval) {
final AttachGLLayerCmd cmd = attachGLLayerCmd;
@@ -1004,7 +1004,7 @@ public class MacOSXCGLContext extends GLContextImpl
if(DEBUG) { System.err.println("CGL setSwapInterval: "+interval); }
CGL.setSwapInterval(contextHandle, interval);
}
-
+
private int skipSync=0;
/** TODO: Remove after discussion
private boolean perfIterReset = false;
@@ -1014,7 +1014,7 @@ public class MacOSXCGLContext extends GLContextImpl
private long frameXS = 0;
private long lastFrameStart = 0;
*/
-
+
@Override
public boolean swapBuffers() {
final AttachGLLayerCmd cmd = attachGLLayerCmd;
@@ -1026,7 +1026,7 @@ public class MacOSXCGLContext extends GLContextImpl
// allowing to update the texture IDs ASAP.
skipSync = 10;
}
-
+
final boolean res;
final int texID;
final boolean valid;
@@ -1054,19 +1054,19 @@ public class MacOSXCGLContext extends GLContextImpl
final long lastFramePeriod0 = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
gl.glFinish(); // Require to finish previous GL rendering to give CALayer proper result
final long lastFramePeriod1 = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
-
- // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
+
+ // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
// while still synchronizing w/ CALayer.
// If v-sync is enabled wait until next swap interval (v-sync).
CGL.waitUntilNSOpenGLLayerIsReady(cmd.nsOpenGLLayer, vsyncTimeout);
final long lastFramePeriodX = TimeUnit.NANOSECONDS.toMicros(System.nanoTime()) - lastFrameStart;
-
+
final long finishGL = lastFramePeriod1 - lastFramePeriod0;
final long waitGL = lastFramePeriodX - lastFramePeriod1;
finishGLS += finishGL;
waitGLS += waitGL;
frameXS += lastFramePeriodX;
-
+
System.err.println("XXX["+perfIter+"] TO "+vsyncTimeout/1000+" ms, "+
"lFrame0 "+lastFramePeriod0/1000+" ms, "+
"lFrameX "+lastFramePeriodX/1000+" / "+frameXS/1000+" ~"+(frameXS/perfIter)/1000.0+" ms, "+
@@ -1080,8 +1080,8 @@ public class MacOSXCGLContext extends GLContextImpl
// FIXME: IMHO this synchronization should be implicitly performed via 'CGL.flushBuffer(contextHandle)' above,
// in case this will be determined a driver bug - use a QUIRK entry in GLRendererQuirks!
gl.glFinish();
-
- // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
+
+ // If v-sync is disabled, frames will be drawn as quickly as possible w/o delay,
// while still synchronizing w/ CALayer.
// If v-sync is enabled wait until next swap interval (v-sync).
CGL.waitUntilNSOpenGLLayerIsReady(cmd.nsOpenGLLayer, vsyncTimeout);
@@ -1093,7 +1093,7 @@ public class MacOSXCGLContext extends GLContextImpl
CGL.setNSOpenGLLayerNeedsDisplayFBO(cmd.nsOpenGLLayer, texID);
} else {
// trigger CALayer to update incl. possible surface change (new pbuffer handle)
- CGL.setNSOpenGLLayerNeedsDisplayPBuffer(cmd.nsOpenGLLayer, drawable.getHandle());
+ CGL.setNSOpenGLLayerNeedsDisplayPBuffer(cmd.nsOpenGLLayer, drawable.getHandle());
}
// lastFrameStart = TimeUnit.NANOSECONDS.toMicros(System.nanoTime());
}
@@ -1137,8 +1137,8 @@ public class MacOSXCGLContext extends GLContextImpl
if (0 != ctx) {
GLCapabilities fixedCaps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
fixedCaps = GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(fixedCaps, chosenCaps.isBackgroundOpaque());
- { // determine on-/offscreen caps, since pformat is ambiguous
- fixedCaps.setFBO( false ); // n/a for CGLImpl
+ { // determine on-/offscreen caps, since pformat is ambiguous
+ fixedCaps.setFBO( false ); // n/a for CGLImpl
fixedCaps.setPBuffer( fixedCaps.isPBuffer() && !chosenCaps.isOnscreen() );
fixedCaps.setBitmap( false ); // n/a in our OSX impl.
fixedCaps.setOnscreen( !fixedCaps.isPBuffer() );
@@ -1153,7 +1153,7 @@ public class MacOSXCGLContext extends GLContextImpl
if (res != CGL.kCGLNoError) {
throw new GLException("Error code " + res + " while attaching context to pbuffer");
}
- }
+ }
}
} finally {
CGL.CGLDestroyPixelFormat(pixelFormat);
@@ -1224,7 +1224,7 @@ public class MacOSXCGLContext extends GLContextImpl
} */
return true;
}
-
+
@Override
public boolean setSwapInterval(int interval) {
final IntBuffer lval = Buffers.newDirectIntBuffer(1);
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
index 4bd7bc994..bb36a7219 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
@@ -105,7 +105,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
@Override
protected void setRealizedImpl() {
}
-
+
@Override
protected void associateContext(GLContext ctx, boolean bound) {
// NOTE: we need to keep track of the created contexts in order to
@@ -123,14 +123,14 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
} else {
i++;
}
- }
+ }
}
- }
+ }
}
-
+
@Override
protected final void swapBuffersImpl(boolean doubleBuffered) {
- if(doubleBuffered) {
+ if(doubleBuffered) {
synchronized (createdContexts) {
for(int i=0; i libsGL = new ArrayList();
libsGL.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib");
libsGL.add("GL");
- libsList.add(libsGL);
+ libsList.add(libsGL);
return libsList;
}
-
+
@Override
public final List getToolGetProcAddressFuncNameList() {
- return null;
+ return null;
/** OSX manual says: NSImage use is discouraged
List res = new ArrayList();
res.add("GetProcAddress"); // dummy
@@ -59,7 +59,7 @@ public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLib
public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
return 0;
/** OSX manual says: NSImage use is discouraged
- return CGL.getProcAddress(glFuncName); // manual implementation
+ return CGL.getProcAddress(glFuncName); // manual implementation
*/
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 5eb11c6a4..535c4d2d3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -54,7 +54,7 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
- MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
+ MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested) {
super(screen, capsChosen, capsRequested);
}
@@ -71,10 +71,10 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
// MacOSXGraphicsDevice osxDevice = sharedResource.getDevice();
return new ArrayList(0);
}
-
+
static final IntBuffer cglInternalAttributeToken = Buffers.newDirectIntBuffer(new int[] {
CGL.kCGLPFAOpenGLProfile, // >= lion
- CGL.NSOpenGLPFAAccelerated, // query only (prefer accelerated, but allow non accelerated), ignored for createPixelformat
+ CGL.NSOpenGLPFAAccelerated, // query only (prefer accelerated, but allow non accelerated), ignored for createPixelformat
CGL.NSOpenGLPFANoRecovery,
CGL.kCGLPFAColorFloat,
CGL.NSOpenGLPFAPixelBuffer,
@@ -96,13 +96,13 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
for (int idx = 0; idx < len; idx++) {
final int attr = attrToken.get(idx+off);
switch (attr) {
- case CGL.kCGLPFAOpenGLProfile:
+ case CGL.kCGLPFAOpenGLProfile:
ivalues.put(idx, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
break;
case CGL.NSOpenGLPFANoRecovery:
ivalues.put(idx, caps.getHardwareAccelerated() ? 1 : 0);
break;
-
+
case CGL.kCGLPFAColorFloat:
// ivalues.put(idx, ( !caps.isOnscreen() && caps.isPBuffer() && caps.getPbufferFloatingPointBuffers() ) ? 1 : 0);
ivalues.put(idx, 0);
@@ -160,7 +160,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
if ( !MacOSXCGLContext.isLionOrLater ) {
// no OpenGLProfile
attrToken.position(1);
- }
+ }
final IntBuffer ivalues = GLCapabilities2NSAttribList(attrToken, caps, ctp, major, minor);
return CGL.createPixelFormat(attrToken, attrToken.remaining(), ivalues);
}
@@ -174,7 +174,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
final IntBuffer attrs = Buffers.newDirectIntBuffer(256);
int i = 0;
if(MacOSXCGLContext.isLionOrLater) {
- attrs.put(i++, CGL.kCGLPFAOpenGLProfile);
+ attrs.put(i++, CGL.kCGLPFAOpenGLProfile);
attrs.put(i++, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
}
/**
@@ -222,8 +222,8 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
}
return fmt.get(0);
}
-
- static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
+
+ static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
return PixelFormat2GLCapabilities(null, pixelFormat, false);
}
@@ -235,7 +235,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
off = 1;
} else {
off = 0;
- }
+ }
attrToken.position(off);
final int len = attrToken.remaining();
final IntBuffer ivalues = Buffers.newDirectIntBuffer(len);
@@ -243,7 +243,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
// On this platform the pixel format is associated with the
// context and not the drawable. However it's a reasonable
// approximation to just store the chosen pixel format up in the
- // NativeSurface's AbstractGraphicsConfiguration,
+ // NativeSurface's AbstractGraphicsConfiguration,
// since the public API doesn't provide for a different GLCapabilities per context.
// Note: These restrictions of the platform's API might be considered as a bug anyways.
@@ -253,7 +253,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
} else {
CGL.CGLQueryPixelFormat(pixelFormat, attrToken, len, ivalues);
}
-
+
if(null == glp && MacOSXCGLContext.isLionOrLater) {
// pre-scan for OpenGL Profile
for (int i = 0; i < len; i++) {
@@ -265,11 +265,11 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
break;
case CGL.kCGLOGLPVersion_Legacy:
glp = GLProfile.get(GLProfile.GL2);
- break;
+ break;
default:
throw new RuntimeException("Unhandled OSX OpenGL Profile: 0x"+Integer.toHexString(ivalue));
}
- }
+ }
}
}
if(null == glp) {
@@ -284,7 +284,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
case CGL.NSOpenGLPFAAccelerated:
caps.setHardwareAccelerated(ivalue != 0);
break;
-
+
case CGL.kCGLPFAColorFloat:
// caps.setPbufferFloatingPointBuffers(ivalue != 0);
break;
@@ -346,7 +346,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
}
}
caps.setAlphaBits(alphaBits);
-
+
return caps;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index 3bbba2c52..e761be7b7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -56,13 +56,13 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
static void registerFactory() {
GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice.class, GLCapabilitiesImmutable.class, new MacOSXCGLGraphicsConfigurationFactory());
}
- private MacOSXCGLGraphicsConfigurationFactory() {
+ private MacOSXCGLGraphicsConfigurationFactory() {
}
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
-
+
if (absScreen == null) {
throw new IllegalArgumentException("AbstractGraphicsScreen is null");
}
@@ -78,7 +78,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
-
+
return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen, false);
}
@@ -91,7 +91,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
}
final AbstractGraphicsDevice device = absScreen.getDevice();
capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, GLDrawableFactory.getDesktopFactory(), device);
-
+
return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index 4e791cb5f..f6e8b8fa3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -90,7 +90,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
public GLContext createContext(GLContext shareWith) {
return new MacOSXCGLContext(this, shareWith);
}
-
+
protected int getTextureTarget() { return pBufferTexTarget; }
protected int getTextureWidth() { return pBufferTexWidth; }
protected int getTextureHeight() { return pBufferTexHeight; }
@@ -101,7 +101,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
if (0 != pBuffer) {
synchronized (createdContexts) {
for(int i=0; i ref = createdContexts.get(i);
+ final WeakReference ref = createdContexts.get(i);
final MacOSXCGLContext ctx = ref.get();
if (ctx != null) {
ctx.detachPBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index edf9b7c84..c08259665 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -1,22 +1,22 @@
/*
* 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
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution 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.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -59,7 +59,7 @@ import jogamp.opengl.macosx.cgl.MacOSXCGLGraphicsConfiguration;
public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory {
public static void registerFactory() {
GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.awt.AWTGraphicsDevice.class, GLCapabilitiesImmutable.class, new MacOSXAWTCGLGraphicsConfigurationFactory());
- }
+ }
private MacOSXAWTCGLGraphicsConfigurationFactory() {
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
index 1a4ca345b..810a9286b 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandler.java
@@ -37,22 +37,22 @@ import javax.media.opengl.*;
*/
public interface GLArrayHandler {
-
+
/**
- * if bind is true and the data uses VBO,
+ * if bind is true and the data uses VBO,
* the latter will be bound and data written to the GPU if required.
*
* If bind is false and the data uses VBO,
* the latter will be unbound.
*
- *
+ *
* @param gl current GL object
- * @param bind true if VBO shall be bound and data written,
+ * @param bind true if VBO shall be bound and data written,
* otherwise clear VBO binding.
- * @return true if data uses VBO and action was performed, otherwise false
+ * @return true if data uses VBO and action was performed, otherwise false
*/
public boolean bindBuffer(GL gl, boolean bind);
-
+
/**
* Implementation shall enable or disable the array state.
*
@@ -60,23 +60,23 @@ public interface GLArrayHandler {
* implementation shall synchronize the data with the GPU
* and associate the data with the array.
*
- *
+ *
* @param gl current GL object
* @param enable true if array shall be enabled, otherwise false.
- * @param ext extension object allowing passing of an implementation detail
+ * @param ext extension object allowing passing of an implementation detail
*/
public void enableState(GL gl, boolean enable, Object ext);
-
+
/**
- * Supporting interleaved arrays, where sub handlers may handle
+ * Supporting interleaved arrays, where sub handlers may handle
* the array state and the master handler the buffer consistency.
- *
+ *
* @param handler the sub handler
* @throws UnsupportedOperationException if this array handler does not support interleaved arrays
*/
public void addSubHandler(GLArrayHandlerFlat handler) throws UnsupportedOperationException;
public void setSubArrayVBOName(int vboName);
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
index 4a8f40608..179142fee 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerFlat.java
@@ -39,21 +39,21 @@ public interface GLArrayHandlerFlat {
/**
* Implementation shall associate the data with the array
- *
+ *
* @param gl current GL object
- * @param ext extension object allowing passing of an implementation detail
+ * @param ext extension object allowing passing of an implementation detail
*/
public void syncData(GL gl, Object ext);
-
+
/**
* Implementation shall enable or disable the array state.
- *
+ *
* @param gl current GL object
* @param enable true if array shall be enabled, otherwise false.
- * @param ext extension object allowing passing of an implementation detail
+ * @param ext extension object allowing passing of an implementation detail
*/
- public void enableState(GL gl, boolean enable, Object ext);
-
+ public void enableState(GL gl, boolean enable, Object ext);
+
public GLArrayDataWrapper getData();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 98f711b8e..5f9b25530 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -36,8 +36,8 @@ import javax.media.opengl.GL;
import com.jogamp.opengl.util.GLArrayDataEditable;
/**
- * Interleaved fixed function arrays, i.e. where this buffer data
- * represents many arrays.
+ * Interleaved fixed function arrays, i.e. where this buffer data
+ * represents many arrays.
*/
public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
private List subArrays = new ArrayList();
@@ -45,13 +45,13 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
super(ad);
}
-
+
public final void setSubArrayVBOName(int vboName) {
for(int i=0; i{@link #setTextureTarget(int)}
*
@@ -75,21 +75,21 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected volatile State state;
private Object stateLock = new Object();
-
+
protected int textureCount;
protected int textureTarget;
protected int textureFormat;
- protected int textureInternalFormat;
+ protected int textureInternalFormat;
protected int textureType;
protected int texUnit;
-
-
+
+
protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
-
+
/** User requested URI stream location. */
protected URI streamLoc = null;
- /**
+ /**
* In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme},
* {@link #cameraPath} holds the URI's path portion
* as parsed in {@link #initStream(URI, int, int, int)}.
@@ -98,10 +98,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected String cameraPath = null;
/** Optional camera properties, see {@link #cameraPath}. */
protected Map cameraProps = null;
-
+
protected volatile float playSpeed = 1.0f;
protected float audioVolume = 1.0f;
-
+
/** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
protected int vid = GLMediaPlayer.STREAM_ID_AUTO;
/** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
@@ -130,20 +130,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected String acodec = unknown;
/** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
protected String vcodec = unknown;
-
+
protected volatile int decodedFrameCount = 0;
protected int presentedFrameCount = 0;
protected int displayedFrameCount = 0;
protected volatile int video_pts_last = 0;
-
+
/** See {@link #getAudioSink()}. Set by implementation if used from within {@link #initStreamImpl(int, int)}! */
protected AudioSink audioSink = null;
protected boolean audioSinkPlaySpeedSet = false;
-
+
/** System Clock Reference (SCR) of first audio PTS at start time. */
private long audio_scr_t0 = 0;
private boolean audioSCR_reset = true;
-
+
/** System Clock Reference (SCR) of first video frame at start time. */
private long video_scr_t0 = 0;
/** System Clock Reference (SCR) PTS offset, i.e. first video PTS at start time. */
@@ -152,7 +152,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private float video_dpts_cum = 0;
/** Cumulative video frames. */
private int video_dpts_count = 0;
- /** Number of min frame count required for video cumulative sync. */
+ /** Number of min frame count required for video cumulative sync. */
private static final int VIDEO_DPTS_NUM = 20;
/** Cumulative coefficient, value {@value}. */
private static final float VIDEO_DPTS_COEFF = 0.7943282f; // (float) Math.exp(Math.log(0.01) / VIDEO_DPTS_NUM);
@@ -160,7 +160,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private static final int VIDEO_DPTS_MAX = 5000; // 5s max diff
/** Trigger video PTS reset with given cause as bitfield. */
private boolean videoSCR_reset = false;
-
+
protected TextureFrame[] videoFramesOrig = null;
protected Ringbuffer videoFramesFree = null;
protected Ringbuffer videoFramesDecoded = null;
@@ -177,42 +177,42 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.textureTarget=GL.GL_TEXTURE_2D;
this.textureFormat = GL.GL_RGBA;
this.textureInternalFormat = GL.GL_RGBA;
- this.textureType = GL.GL_UNSIGNED_BYTE;
+ this.textureType = GL.GL_UNSIGNED_BYTE;
this.texUnit = 0;
this.state = State.Uninitialized;
}
@Override
public final void setTextureUnit(int u) { texUnit = u; }
-
+
@Override
public final int getTextureUnit() { return texUnit; }
-
+
@Override
public final int getTextureTarget() { return textureTarget; }
-
+
@Override
public final int getTextureCount() { return textureCount; }
-
+
protected final void setTextureTarget(int target) { textureTarget=target; }
- protected final void setTextureFormat(int internalFormat, int format) {
- textureInternalFormat=internalFormat;
- textureFormat=format;
- }
+ protected final void setTextureFormat(int internalFormat, int format) {
+ textureInternalFormat=internalFormat;
+ textureFormat=format;
+ }
protected final void setTextureType(int t) { textureType=t; }
public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
public final int[] getTextureMinMagFilter() { return texMinMagFilter; }
-
+
public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
- public final int[] getTextureWrapST() { return texWrapST; }
-
+ public final int[] getTextureWrapST() { return texWrapST; }
+
private final void checkGLInit() {
if(State.Uninitialized == state || State.Initialized == state ) {
throw new IllegalStateException("GL not initialized: "+this);
- }
+ }
}
-
+
@Override
public String getRequiredExtensionsShaderStub() throws IllegalStateException {
checkGLInit();
@@ -221,24 +221,24 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
return "";
}
-
+
@Override
public String getTextureSampler2DType() throws IllegalStateException {
checkGLInit();
switch(textureTarget) {
case GL.GL_TEXTURE_2D:
- case GL2.GL_TEXTURE_RECTANGLE:
+ case GL2.GL_TEXTURE_RECTANGLE:
return TextureSequence.sampler2D;
case GLES2.GL_TEXTURE_EXTERNAL_OES:
return TextureSequence.samplerExternalOES;
default:
- throw new GLException("Unsuported texture target: "+toHexString(textureTarget));
+ throw new GLException("Unsuported texture target: "+toHexString(textureTarget));
}
}
-
+
/**
* {@inheritDoc}
- *
+ *
* This implementation simply returns the build-in function name of texture2D,
* if not overridden by specialization.
*/
@@ -247,31 +247,31 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
checkGLInit();
return "texture2D";
}
-
+
/**
* {@inheritDoc}
- *
- * This implementation simply returns an empty string since it's using
+ *
+ * This implementation simply returns an empty string since it's using
* the build-in function texture2D,
* if not overridden by specialization.
*/
@Override
public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
checkGLInit();
- return "";
+ return "";
}
-
+
@Override
public final int getDecodedFrameCount() { return decodedFrameCount; }
-
+
@Override
public final int getPresentedFrameCount() { return presentedFrameCount; }
-
+
@Override
public final int getVideoPTS() { return video_pts_last; }
-
+
@Override
- public final int getAudioPTS() {
+ public final int getAudioPTS() {
if( State.Uninitialized != state ) {
return getAudioPTSImpl();
}
@@ -285,10 +285,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return 0;
}
}
-
+
@Override
public final State getState() { return state; }
-
+
@Override
public final State play() {
synchronized( stateLock ) {
@@ -310,7 +310,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract boolean playImpl();
-
+
@Override
public final State pause(boolean flush) {
return pauseImpl(flush, 0);
@@ -337,7 +337,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract boolean pauseImpl();
-
+
@Override
public final State destroy(GL gl) {
return destroyImpl(gl, 0);
@@ -354,7 +354,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract void destroyImpl(GL gl);
-
+
@Override
public final int seek(int msec) {
synchronized( stateLock ) {
@@ -383,12 +383,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
protected abstract int seekImpl(int msec);
-
+
@Override
public final float getPlaySpeed() {
return playSpeed;
}
-
+
@Override
public final boolean setPlaySpeed(float rate) {
synchronized( stateLock ) {
@@ -410,18 +410,18 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return res;
}
}
- /**
+ /**
* Override if not using AudioSink, or AudioSink's {@link AudioSink#setPlaySpeed(float)} is not sufficient!
*
- * AudioSink shall respect !audioSinkPlaySpeedSet to determine data_size
+ * AudioSink shall respect !audioSinkPlaySpeedSet to determine data_size
* at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}.
- *
+ *
*/
protected boolean setPlaySpeedImpl(float rate) {
if( null != audioSink ) {
audioSinkPlaySpeedSet = audioSink.setPlaySpeed(rate);
}
- // still true, even if audioSink rejects command since we deal w/ video sync
+ // still true, even if audioSink rejects command since we deal w/ video sync
// and AudioSink w/ audioSinkPlaySpeedSet at enqueueData(..).
return true;
}
@@ -431,7 +431,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
getAudioVolumeImpl();
return audioVolume;
}
- /**
+ /**
* Override if not using AudioSink, or AudioSink's {@link AudioSink#getVolume()} is not sufficient!
*/
protected void getAudioVolumeImpl() {
@@ -439,7 +439,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
audioVolume = audioSink.getVolume();
}
}
-
+
@Override
public boolean setAudioVolume(float v) {
synchronized( stateLock ) {
@@ -460,7 +460,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return res;
}
}
- /**
+ /**
* Override if not using AudioSink, or AudioSink's {@link AudioSink#setVolume(float)} is not sufficient!
*/
protected boolean setAudioVolumeImpl(float v) {
@@ -470,7 +470,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
// still true, even if audioSink rejects command ..
return true;
}
-
+
@Override
public final void initStream(URI streamLoc, int vid, int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
synchronized( stateLock ) {
@@ -490,7 +490,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
decodedFrameCount = 0;
presentedFrameCount = 0;
- displayedFrameCount = 0;
+ displayedFrameCount = 0;
this.streamLoc = streamLoc;
// Pre-parse for camera-input scheme
@@ -500,7 +500,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
if( null != streamLocScheme && streamLocScheme.equals(CameraInputScheme) ) {
final String rawPath = streamLoc.getRawPath();
if( null != rawPath && rawPath.length() > 0 ) {
- // cut-off root fwd-slash
+ // cut-off root fwd-slash
cameraPath = rawPath.substring(1);
final URIQueryProps props = URIQueryProps.create(streamLoc, ';');
cameraProps = props.getProperties();
@@ -508,7 +508,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
throw new IllegalArgumentException("Camera path is empty: "+streamLoc.toString());
}
}
-
+
this.vid = vid;
this.aid = aid;
if (this.streamLoc != null) {
@@ -519,7 +519,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
/**
* Implementation shall set the following set of data here
* @see #vid
- * @see #aid
+ * @see #aid
* @see #width
* @see #height
* @see #fps
@@ -530,7 +530,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* @see #vcodec
*/
protected abstract void initStreamImpl(int vid, int aid) throws Exception;
-
+
@Override
public final StreamException getStreamException() {
synchronized( stateLock ) {
@@ -541,26 +541,26 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
}
-
+
@Override
public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException {
synchronized( stateLock ) {
if(State.Initialized != state ) {
throw new IllegalStateException("Stream not in state initialized: "+this);
- }
+ }
final StreamException streamInitErr = streamWorker.getStreamErr();
if( null != streamInitErr ) {
streamWorker = null; // already terminated!
destroy(null);
throw streamInitErr;
}
- try {
+ try {
if( STREAM_ID_NONE != vid ) {
removeAllTextureFrames(gl);
initGLImpl(gl);
if(DEBUG) {
System.err.println("initGLImpl.X "+this);
- }
+ }
videoFramesOrig = createTexFrames(gl, textureCount);
videoFramesFree = new LFRingbuffer(videoFramesOrig);
videoFramesDecoded = new LFRingbuffer(TextureFrame[].class, textureCount);
@@ -583,7 +583,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
}
- /**
+ /**
* Shall initialize all GL related resources, if not audio-only.
*
* Shall also take care of {@link AudioSink} initialization if appropriate.
@@ -593,8 +593,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* @throws GLException
*/
protected abstract void initGLImpl(GL gl) throws IOException, GLException;
-
- /**
+
+ /**
* Returns the validated number of textures to be handled.
*
* Default is {@link #TEXTURE_COUNT_MIN} minimum textures.
@@ -606,7 +606,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
protected int validateTextureCount(int desiredTextureCount) {
return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount;
}
-
+
protected TextureFrame[] createTexFrames(GL gl, final int count) {
final int[] texNames = new int[count];
gl.glGenTextures(count, texNames, 0);
@@ -621,7 +621,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return texFrames;
}
protected abstract TextureFrame createTexImage(GL gl, int texName);
-
+
protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight) {
if( 0 > texName ) {
throw new RuntimeException("TextureName "+toHexString(texName)+" invalid.");
@@ -661,19 +661,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]);
- gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]);
gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, texWrapST[0]);
gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]);
-
+
return com.jogamp.opengl.util.texture.TextureIO.newTexture(
texName, textureTarget,
tWidth, tHeight,
width, height,
- !isInGLOrientation);
+ !isInGLOrientation);
}
-
+
protected void destroyTexFrame(GL gl, TextureFrame frame) {
- frame.getTexture().destroy(gl);
+ frame.getTexture().destroy(gl);
}
@Override
@@ -683,7 +683,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
return lastFrame;
}
-
+
private final void removeAllTextureFrames(GL gl) {
final TextureFrame[] texFrames = videoFramesOrig;
videoFramesOrig = null;
@@ -699,14 +699,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
texFrames[i] = null;
}
- System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");
- }
+ System.err.println(Thread.currentThread().getName()+"> Clear TexFrame["+i+"]: "+frame+" -> null");
+ }
}
}
-
+
protected TextureFrame cachedFrame = null;
protected long lastTimeMillis = 0;
-
+
@Override
public final TextureFrame getNextTexture(GL gl) throws IllegalStateException {
synchronized( stateLock ) {
@@ -750,7 +750,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
} else {
d_apts = 0;
}
-
+
final int frame_period_last = video_pts - video_pts_last; // rendering loop interrupted ?
if( videoSCR_reset || frame_period_last > frame_duration*10 ) {
videoSCR_reset = false;
@@ -782,7 +782,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
cachedFrame = nextFrame;
nextFrame = null;
} else if ( !droppedFrame && dt < -maxVideoDelay && videoFramesDecoded.size() > 0 ) {
- // only drop if prev. frame has not been dropped and
+ // only drop if prev. frame has not been dropped and
// frame is too late and one decoded frame is already available.
dropFrame = true;
}
@@ -791,7 +791,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
System.err.println( "AV_: dT "+(currentTimeMillis-lastTimeMillis)+", "+
getPerfStringImpl( video_scr, video_pts, d_vpts,
audio_scr, audio_pts, d_apts,
- video_dpts_avg_diff ) +
+ video_dpts_avg_diff ) +
", avg dpy-fps "+avg_dpy_duration+" ms/f, maxD "+maxVideoDelay+" ms, "+_nextFrame+", playCached " + playCached + ", dropFrame "+dropFrame);
}
}
@@ -803,7 +803,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
lastFrame = nextFrame;
videoFramesFree.putBlocking(_lastFrame);
}
- } else if( DEBUG ) {
+ } else if( DEBUG ) {
final int video_pts = lastFrame.getPTS();
final int audio_pts = getAudioPTSImpl();
final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
@@ -835,25 +835,25 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* Audio frames, i.e. {@link AudioSink.AudioFrame}, shall be handled in the process.
*
* Video frames shall be ignored, if {@link #getVID()} is {@link #STREAM_ID_NONE}.
- *
+ *
*
* Audio frames shall be ignored, if {@link #getAID()} is {@link #STREAM_ID_NONE}.
*
* Implementation shall care of OpenGL synchronization as required, e.g. glFinish()/glFlush()!
*
- * @param gl valid and current GL instance, shall be null for audio only.
+ * @param gl valid and current GL instance, shall be null for audio only.
* @param nextFrame the {@link TextureFrame} to store the video PTS and texture data,
* shall be null for audio only.
* @return the last processed video PTS value, maybe {@link TimeFrameI#INVALID_PTS} if video frame is invalid or n/a.
- * Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached.
+ * Will be {@link TimeFrameI#END_OF_STREAM_PTS} if end of stream reached.
*/
protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
-
- /**
+
+ /**
* {@inheritDoc}
*
* Note: All {@link AudioSink} operations are performed from {@link GLMediaPlayerImpl},
@@ -866,8 +866,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
*/
@Override
public final AudioSink getAudioSink() { return audioSink; }
-
- /**
+
+ /**
* To be called from implementation at 1st PTS after start
* w/ current pts value in milliseconds.
* @param audio_scr_t0
@@ -908,10 +908,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private final int getVideoDPTSAvg() {
return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
}
-
+
private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) {
decodedFrameCount++;
- if( 0 == frame.getDuration() ) { // patch frame duration if not set already
+ if( 0 == frame.getDuration() ) { // patch frame duration if not set already
frame.setDuration( (int) frame_duration );
}
synchronized(eventListenersLock) {
@@ -920,38 +920,38 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
}
-
+
class StreamWorker extends Thread {
private volatile boolean isRunning = false;
private volatile boolean isActive = false;
private volatile boolean isBlocked = false;
-
+
private volatile boolean shallPause = true;
private volatile boolean shallStop = false;
-
+
private volatile StreamException streamErr = null;
private volatile GLContext sharedGLCtx = null;
private boolean sharedGLCtxCurrent = false;
private GLDrawable dummyDrawable = null;
-
- /**
- * Starts this daemon thread,
+
+ /**
+ * Starts this daemon thread,
* which initializes the stream first via {@link GLMediaPlayerImpl#initStreamImpl(int, int)} first.
*
* After stream initialization, this thread pauses!
*
- **/
+ **/
StreamWorker() {
setDaemon(true);
start();
}
-
+
private void makeCurrent(GLContext ctx) {
if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) {
throw new GLException("Couldn't make ctx current: "+ctx);
}
}
-
+
private void destroySharedGL() {
if( null != sharedGLCtx ) {
if( sharedGLCtx.isCreated() ) {
@@ -963,16 +963,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
gle.printStackTrace();
}
}
- sharedGLCtx = null;
+ sharedGLCtx = null;
}
if( null != dummyDrawable ) {
final AbstractGraphicsDevice device = dummyDrawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
dummyDrawable.setRealized(false);
dummyDrawable = null;
device.close();
- }
+ }
}
-
+
public synchronized void initGL(GL gl) {
final GLContext glCtx = gl.getContext();
final boolean glCtxCurrent = glCtx.isCurrent();
@@ -1013,7 +1013,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
while( !isActive ) {
this.notify(); // wake-up pause-block
try {
- this.wait(); // wait until resumed
+ this.wait(); // wait until resumed
} catch (InterruptedException e) {
e.printStackTrace();
}
@@ -1041,12 +1041,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
public boolean isRunning() { return isRunning; }
public boolean isActive() { return isActive; }
- public StreamException getStreamErr() { return streamErr; }
-
+ public StreamException getStreamErr() { return streamErr; }
+
public void run() {
setName(getName()+"-StreamWorker_"+StreamWorkerInstanceId);
StreamWorkerInstanceId++;
-
+
synchronized ( this ) {
isRunning = true;
try {
@@ -1061,7 +1061,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
return; // end of thread!
} // also initializes width, height, .. etc
}
-
+
while( !shallStop ){
if( shallPause ) {
synchronized ( this ) {
@@ -1100,7 +1100,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
}
-
+
if( !shallStop ) {
TextureFrame nextFrame = null;
try {
@@ -1121,7 +1121,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
Thread.sleep(STREAM_WORKER_DELAY);
}
if( !videoFramesDecoded.put(nextFrame) ) {
- throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this);
+ throw new InternalError("XXX: free "+videoFramesFree+", decoded "+videoFramesDecoded+", "+GLMediaPlayerImpl.this);
}
newFrameAvailable(nextFrame, Platform.currentTimeMillis());
nextFrame = null;
@@ -1170,10 +1170,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.notify(); // wake-up doStop()
}
}
- }
- static int StreamWorkerInstanceId = 0;
+ }
+ static int StreamWorkerInstanceId = 0;
private StreamWorker streamWorker = null;
-
+
protected final int addStateEventMask(int event_mask, State newState) {
if( state != newState ) {
switch( newState ) {
@@ -1193,7 +1193,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
return event_mask;
}
-
+
protected final void attributesUpdated(int event_mask) {
if( 0 != event_mask ) {
final long now = Platform.currentTimeMillis();
@@ -1204,7 +1204,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
}
-
+
protected final void changeState(int event_mask, State newState) {
event_mask = addStateEventMask(event_mask, newState);
if( 0 != event_mask ) {
@@ -1212,9 +1212,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
attributesUpdated( event_mask );
}
}
-
- protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream,
- int bps_video, int bps_audio, float fps,
+
+ protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream,
+ int bps_video, int bps_audio, float fps,
int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
int event_mask = 0;
if( state == State.Uninitialized ) {
@@ -1227,19 +1227,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
if( this.vid != vid ) {
event_mask |= GLMediaEventListener.EVENT_CHANGE_VID;
this.vid = vid;
- }
+ }
if( STREAM_ID_AUTO == vid ) {
vid = STREAM_ID_NONE;
}
if( this.aid != aid ) {
event_mask |= GLMediaEventListener.EVENT_CHANGE_AID;
this.aid = aid;
- }
+ }
if( this.width != width || this.height != height ) {
event_mask |= GLMediaEventListener.EVENT_CHANGE_SIZE;
this.width = width;
this.height = height;
- }
+ }
if( this.fps != fps ) {
event_mask |= GLMediaEventListener.EVENT_CHANGE_FPS;
this.fps = fps;
@@ -1257,7 +1257,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.audioFrames = audioFrames;
this.duration = duration;
}
- if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) {
+ if( (null!=acodec && acodec.length()>0 && !this.acodec.equals(acodec)) ) {
event_mask |= GLMediaEventListener.EVENT_CHANGE_CODEC;
this.acodec = acodec;
}
@@ -1283,7 +1283,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
attributesUpdated(GLMediaEventListener.EVENT_CHANGE_SIZE);
}
}
-
+
@Override
public final URI getURI() {
return streamLoc;
@@ -1291,10 +1291,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
@Override
public final int getVID() { return vid; }
-
+
@Override
public final int getAID() { return aid; }
-
+
@Override
public final String getVideoCodec() {
return vcodec;
@@ -1309,7 +1309,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
public final int getVideoFrames() {
return videoFrames;
}
-
+
@Override
public final int getAudioFrames() {
return audioFrames;
@@ -1319,7 +1319,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
public final int getDuration() {
return duration;
}
-
+
@Override
public final long getStreamBitrate() {
return bps_stream;
@@ -1329,12 +1329,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
public final int getVideoBitrate() {
return bps_video;
}
-
+
@Override
public final int getAudioBitrate() {
return bps_audio;
}
-
+
@Override
public final float getFramerate() {
return fps;
@@ -1344,7 +1344,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
public final boolean isGLOriented() {
return isInGLOrientation;
}
-
+
@Override
public final int getWidth() {
return width;
@@ -1369,11 +1369,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
"Video[id "+vid+", <"+vcodec+">, "+width+"x"+height+", glOrient "+isInGLOrientation+", "+fps+" fps, "+frame_duration+" fdur, "+bps_video+" bps], "+
"Audio[id "+aid+", <"+acodec+">, "+bps_audio+" bps, "+audioFrames+" frames], uri "+loc+camPath+"]";
}
-
+
@Override
public final String getPerfString() {
final long currentTimeMillis = Platform.currentTimeMillis();
- final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
+ final int video_scr = video_scr_pts + (int) ( ( currentTimeMillis - video_scr_t0 ) * playSpeed );
final int d_vpts = video_pts_last - video_scr;
final int audio_scr = (int) ( ( currentTimeMillis - audio_scr_t0 ) * playSpeed );
final int audio_pts = getAudioPTSImpl();
@@ -1383,7 +1383,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
private final String getPerfStringImpl(final int video_scr, final int video_pts, final int d_vpts,
final int audio_scr, final int audio_pts, final int d_apts,
final int video_dpts_avg_diff) {
- final float tt = getDuration() / 1000.0f;
+ final float tt = getDuration() / 1000.0f;
final String audioSinkInfo;
final AudioSink audioSink = getAudioSink();
if( null != audioSink ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index 85fab96a4..6e006d9c0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -22,75 +22,75 @@ public class JavaSoundAudioSink implements AudioSink {
public static final int BUFFER_SIZE = 1000;
public static final int SAMPLES_PER_BUFFER = BUFFER_SIZE / 2;
private static final boolean staticAvailable;
-
+
// Sample time values
// public static final double SAMPLE_TIME_IN_SECS = 1.0 / DEFAULT_SAMPLE_RATE;
// public static final double BUFFER_TIME_IN_SECS = SAMPLE_TIME_IN_SECS * SAMPLES_PER_BUFFER;
-
+
private javax.sound.sampled.AudioFormat format;
private DataLine.Info info;
private SourceDataLine auline;
private int bufferCount;
- private byte [] sampleData = new byte[BUFFER_SIZE];
+ private byte [] sampleData = new byte[BUFFER_SIZE];
private boolean initialized = false;
private AudioSink.AudioFormat chosenFormat = null;
-
+
private volatile boolean playRequested = false;
private float volume = 1.0f;
-
+
static {
boolean ok = false;
try {
AudioSystem.getAudioFileTypes();
ok = true;
} catch (Throwable t) {
-
+
}
staticAvailable=ok;
- }
-
+ }
+
@Override
public String toString() {
return "JavaSoundSink[init "+initialized+", dataLine "+info+", source "+auline+", bufferCount "+bufferCount+
", chosen "+chosenFormat+", jsFormat "+format;
}
-
+
@Override
public final float getPlaySpeed() { return 1.0f; } // FIXME
-
+
@Override
- public final boolean setPlaySpeed(float rate) {
- return false; // FIXME
+ public final boolean setPlaySpeed(float rate) {
+ return false; // FIXME
}
-
+
@Override
public final float getVolume() {
// FIXME
- return volume;
+ return volume;
}
-
+
@Override
public final boolean setVolume(float v) {
// FIXME
volume = v;
return true;
}
-
+
@Override
public AudioSink.AudioFormat getPreferredFormat() {
return DefaultFormat;
}
-
+
@Override
public final int getMaxSupportedChannels() {
return 2;
}
-
+
@Override
public final boolean isSupported(AudioSink.AudioFormat format) {
return true;
}
-
+
@Override
public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
if( !staticAvailable ) {
@@ -117,12 +117,12 @@ public class JavaSoundAudioSink implements AudioSink {
}
return true;
}
-
+
@Override
public boolean isPlaying() {
return playRequested && auline.isRunning();
}
-
+
@Override
public void play() {
if( null != auline ) {
@@ -135,7 +135,7 @@ public class JavaSoundAudioSink implements AudioSink {
auline.start();
}
}
-
+
@Override
public void pause() {
if( null != auline ) {
@@ -143,9 +143,9 @@ public class JavaSoundAudioSink implements AudioSink {
auline.stop();
}
}
-
+
@Override
- public void flush() {
+ public void flush() {
if( null != auline ) {
playRequested = false;
auline.stop();
@@ -157,17 +157,17 @@ public class JavaSoundAudioSink implements AudioSink {
public final int getEnqueuedFrameCount() {
return 0; // FIXME
}
-
+
@Override
public int getFrameCount() {
return 1;
}
-
+
@Override
public int getQueuedFrameCount() {
return 0;
}
-
+
@Override
public boolean isInitialized() {
return initialized;
@@ -179,7 +179,7 @@ public class JavaSoundAudioSink implements AudioSink {
chosenFormat = null;
// FIXEM: complete code!
}
-
+
@Override
public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
int byteSize = audioDataFrame.getByteSize();
@@ -188,7 +188,7 @@ public class JavaSoundAudioSink implements AudioSink {
final int p = byteBuffer.position();
byteBuffer.get(bytes, 0, byteSize);
byteBuffer.position(p);
-
+
int written = 0;
int len;
while (byteSize > 0) {
@@ -203,27 +203,27 @@ public class JavaSoundAudioSink implements AudioSink {
@Override
public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount));
- }
-
+ }
+
@Override
public int getQueuedByteCount() {
return auline.getBufferSize() - auline.available();
}
-
+
@Override
public int getFreeFrameCount() {
return auline.available();
}
-
+
@Override
public int getQueuedTime() {
return getQueuedTimeImpl( getQueuedByteCount() );
}
private final int getQueuedTimeImpl(int byteCount) {
final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8
- return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) );
+ return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) );
}
@Override
- public final int getPTS() { return 0; } // FIXME
+ public final int getPTS() { return 0; } // FIXME
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 723bb9dd1..8d3dbdf44 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -15,32 +15,32 @@ public class NullAudioSink implements AudioSink {
private volatile float playSpeed = 1.0f;
private volatile boolean playRequested = false;
private float volume = 1.0f;
-
+
@Override
public final float getPlaySpeed() { return playSpeed; }
-
+
@Override
- public final boolean setPlaySpeed(float rate) {
+ public final boolean setPlaySpeed(float rate) {
if( Math.abs(1.0f - rate) < 0.01f ) {
rate = 1.0f;
}
- playSpeed = rate;
+ playSpeed = rate;
return true;
}
-
+
@Override
public final float getVolume() {
// FIXME
- return volume;
+ return volume;
}
-
+
@Override
public final boolean setVolume(float v) {
// FIXME
- volume = v;
+ volume = v;
return true;
}
-
+
@Override
public AudioFormat getPreferredFormat() {
return DefaultFormat;
@@ -50,73 +50,73 @@ public class NullAudioSink implements AudioSink {
public final int getMaxSupportedChannels() {
return 8;
}
-
+
@Override
public final boolean isSupported(AudioFormat format) {
return true;
}
-
+
@Override
public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
return true;
}
-
+
@Override
public boolean isPlaying() {
return playRequested;
}
-
+
@Override
public void play() {
playRequested = true;
}
-
+
@Override
public void pause() {
playRequested = false;
}
-
+
@Override
- public void flush() {
+ public void flush() {
}
-
+
@Override
public void destroy() {
}
-
+
@Override
public final int getEnqueuedFrameCount() {
return 0;
}
-
+
@Override
public int getFrameCount() {
return 0;
}
-
+
@Override
public int getQueuedFrameCount() {
return 0;
}
-
+
@Override
public int getQueuedByteCount() {
return 0;
}
-
+
@Override
public int getQueuedTime() {
return 0;
}
-
+
@Override
public final int getPTS() { return 0; }
-
+
@Override
public int getFreeFrameCount() {
- return 1;
+ return 1;
}
-
+
@Override
public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
return null;
@@ -125,5 +125,5 @@ public class NullAudioSink implements AudioSink {
@Override
public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
return null;
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 1cddaa9cf..840149272 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -54,10 +54,10 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
private TextureData texData = null;
private int pos_ms = 0;
private long pos_start = 0;
-
+
public NullGLMediaPlayer() {
super();
-
+
}
@Override
@@ -82,16 +82,16 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
validatePos();
return pos_ms;
}
-
+
@Override
protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
final int pts = getAudioPTSImpl();
nextFrame.setPTS( pts );
return pts;
}
-
+
@Override
- protected final int getAudioPTSImpl() {
+ protected final int getAudioPTSImpl() {
pos_ms = (int) ( Platform.currentTimeMillis() - pos_start );
validatePos();
return pos_ms;
@@ -102,9 +102,9 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
if(null != texData) {
texData.destroy();
texData = null;
- }
+ }
}
-
+
public final static TextureData createTestTextureData() {
TextureData res = null;
try {
@@ -125,28 +125,28 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
buffer.rewind();
res = new TextureData(GLProfile.getGL2ES2(),
GL.GL_RGBA, w, h, 0,
- GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false,
+ GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, false,
false, false, buffer, null);
}
return res;
}
-
+
@Override
protected final void initStreamImpl(int vid, int aid) throws IOException {
texData = createTestTextureData();
final float _fps = 24f;
final int _duration = 10*60*1000; // msec
final int _totalFrames = (int) ( (_duration/1000)*_fps );
- updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE,
- texData.getWidth(), texData.getHeight(), 0,
- 0, 0, _fps,
+ updateAttributes(0 /* fake */, GLMediaPlayer.STREAM_ID_NONE,
+ texData.getWidth(), texData.getHeight(), 0,
+ 0, 0, _fps,
_totalFrames, 0, _duration, "png-static", null);
- }
+ }
@Override
protected final void initGLImpl(GL gl) throws IOException, GLException {
isInGLOrientation = true;
}
-
+
/**
* {@inheritDoc}
*
@@ -157,21 +157,21 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
protected int validateTextureCount(int desiredTextureCount) {
return 2;
}
-
+
@Override
protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
final Texture texture = super.createTexImageImpl(gl, texName, width, height);
if(null != texData) {
texture.updateImage(gl, texData);
- }
+ }
return new TextureSequence.TextureFrame( texture );
}
-
+
@Override
protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
super.destroyTexFrame(gl, frame);
}
-
+
private void validatePos() {
boolean considerPausing = false;
if( 0 > pos_ms) {
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index 146a47ebc..390c20346 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,12 +20,12 @@
* 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 jogamp.opengl.util.av.impl;
import java.security.AccessController;
@@ -48,9 +48,9 @@ import com.jogamp.common.util.VersionNumber;
*/
class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
private static final boolean DEBUG = FFMPEGMediaPlayer.DEBUG || DynamicLibraryBundleInfo.DEBUG;
-
+
private static final List glueLibNames = new ArrayList(); // none
-
+
private static final int symbolCount = 65;
private static final String[] symbolNames = {
"avutil_version",
@@ -61,10 +61,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
// libavcodec
"avcodec_register_all",
- "avcodec_close",
- "avcodec_string",
- "avcodec_find_decoder",
- "avcodec_open2", // 53.6.0 (opt)
+ "avcodec_close",
+ "avcodec_string",
+ "avcodec_find_decoder",
+ "avcodec_open2", // 53.6.0 (opt)
"avcodec_alloc_frame",
"avcodec_get_frame_defaults",
"avcodec_free_frame", // 54.28.0 (opt)
@@ -79,10 +79,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"av_init_packet",
"av_new_packet",
"av_destruct_packet",
- "av_free_packet",
+ "av_free_packet",
"avcodec_decode_audio4", // 53.25.0 (opt)
/* 27 */ "avcodec_decode_video2", // 52.23.0
-
+
// libavutil
"av_pix_fmt_descriptors",
"av_frame_unref", // 55.0.0 (opt)
@@ -101,10 +101,10 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"avformat_alloc_context",
"avformat_free_context", // 52.96.0 (opt)
"avformat_close_input", // 53.17.0 (opt)
- "av_register_all",
+ "av_register_all",
"av_find_input_format",
- "avformat_open_input",
- "av_dump_format",
+ "avformat_open_input",
+ "av_dump_format",
"av_read_frame",
"av_seek_frame",
"avformat_seek_file", // ??? (opt)
@@ -115,24 +115,24 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
/* 54 */ "avformat_find_stream_info", // 53.3.0 (opt)
// libavdevice
-/* 55 */ "avdevice_register_all", // ???
-
+/* 55 */ "avdevice_register_all", // ???
+
// libavresample
"avresample_alloc_context", // 1.0.1
"avresample_open",
"avresample_close",
"avresample_free",
/* 60 */ "avresample_convert",
-
+
// libavresample
"av_opt_set_sample_fmt", // actually lavu .. but exist only w/ swresample!
"swr_alloc",
- "swr_init",
+ "swr_init",
"swr_free",
/* 65 */ "swr_convert",
};
-
+
// optional symbol names
private static final String[] optionalSymbolNames = {
"avformat_seek_file", // ??? (opt)
@@ -145,7 +145,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
// libavdevice
"avdevice_register_all", // 53.0.0 (opt)
-
+
// libavresample
"avresample_version", // 1.0.1
"avresample_alloc_context", // 1.0.1
@@ -153,43 +153,43 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
"avresample_close",
"avresample_free",
"avresample_convert",
-
+
// libavresample
"av_opt_set_sample_fmt", // actually lavu .. but exist only w/ swresample!
"swresample_version", // 0
"swr_alloc",
- "swr_init",
+ "swr_init",
"swr_free",
"swr_convert",
};
-
+
private static final long[] symbolAddr = new long[symbolCount];
private static final boolean ready;
private static final boolean libsUFCLoaded;
private static final boolean avresampleLoaded; // optional
private static final boolean swresampleLoaded; // optional
private static final boolean avdeviceLoaded; // optional
- static final VersionNumber avCodecVersion;
+ static final VersionNumber avCodecVersion;
static final VersionNumber avFormatVersion;
static final VersionNumber avUtilVersion;
static final VersionNumber avResampleVersion;
static final VersionNumber swResampleVersion;
private static final FFMPEGNatives natives;
-
+
private static final int LIB_IDX_UTI = 0;
private static final int LIB_IDX_FMT = 1;
private static final int LIB_IDX_COD = 2;
private static final int LIB_IDX_DEV = 3;
private static final int LIB_IDX_AVR = 4;
private static final int LIB_IDX_SWR = 5;
-
+
static {
- // native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile
+ // native ffmpeg media player implementation is included in jogl_desktop and jogl_mobile
GLProfile.initSingleton();
boolean _ready = false;
- /** util, format, codec, device, avresample, swresample */
- boolean[] _loaded= new boolean[6];
- /** util, format, codec, avresample, swresample */
+ /** util, format, codec, device, avresample, swresample */
+ boolean[] _loaded= new boolean[6];
+ /** util, format, codec, avresample, swresample */
VersionNumber[] _versions = new VersionNumber[5];
try {
_ready = initSymbols(_loaded, _versions);
@@ -226,7 +226,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
} else {
System.err.println("LIB_AV No Version/Native-Impl Match");
natives = null;
- }
+ }
if( null != natives && FFMPEGStaticNatives.initIDs0() ) {
ready = natives.initSymbols0(symbolAddr, symbolCount);
} else {
@@ -234,7 +234,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
}
}
}
-
+
static boolean libsLoaded() { return libsUFCLoaded; }
static boolean avDeviceLoaded() { return avdeviceLoaded; }
static boolean avResampleLoaded() { return avresampleLoaded; }
@@ -265,11 +265,11 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
if(symbolNames.length != symbolCount) {
throw new InternalError("XXX0 "+symbolNames.length+" != "+symbolCount);
}
-
+
// optional symbol name set
final Set optionalSymbolNameSet = new HashSet();
optionalSymbolNameSet.addAll(Arrays.asList(optionalSymbolNames));
-
+
// lookup
AccessController.doPrivileged(new PrivilegedAction
- */
+ */
@Override
public final boolean shallLookupGlobal() {
- return true;
+ return true;
}
-
+
@Override
public final List getGlueLibNames() {
return glueLibNames;
@@ -329,7 +329,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
List> libsList = new ArrayList>();
// 6: util, format, codec, device, avresample, swresample
-
+
final List avutil = new ArrayList();
avutil.add("avutil"); // default
@@ -337,13 +337,13 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
avutil.add("libavutil.so.52"); // ffmpeg 1.2 + 2 / libav 9 + 10
avutil.add("libavutil.so.51"); // 0.8
avutil.add("libavutil.so.50"); // 0.7
-
+
avutil.add("avutil-53"); // dummy future proof
avutil.add("avutil-52"); // ffmpeg 1.2 + 2 / libav 9 + 10
avutil.add("avutil-51"); // 0.8
avutil.add("avutil-50"); // 0.7
libsList.add(avutil);
-
+
final List avformat = new ArrayList();
avformat.add("avformat"); // default
@@ -352,14 +352,14 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
avformat.add("libavformat.so.54"); // ffmpeg 1.2 / libav 9
avformat.add("libavformat.so.53"); // 0.8
avformat.add("libavformat.so.52"); // 0.7
-
+
avformat.add("avformat-56"); // dummy future proof
avformat.add("avformat-55"); // ffmpeg 2 / libav 10
avformat.add("avformat-54"); // ffmpeg 1.2 / libav 9
avformat.add("avformat-53"); // 0.8
- avformat.add("avformat-52"); // 0.7
+ avformat.add("avformat-52"); // 0.7
libsList.add(avformat);
-
+
final List avcodec = new ArrayList();
avcodec.add("avcodec"); // default
@@ -367,15 +367,15 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
avcodec.add("libavcodec.so.55"); // ffmpeg 2/ libav 10
avcodec.add("libavcodec.so.54"); // ffmpeg 1.2 / libav 9
avcodec.add("libavcodec.so.53"); // 0.8
- avcodec.add("libavcodec.so.52"); // 0.7
-
+ avcodec.add("libavcodec.so.52"); // 0.7
+
avcodec.add("avcodec-56"); // dummy future proof
avcodec.add("avcodec-55"); // ffmpeg 2/ libav 10
avcodec.add("avcodec-54"); // ffmpeg 1.2 / libav 9
avcodec.add("avcodec-53"); // 0.8
- avcodec.add("avcodec-52"); // 0.7
+ avcodec.add("avcodec-52"); // 0.7
libsList.add(avcodec);
-
+
final List avdevice = new ArrayList();
avdevice.add("avdevice"); // default
@@ -383,19 +383,19 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
avdevice.add("libavdevice.so.55"); // ffmpeg 2
avdevice.add("libavdevice.so.54"); // ffmpeg 1.2 / libav 10
avdevice.add("libavdevice.so.53"); // 0.8 && libav 9
-
+
avdevice.add("avdevice-56"); // dummy future proof
avdevice.add("avdevice-55"); // ffmpeg 2
avdevice.add("avdevice-54"); // ffmpeg 1.2 / libav 10
avdevice.add("avdevice-53"); // 0.8 && libav 9
libsList.add(avdevice);
-
+
final List avresample = new ArrayList();
avresample.add("avresample"); // default
avresample.add("libavresample.so.2"); // dummy future proof
avresample.add("libavresample.so.1"); // libav 9 + 10
-
+
avresample.add("avresample-2"); // dummy future proof
avresample.add("avresample-1"); // libav 9 + 10
libsList.add(avresample);
@@ -405,11 +405,11 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
swresample.add("libswresample.so.1"); // dummy future proof
swresample.add("libswresample.so.0"); // ffmpeg 1.2 + 2.x
-
+
swresample.add("swresample-1"); // dummy future proof
swresample.add("swresample-0"); // ffmpeg 1.2 + 2.x
libsList.add(swresample);
-
+
return libsList;
}
@@ -431,5 +431,5 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
@Override
public final RunnableExecutor getLibLoaderExecutor() {
return DynamicLibraryBundle.getDefaultRunnableExecutor();
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index f196ebef1..2abd73181 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -65,18 +65,18 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
* Besides the default BSD/Linux/.. repositories and installations,
* precompiled binaries can be found at the
* listed location below.
- *
- *
+ *
+ *
*
- * The decoded video frame is written directly into an OpenGL texture
- * on the GPU in it's native format. A custom fragment shader converts
- * the native pixelformat to a usable RGB format if required.
- * Hence only 1 copy is required before bloating the picture
+ * The decoded video frame is written directly into an OpenGL texture
+ * on the GPU in it's native format. A custom fragment shader converts
+ * the native pixelformat to a usable RGB format if required.
+ * Hence only 1 copy is required before bloating the picture
* from YUV* to RGB, for example.
- *
+ *
*
- * Implements pixel format conversion to RGB via
+ * Implements pixel format conversion to RGB via
* fragment shader texture-lookup functions:
*
- *
+ *
*/
public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
/** POSIX ENOSYS {@value}: Function not implemented. FIXME: Move to GlueGen ?!*/
private static final int ENOSYS = 38;
-
+
// Instance data
private static final FFMPEGNatives natives;
private static final int avUtilMajorVersionCC;
private static final int avFormatMajorVersionCC;
- private static final int avCodecMajorVersionCC;
+ private static final int avCodecMajorVersionCC;
private static final int avResampleMajorVersionCC;
private static final int swResampleMajorVersionCC;
private static final boolean available;
-
+
static {
final boolean libAVGood = FFMPEGDynamicLibraryBundleInfo.initSingleton();
final boolean libAVVersionGood;
@@ -171,7 +171,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
avUtilMajorVersionCC = natives.getAvUtilMajorVersionCC0();
avResampleMajorVersionCC = natives.getAvResampleMajorVersionCC0();
swResampleMajorVersionCC = natives.getSwResampleMajorVersionCC0();
- } else {
+ } else {
avUtilMajorVersionCC = 0;
avFormatMajorVersionCC = 0;
avCodecMajorVersionCC = 0;
@@ -211,25 +211,25 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
available = libAVGood && libAVVersionGood && null != natives;
}
-
+
public static final boolean isAvailable() { return available; }
//
// General
//
-
- private long moviePtr = 0;
-
+
+ private long moviePtr = 0;
+
//
// Video
//
-
+
private String texLookupFuncName = "ffmpegTexture2D";
- private boolean usesTexLookupShader = false;
+ private boolean usesTexLookupShader = false;
private PixelFormat vPixelFmt = null;
private int vPlanes = 0;
private int vBitsPerPixel = 0;
- private int vBytesPerPixelPerPlane = 0;
+ private int vBytesPerPixelPerPlane = 0;
private int texWidth, texHeight; // overall (stuffing planes in one texture)
private String singleTexComp = "r";
private GLPixelStorageModes psm;
@@ -237,10 +237,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
//
// Audio
//
-
+
private AudioSink.AudioFormat avChosenAudioFormat;
private int audioSamplesPerFrameAndChannel = 0;
-
+
public FFMPEGMediaPlayer() {
if(!available) {
throw new RuntimeException("FFMPEGMediaPlayer not available");
@@ -263,14 +263,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
private final void destroyAudioSink() {
final AudioSink _audioSink = audioSink;
- if( null != _audioSink ) {
+ if( null != _audioSink ) {
audioSink = null;
_audioSink.destroy();
}
}
-
+
public static final String dev_video_linux = "/dev/video";
-
+
@Override
protected final void initStreamImpl(int vid, int aid) throws IOException {
if(0==moviePtr) {
@@ -279,7 +279,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
if(DEBUG) {
System.err.println("initStream: p1 "+this);
}
-
+
final String streamLocS=IOUtil.decodeFromURI(streamLoc.toString());
destroyAudioSink();
if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
@@ -291,7 +291,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
if(DEBUG) {
System.err.println("initStream: p2 preferred "+preferredAudioFormat+", "+this);
}
-
+
final boolean isCameraInput = null != cameraPath;
final String resStreamLocS;
// int rw=640, rh=480, rr=15;
@@ -314,7 +314,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
case OPENKODE:
default:
resStreamLocS = streamLocS; // FIXME: ??
- break;
+ break;
}
if( null != cameraProps ) {
sizes = cameraProps.get(CameraPropSizeS);
@@ -362,7 +362,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
if(DEBUG) {
System.err.println("initGL: p3 avChosen "+avChosenAudioFormat);
}
-
+
if( STREAM_ID_NONE == aid ) {
audioSink.destroy();
audioSink = AudioSinkFactory.createNull();
@@ -386,7 +386,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
System.err.println("initGL: p4 chosen "+avChosenAudioFormat);
System.err.println("initGL: p4 chosen "+audioSink);
}
-
+
if( null != gl && STREAM_ID_NONE != vid ) {
int tf, tif=GL.GL_RGBA; // texture format and internal format
int tt = GL.GL_UNSIGNED_BYTE;
@@ -413,9 +413,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
tf = GL2ES2.GL_BGRA; tif=GL.GL_RGBA; break;
} else {
tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break;
- }
+ }
default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane);
- }
+ }
setTextureFormat(tif, tf);
setTextureType(tt);
if(DEBUG) {
@@ -423,12 +423,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
", tex "+texWidth+"x"+texHeight+", usesTexLookupShader "+usesTexLookupShader);
}
}
- }
+ }
@Override
protected final TextureFrame createTexImage(GL gl, int texName) {
return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight) );
}
-
+
/**
* @param sampleRate sample rate in Hz (1/s)
* @param sampleSize sample size in bits
@@ -439,10 +439,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param littleEndian true for little-endian, false for big endian
* @return
*/
-
+
/**
* Native callback
- * Converts the given libav/ffmpeg values to {@link AudioFormat} and returns {@link AudioSink#isSupported(AudioFormat)}.
+ * Converts the given libav/ffmpeg values to {@link AudioFormat} and returns {@link AudioSink#isSupported(AudioFormat)}.
* @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link SampleFormat}.
* @param audioSampleRate sample rate in Hz (1/s)
* @param audioChannels number of channels
@@ -456,9 +456,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
return res;
}
-
+
/**
- * Returns {@link AudioFormat} as converted from the given libav/ffmpeg values.
+ * Returns {@link AudioFormat} as converted from the given libav/ffmpeg values.
* @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link SampleFormat}.
* @param audioSampleRate sample rate in Hz (1/s)
* @param audioChannels number of channels
@@ -506,7 +506,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
return new AudioFormat(audioSampleRate, sampleSize, audioChannels, signed, fixedP, planar, true /* littleEndian */);
}
-
+
/**
* Native callback
* @param vid
@@ -523,9 +523,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param audioChannels
* @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
*/
- void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
+ void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
int tWd0, int tWd1, int tWd2, int vW, int vH,
- int aid, int audioSampleFmt, int audioSampleRate,
+ int aid, int audioSampleFmt, int audioSampleRate,
int audioChannels, int audioSamplesPerFrameAndChannel) {
// defaults ..
vPixelFmt = null;
@@ -534,28 +534,28 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
vBytesPerPixelPerPlane = 0;
usesTexLookupShader = false;
texWidth = 0; texHeight = 0;
-
+
final int[] vTexWidth = { 0, 0, 0 }; // per plane
-
+
if( STREAM_ID_NONE != vid ) {
vPixelFmt = PixelFormat.valueOf(pixFmt);
vPlanes = planes;
vBitsPerPixel = bitsPerPixel;
- vBytesPerPixelPerPlane = bytesPerPixelPerPlane;
+ vBytesPerPixelPerPlane = bytesPerPixelPerPlane;
vTexWidth[0] = tWd0; vTexWidth[1] = tWd1; vTexWidth[2] = tWd2;
-
+
switch(vPixelFmt) {
case YUVJ420P:
case YUV420P: // < planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
usesTexLookupShader = true;
// YUV420P: Adding U+V on right side of fixed height texture,
// since width is already aligned by decoder.
- // Splitting texture to 4 quadrants:
+ // Splitting texture to 4 quadrants:
// Y covers left top/low quadrant
// U on top-right quadrant.
// V on low-right quadrant.
// Y=w*h, U=w/2*h/2, V=w/2*h/2
- // w*h + 2 ( w/2 * h/2 )
+ // w*h + 2 ( w/2 * h/2 )
// w*h + w*h/2
texWidth = vTexWidth[0] + vTexWidth[1]; texHeight = vH;
break;
@@ -573,27 +573,27 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
case YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr - stuffed into RGBA half width texture
case BGR24:
usesTexLookupShader = true;
- texWidth = vTexWidth[0]; texHeight = vH;
+ texWidth = vTexWidth[0]; texHeight = vH;
break;
-
+
case RGB24:
case ARGB:
case RGBA:
case ABGR:
case BGRA:
usesTexLookupShader = false;
- texWidth = vTexWidth[0]; texHeight = vH;
+ texWidth = vTexWidth[0]; texHeight = vH;
break;
default: // FIXME: Add more formats !
throw new RuntimeException("Unsupported pixelformat: "+vPixelFmt);
}
}
-
+
// defaults ..
final SampleFormat aSampleFmt;
avChosenAudioFormat = null;;
this.audioSamplesPerFrameAndChannel = 0;
-
+
if( STREAM_ID_NONE != aid ) {
aSampleFmt = SampleFormat.valueOf(audioSampleFmt);
avChosenAudioFormat = avAudioFormat2Local(aSampleFmt, audioSampleRate, audioChannels);
@@ -601,7 +601,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
} else {
aSampleFmt = null;
}
-
+
if(DEBUG) {
System.err.println("audio: id "+aid+", fmt "+aSampleFmt+", "+avChosenAudioFormat+", aFrameSize/fc "+audioSamplesPerFrameAndChannel);
System.err.println("video: id "+vid+", fmt "+vW+"x"+vH+", "+vPixelFmt+", planes "+vPlanes+", bpp "+vBitsPerPixel+"/"+vBytesPerPixelPerPlane+", usesTexLookupShader "+usesTexLookupShader);
@@ -612,7 +612,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
System.err.println(this.toString());
}
}
-
+
/**
* Native callback
* @param isInGLOrientation
@@ -624,13 +624,13 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
* @param tWd1
* @param tWd2
*/
- void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
+ void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
int tWd0, int tWd1, int tWd2, int vW, int vH) {
}
-
+
/**
* {@inheritDoc}
- *
+ *
* If this implementation generates a specialized shader,
* it allows the user to override the default function name ffmpegTexture2D.
* Otherwise the call is delegated to it's super class.
@@ -646,15 +646,15 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
return texLookupFuncName;
}
- return super.getTextureLookupFunctionName(desiredFuncName);
+ return super.getTextureLookupFunctionName(desiredFuncName);
}
-
+
/**
* {@inheritDoc}
- *
+ *
* Depending on the pixelformat, a specific conversion shader is being created,
- * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.
- */
+ * e.g. YUV420P to RGB. Otherwise the call is delegated to it's super class.
+ */
@Override
public final String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
if(State.Uninitialized == state) {
@@ -685,7 +685,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
" return vec4(r, g, b, 1);\n"+
"}\n"
;
-
+
case YUVJ422P:
case YUV422P: ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
return
@@ -706,7 +706,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
" return vec4(r, g, b, 1);\n"+
"}\n"
;
-
+
case YUYV422: // < packed YUV 4:2:2, 2 x 16bpp, [Y0 Cb] [Y1 Cr]
// Stuffed into RGBA half width texture
return
@@ -740,9 +740,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
default: // FIXME: Add more formats !
throw new InternalError("Add proper mapping of: vPixelFmt "+vPixelFmt+", usesTexLookupShader "+usesTexLookupShader);
- }
+ }
}
-
+
@Override
public final boolean playImpl() {
if(0==moviePtr) {
@@ -754,7 +754,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
}
return true;
}
-
+
@Override
public final boolean pauseImpl() {
if(0==moviePtr) {
@@ -780,12 +780,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
}
-
+
@Override
protected void postNextTextureImpl(GL gl) {
psm.restore(gl);
}
-
+
@Override
protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
if(0==moviePtr) {
@@ -806,14 +806,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
nextFrame.setPTS(vPTS);
}
return vPTS;
- }
-
+ }
+
final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
setFirstAudioPTS2SCR( audio_pts );
if( 1.0f == playSpeed || audioSinkPlaySpeedSet ) {
audioSink.enqueueData( audio_pts, sampleData, data_size);
}
}
-
+
}
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index 8e08c23fa..bc0865aa9 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -30,21 +30,21 @@ package jogamp.opengl.util.av.impl;
import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
interface FFMPEGNatives {
-
+
boolean initSymbols0(long[] symbols, int count);
int getAvUtilMajorVersionCC0();
int getAvFormatMajorVersionCC0();
int getAvCodecMajorVersionCC0();
int getAvResampleMajorVersionCC0();
int getSwResampleMajorVersionCC0();
-
+
long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
void destroyInstance0(long moviePtr);
-
+
/**
* Issues {@link #updateAttributes(int, int, int, int, int, int, int, float, int, int, String, String)}
* and {@link #updateAttributes2(int, int, int, int, int, int, int, int, int, int)}.
- *
+ *
* @param moviePtr
* @param url
* @param vid
@@ -56,25 +56,25 @@ interface FFMPEGNatives {
* @param aPrefSampleRate
* @param aPrefChannelCount
*/
- void setStream0(long moviePtr, String url, boolean isCameraInput,
- int vid, String sizes, int vWidth, int vHeight,
+ void setStream0(long moviePtr, String url, boolean isCameraInput,
+ int vid, String sizes, int vWidth, int vHeight,
int vRate, int aid, int aMaxChannelCount, int aPrefSampleRate);
-
+
void setGLFuncs0(long moviePtr, long procAddrGLTexSubImage2D, long procAddrGLGetError, long procAddrGLFlush, long procAddrGLFinish);
- int getVideoPTS0(long moviePtr);
-
+ int getVideoPTS0(long moviePtr);
+
int getAudioPTS0(long moviePtr);
-
+
/**
* @return resulting current video PTS, or {@link TextureFrame#INVALID_PTS}
*/
int readNextPacket0(long moviePtr, int texTarget, int texFmt, int texType);
-
+
int play0(long moviePtr);
int pause0(long moviePtr);
int seek0(long moviePtr, int position);
-
+
/** FFMPEG/libAV Audio Sample Format */
public static enum SampleFormat {
// NONE = -1,
@@ -89,10 +89,10 @@ interface FFMPEGNatives {
S32P, ///< signed 32 bits, planar
FLTP, ///< float, planar
DBLP, ///< double, planar
-
+
COUNT; ///< Number of sample formats.
-
- /**
+
+ /**
* Returns the matching SampleFormat value corresponding to the given SampleFormat's integer ordinal.
*
* given:
@@ -131,7 +131,7 @@ interface FFMPEGNatives {
/** planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) */
YUV411P,
/** Y, 8bpp */
- GRAY8,
+ GRAY8,
/** Y, 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb */
MONOWHITE,
/** Y, 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb */
@@ -151,57 +151,57 @@ interface FFMPEGNatives {
/** packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 */
UYVY422,
/** packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 */
- UYYVYY411,
+ UYYVYY411,
/** packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) */
- BGR8,
+ BGR8,
/** packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
- BGR4,
+ BGR4,
/** packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) */
- BGR4_BYTE,
+ BGR4_BYTE,
/** packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) */
- RGB8,
+ RGB8,
/** packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
- RGB4,
+ RGB4,
/** packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) */
- RGB4_BYTE,
+ RGB4_BYTE,
/** planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) */
- NV12,
+ NV12,
/** as above, but U and V bytes are swapped */
- NV21,
+ NV21,
/** packed ARGB 8:8:8:8, 32bpp, ARGBARGB... */
- ARGB,
+ ARGB,
/** packed RGBA 8:8:8:8, 32bpp, RGBARGBA... */
- RGBA,
+ RGBA,
/** packed ABGR 8:8:8:8, 32bpp, ABGRABGR... */
- ABGR,
+ ABGR,
/** packed BGRA 8:8:8:8, 32bpp, BGRABGRA... */
- BGRA,
+ BGRA,
/** Y, 16bpp, big-endian */
- GRAY16BE,
+ GRAY16BE,
/** Y , 16bpp, little-endian */
- GRAY16LE,
+ GRAY16LE,
/** planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) */
- YUV440P,
+ YUV440P,
/** planar YUV 4:4:0 full scale (JPEG), deprecated in favor of YUV440P and setting color_range */
- YUVJ440P,
+ YUVJ440P,
/** planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) */
- YUVA420P,
+ YUVA420P,
/** H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
- VDPAU_H264,
+ VDPAU_H264,
/** MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
- VDPAU_MPEG1,
+ VDPAU_MPEG1,
/** MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
- VDPAU_MPEG2,
+ VDPAU_MPEG2,
/** WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
- VDPAU_WMV3,
+ VDPAU_WMV3,
/** VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
- VDPAU_VC1,
+ VDPAU_VC1,
/** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian */
- RGB48BE,
+ RGB48BE,
/** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian */
- RGB48LE,
+ RGB48LE,
RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
@@ -255,7 +255,7 @@ interface FFMPEGNatives {
GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
COUNT ///< number of pixel formats in this list
;
- /**
+ /**
* Returns the matching PixelFormat value corresponding to the given PixelFormat's integer ordinal.
*
* given:
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
index 01c249313..22a045825 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -29,7 +29,7 @@ package jogamp.opengl.util.av.impl;
import com.jogamp.common.util.VersionNumber;
-class FFMPEGStaticNatives {
+class FFMPEGStaticNatives {
static VersionNumber getAVVersion(int vers) {
return new VersionNumber( ( vers >> 16 ) & 0xFF,
( vers >> 8 ) & 0xFF,
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
index 22694888d..4b013c1b3 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv08Natives.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -45,7 +45,7 @@ class FFMPEGv08Natives implements FFMPEGNatives {
@Override
public native int getSwResampleMajorVersionCC0();
-
+
@Override
public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
index 08e19d5e6..d69763287 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv09Natives.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -45,7 +45,7 @@ class FFMPEGv09Natives implements FFMPEGNatives {
@Override
public native int getSwResampleMajorVersionCC0();
-
+
@Override
public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
index 0081743fa..0b5f70d7c 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGv10Natives.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -45,7 +45,7 @@ class FFMPEGv10Natives implements FFMPEGNatives {
@Override
public native int getSwResampleMajorVersionCC0();
-
+
@Override
public native long createInstance0(FFMPEGMediaPlayer upstream, boolean verbose);
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index a5a701a4f..24198703a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -3,14 +3,14 @@
*
* 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
@@ -20,7 +20,7 @@
* 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.
@@ -45,19 +45,19 @@ import jogamp.opengl.util.av.EGLMediaPlayerImpl;
*/
public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
static final boolean available;
-
+
static {
available = false;
/** FIXME!
- // OMX binding is included in jogl_desktop and jogl_mobile
+ // OMX binding is included in jogl_desktop and jogl_mobile
GLProfile.initSingleton();
available = initIDs0(); */
}
-
+
public static final boolean isAvailable() { return available; }
-
+
protected long moviePtr = 0;
-
+
public OMXGLMediaPlayer() {
super(TextureType.KHRImage, true);
if(!available) {
@@ -70,21 +70,21 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
moviePtr = _createInstance();
if(0==moviePtr) {
throw new GLException("Couldn't create OMXInstance");
- }
+ }
}
-
+
@Override
protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, texName);
_setStreamEGLImageTexture2D(moviePtr, texName, eglTex.getImage(), eglTex.getSync());
return eglTex;
}
-
+
@Override
protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
- super.destroyTexFrame(gl, imgTex);
+ super.destroyTexFrame(gl, imgTex);
}
-
+
@Override
protected void destroyImpl(GL gl) {
if (moviePtr != 0) {
@@ -94,20 +94,20 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
moviePtr = 0;
}
}
-
+
@Override
protected void initStreamImpl(int vid, int aid) throws IOException {
if(0==moviePtr) {
throw new GLException("OMX native instance null");
}
if(!streamLoc.getScheme().equals("file")) {
- throw new IOException("Only file schemes are allowed: "+streamLoc);
+ throw new IOException("Only file schemes are allowed: "+streamLoc);
}
final String path=streamLoc.getPath();
if(DEBUG) {
System.out.println("initGLStream: clean path "+path);
}
-
+
if(DEBUG) {
System.out.println("initGLStream: p1 "+this);
}
@@ -121,7 +121,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
// NOP
isInGLOrientation = true;
}
-
+
@Override
protected int getAudioPTSImpl() {
return 0!=moviePtr ? _getCurrentPosition(moviePtr) : 0;
@@ -172,8 +172,8 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
final int nextTex = _getNextTextureID(moviePtr, true);
if(0 < nextTex) {
// FIXME set pts !
- /* FIXME
- final TextureSequence.TextureFrame eglImgTex =
+ /* FIXME
+ final TextureSequence.TextureFrame eglImgTex =
texFrameMap.get(new Integer(_getNextTextureID(moviePtr, blocking)));
if(null!=eglImgTex) {
lastTex = eglImgTex;
@@ -181,7 +181,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
return 0; // FIXME: return pts
}
-
+
private String replaceAll(String orig, String search, String repl) {
String dest=null;
// In case replaceAll / java.util.regex.* is not supported (-> CVM)
@@ -203,14 +203,14 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
}
private static native boolean initIDs0();
- private native long _createInstance();
+ private native long _createInstance();
private native void _destroyInstance(long moviePtr);
-
+
private native void _detachVideoRenderer(long moviePtr); // stop before
private native void _attachVideoRenderer(long moviePtr); // detach before
private native void _setStream(long moviePtr, int textureNum, String path);
private native void _activateStream(long moviePtr);
-
+
private native void _setStreamEGLImageTexture2D(long moviePtr, int tex, long image, long sync);
private native int _seek(long moviePtr, int position);
private native void _setPlaySpeed(long moviePtr, float rate);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index 3c468f358..2d74fa532 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -41,23 +41,23 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
import com.jogamp.opengl.util.glsl.ShaderState;
/**
- * Used for 1:1 GLSL arrays, i.e. where the buffer data
- * represents this array only.
+ * Used for 1:1 GLSL arrays, i.e. where the buffer data
+ * represents this array only.
*/
-public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
-
+public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandler {
+
public GLSLArrayHandler(GLArrayDataEditable ad) {
super(ad);
}
-
+
public final void setSubArrayVBOName(int vboName) {
throw new UnsupportedOperationException();
}
-
+
public final void addSubHandler(GLArrayHandlerFlat handler) {
throw new UnsupportedOperationException();
}
-
+
public final void enableState(GL gl, boolean enable, Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
@@ -66,12 +66,12 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
enableSimple(glsl, enable);
}
}
-
+
private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) {
if(enable) {
/*
* This would be the non optimized code path:
- *
+ *
if(ad.isVBO()) {
glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
if(!ad.isVBOWritten()) {
@@ -108,13 +108,13 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
} else if(null!=buffer) {
st.vertexAttribPointer(glsl, ad);
}
-
+
st.enableVertexAttribArray(glsl, ad);
} else {
st.disableVertexAttribArray(glsl, ad);
}
}
-
+
private final void enableSimple(GL2ES2 glsl, boolean enable) {
final int location = ad.getLocation();
if( 0 > location ) {
@@ -123,7 +123,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
if(enable) {
/*
* This would be the non optimized code path:
- *
+ *
if(ad.isVBO()) {
glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
if(!ad.isVBOWritten()) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
index 855406db3..a5f78b5d6 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
@@ -37,7 +37,7 @@ import com.jogamp.opengl.util.GLArrayDataWrapper;
import com.jogamp.opengl.util.glsl.ShaderState;
/**
- * Used for interleaved GLSL arrays, i.e. where the buffer data itself is handled
+ * Used for interleaved GLSL arrays, i.e. where the buffer data itself is handled
* separately and interleaves many arrays.
*/
public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
@@ -50,7 +50,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
public GLArrayDataWrapper getData() {
return ad;
}
-
+
public final void syncData(GL gl, Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
@@ -62,7 +62,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
}
/**
* Due to probable application VBO switching, this might not make any sense ..
- *
+ *
if(!written) {
st.vertexAttribPointer(glsl, ad);
} else if(st.getAttribLocation(glsl, ad) >= 0) {
@@ -94,7 +94,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
} else {
glsl.glDisableVertexAttribArray(location);
}
- }
+ }
}
- }
+ }
}
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index c2048d652..bcc146d78 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -40,8 +40,8 @@ import jogamp.opengl.util.GLVBOArrayHandler;
import com.jogamp.opengl.util.GLArrayDataEditable;
/**
- * Interleaved fixed function arrays, i.e. where this buffer data
- * represents many arrays.
+ * Interleaved fixed function arrays, i.e. where this buffer data
+ * represents many arrays.
*/
public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLArrayHandler {
private List subArrays = new ArrayList();
@@ -49,13 +49,13 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) {
super(ad);
}
-
+
public final void setSubArrayVBOName(int vboName) {
for(int i=0; i shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
String vertexColorFile, String vertexColorLightFile,
String fragmentColorFile, String fragmentColorTextureFile) {
@@ -90,14 +90,14 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
this.pmvMatrix = new PMVMatrix();
}
- fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot,
+ fixedFunction = new FixedFuncPipeline(this.gl, mode, this.pmvMatrix, shaderRootClass, shaderSrcRoot,
shaderBinRoot, vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
}
public boolean verbose() { return fixedFunction.verbose(); }
public void setVerbose(boolean v) { fixedFunction.setVerbose(v); }
-
+
public void destroy() {
fixedFunction.destroy(gl);
fixedFunction = null;
@@ -111,16 +111,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
public PMVMatrix getMatrix() { return pmvMatrix; }
//
- // FixedFuncHookIf - hooks
+ // FixedFuncHookIf - hooks
//
public void glDrawArrays(int mode, int first, int count) {
fixedFunction.glDrawArrays(gl, mode, first, count);
}
public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
- fixedFunction.glDrawElements(gl, mode, count, type, indices);
+ fixedFunction.glDrawElements(gl, mode, count, type, indices);
}
public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
- fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset);
+ fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset);
}
public void glActiveTexture(int texture) {
@@ -136,7 +136,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
if(fixedFunction.glEnable(cap, false)) {
gl.glDisable(cap);
}
- }
+ }
public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
if(PMVMatrix.isMatrixGetName(pname)) {
pmvMatrix.glGetFloatv(pname, params);
@@ -165,7 +165,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
gl.glGetIntegerv(pname, params, params_offset);
}
-
+
public void glTexEnvi(int target, int pname, int value) {
fixedFunction.glTexEnvi(target, pname, value);
}
@@ -179,7 +179,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glBindTexture(target, texture);
gl.glBindTexture(target, texture);
}
- public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
+ public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
int format, int type, Buffer pixels) {
// align internalformat w/ format, an ES2 requirement
switch(internalformat) {
@@ -212,8 +212,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
public void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
fixedFunction.glPointParameterfv(pname, params);
}
-
- //
+
+ //
// MatrixIf
//
public int glGetMatrixMode() {
@@ -253,29 +253,29 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
pmvMatrix.glScalef(x, y, z);
}
public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) {
- glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val);
+ glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val);
}
public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
}
public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) {
- glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar);
+ glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar);
}
public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
}
- //
+ //
// LightingIf
//
public void glColor4f(float red, float green, float blue, float alpha) {
fixedFunction.glColor4f(gl, red, green, blue, alpha);
}
-
+
public void glColor4ub(byte red, byte green, byte blue, byte alpha) {
- glColor4f(ValueConv.byte_to_float(red, false),
- ValueConv.byte_to_float(green, false),
- ValueConv.byte_to_float(blue, false),
+ glColor4f(ValueConv.byte_to_float(red, false),
+ ValueConv.byte_to_float(green, false),
+ ValueConv.byte_to_float(blue, false),
ValueConv.byte_to_float(alpha, false) );
}
public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
@@ -299,17 +299,17 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
//
public void glShadeModel(int mode) {
fixedFunction.glShadeModel(gl, mode);
- }
+ }
public void glAlphaFunc(int func, float ref) {
fixedFunction.glAlphaFunc(func, ref);
}
-
- /** ES2 supports CullFace implicit
+
+ /** ES2 supports CullFace implicit
public void glCullFace(int faceName) {
fixedFunction.glCullFace(faceName);
gl.glCullFace(faceName);
} */
-
+
//
// PointerIf
//
@@ -340,7 +340,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
- glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
@@ -348,7 +348,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
- glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
}
@@ -368,7 +368,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glColorPointer(gl, array);
}
public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
- glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
@@ -376,7 +376,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
- glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
}
@@ -399,7 +399,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
fixedFunction.glNormalPointer(gl, array);
}
public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
- glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
@@ -407,7 +407,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
if(vboName==0) {
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
- glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER));
}
@@ -428,7 +428,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
}
public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
glTexCoordPointer(
- GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
}
public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
@@ -437,7 +437,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
throw new GLException("no GL_ARRAY_BUFFER VBO bound");
}
glTexCoordPointer(
- GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
+ GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
null, vboName, pointer_buffer_offset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER) );
}
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index 5349745ea..187fdb309 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -59,25 +59,25 @@ import com.jogamp.opengl.util.glsl.ShaderState;
import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode;
/**
- *
+ *
*
- * Note: Certain GL FFP state values (e.g.: alphaTestFunc and cullFace)
- * are mapped to a lower number range so they can be stored in low precision storage,
+ * Note: Certain GL FFP state values (e.g.: alphaTestFunc and cullFace)
+ * are mapped to a lower number range so they can be stored in low precision storage,
* i.e. in a 'lowp int' (GL ES2).
*
*/
public class FixedFuncPipeline {
protected static final boolean DEBUG;
-
+
static {
Debug.initSingleton();
DEBUG = Debug.isPropertyDefined("jogl.debug.FixedFuncPipeline", true);
}
-
+
/** The maximum texture units which could be used, depending on {@link ShaderSelectionMode}. */
public static final int MAX_TEXTURE_UNITS = 8;
public static final int MAX_LIGHTS = 8;
-
+
public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
shaderRootClass = FixedFuncPipeline.class;
shaderSrcRoot = shaderSrcRootDef;
@@ -88,8 +88,8 @@ public class FixedFuncPipeline {
fragmentColorTextureFile = fragmentColorTextureFileDef;
init(gl, mode, pmvMatrix);
}
- public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
- Class> shaderRootClass, String shaderSrcRoot,
+ public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
+ Class> shaderRootClass, String shaderSrcRoot,
String shaderBinRoot,
String vertexColorFile, String vertexColorLightFile,
String fragmentColorFile, String fragmentColorTextureFile) {
@@ -100,9 +100,9 @@ public class FixedFuncPipeline {
this.vertexColorLightFile = vertexColorLightFile;
this.fragmentColorFile = fragmentColorFile;
this.fragmentColorTextureFile = fragmentColorTextureFile;
- init(gl, mode, pmvMatrix);
+ init(gl, mode, pmvMatrix);
}
-
+
public ShaderSelectionMode getShaderSelectionMode() { return requestedShaderSelectionMode; }
public void setShaderSelectionMode(ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; }
public ShaderSelectionMode getCurrentShaderSelectionMode() { return currentShaderSelectionMode; }
@@ -153,21 +153,21 @@ public class FixedFuncPipeline {
colorStatic.put(1, green);
colorStatic.put(2, blue);
colorStatic.put(3, alpha);
-
+
shaderState.useProgram(gl, true);
- final GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
+ final GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
if(null!=ud) {
// same data object ..
shaderState.uniform(gl, ud);
} else {
throw new GLException("Failed to update: mgl_ColorStatic");
- }
+ }
}
-
+
//
// Arrays / States
//
-
+
public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
glToggleClientState(gl, glArrayIndex, true);
}
@@ -202,7 +202,7 @@ public class FixedFuncPipeline {
break;
}
}
-
+
public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
shaderState.useProgram(gl, true);
shaderState.vertexAttribPointer(gl, data);
@@ -217,14 +217,14 @@ public class FixedFuncPipeline {
shaderState.useProgram(gl, true);
shaderState.vertexAttribPointer(gl, data);
}
-
+
//
// MULTI-TEXTURE
//
/** Enables/Disables the named texture unit (if changed), returns previous state */
private boolean glEnableTexture(boolean enable, int unit) {
- final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) );
+ final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) );
if( isEnabled != enable ) {
if(enable) {
textureEnabledBits |= ( 1 << unit );
@@ -237,7 +237,7 @@ public class FixedFuncPipeline {
}
return isEnabled;
}
-
+
public void glClientActiveTexture(int textureUnit) {
textureUnit -= GL.GL_TEXTURE0;
if(0 <= textureUnit && textureUnit "+toHexString(ifmt));
}
} else {
- System.err.println("FixedFuncPipeline: Unimplemented glTexImage2D: target "+toHexString(target)+", internalformat "+toHexString(internalformat));
+ System.err.println("FixedFuncPipeline: Unimplemented glTexImage2D: target "+toHexString(target)+", internalformat "+toHexString(internalformat));
}
}
/*
public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
- int format, int type, long pixels_buffer_offset) {
+ int format, int type, long pixels_buffer_offset) {
textureFormat.put(activeTextureUnit, internalformat);
textureFormatDirty = true;
}*/
-
+
public void glTexEnvi(int target, int pname, int value) {
if(GL2ES1.GL_TEXTURE_ENV == target && GL2ES1.GL_TEXTURE_ENV_MODE == pname) {
final int mode;
@@ -351,7 +351,7 @@ public class FixedFuncPipeline {
if( value != textureEnvMode.get(activeTextureUnit) ) {
textureEnvMode.put(activeTextureUnit, value);
textureEnvModeDirty = true;
- }
+ }
}
public void glGetTexEnviv(int target, int pname, IntBuffer params) { // FIXME
System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
@@ -359,13 +359,13 @@ public class FixedFuncPipeline {
public void glGetTexEnviv(int target, int pname, int[] params, int params_offset) { // FIXME
System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
}
-
+
//
// Point Sprites
//
public void glPointSize(float size) {
pointParams.put(0, size);
- pointParamsDirty = true;
+ pointParamsDirty = true;
}
public void glPointParameterf(int pname, float param) {
switch(pname) {
@@ -379,7 +379,7 @@ public class FixedFuncPipeline {
pointParams.put(4+3, param);
break;
}
- pointParamsDirty = true;
+ pointParamsDirty = true;
}
public void glPointParameterfv(int pname, float[] params, int params_offset) {
switch(pname) {
@@ -389,7 +389,7 @@ public class FixedFuncPipeline {
pointParams.put(4+2, params[params_offset + 2]);
break;
}
- pointParamsDirty = true;
+ pointParamsDirty = true;
}
public void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
final int o = params.position();
@@ -400,24 +400,24 @@ public class FixedFuncPipeline {
pointParams.put(4+2, params.get(o + 2));
break;
}
- pointParamsDirty = true;
+ pointParamsDirty = true;
}
// private int[] pointTexObj = new int[] { 0 };
-
+
private void glDrawPoints(GL2ES2 gl, GLRunnable2
*
*/
+ @Override
public final boolean shallLinkGlobal() { return true; }
/**
diff --git a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
index a22454d60..f175acf28 100644
--- a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
@@ -127,6 +127,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
}
+ @Override
public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
}
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 2238d49bc..6de92f533 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -52,6 +52,7 @@ public class GLRunnableTask implements GLRunnable {
isFlushed = false;
}
+ @Override
public boolean run(GLAutoDrawable drawable) {
boolean res = true;
if(null == notifyObject) {
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 979c6dc0a..100b46a5e 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -222,6 +222,7 @@ public class GLWorkerThread {
protected static String getThreadName() { return Thread.currentThread().getName(); }
static class WorkerRunnable implements Runnable {
+ @Override
public void run() {
// Notify starting thread that we're ready
synchronized (lock) {
diff --git a/src/jogl/classes/jogamp/opengl/MemoryObject.java b/src/jogl/classes/jogamp/opengl/MemoryObject.java
index df793dadd..d10747690 100644
--- a/src/jogl/classes/jogamp/opengl/MemoryObject.java
+++ b/src/jogl/classes/jogamp/opengl/MemoryObject.java
@@ -59,10 +59,12 @@ public class MemoryObject {
/**
* @return the 32bit hash value generated via {@link HashUtil#getAddrSizeHash32_EqualDist(long, long)}.
*/
+ @Override
public int hashCode() {
return hash;
}
+ @Override
public String toString() {
return "MemoryObject[addr 0x"+Long.toHexString(addr)+", size 0x"+Long.toHexString(size)+", hash32: 0x"+Integer.toHexString(hash)+"]";
}
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index eddb36975..283ecdb9d 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -252,6 +252,7 @@ public class SharedResourceRunner implements Runnable {
// done
}
+ @Override
public final void run() {
final String threadName = getThreadName();
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index 6ffe46b36..bf700d970 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -72,6 +72,7 @@ public class ThreadingImpl {
static {
threadingPlugin =
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public ToolkitThreadingPlugin run() {
final String singleThreadProp;
{
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index cd1bb45c9..72c9ac54b 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -54,10 +54,12 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
public AWTThreadingPlugin() {}
+ @Override
public final boolean isToolkitThread() throws GLException {
return EventQueue.isDispatchThread();
}
+ @Override
public final boolean isOpenGLThread() throws GLException {
switch (ThreadingImpl.getMode()) {
case ST_AWT:
@@ -83,6 +85,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
}
}
+ @Override
public final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
switch (ThreadingImpl.getMode()) {
case ST_AWT:
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 5faee1307..ff07b04d0 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -147,6 +147,7 @@ public class AWTTilePainter {
this.flipVertical = true;
}
+ @Override
public String toString() { return renderer.toString(); }
public void setIsGLOriented(boolean v) {
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index 7a8ddf0b4..886cd9368 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -116,6 +116,7 @@ public class Java2D {
static {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
if (DEBUG) {
System.err.println("Checking for Java2D/OpenGL support");
@@ -565,6 +566,7 @@ public class Java2D {
private static int getOGLUtilitiesIntField(final String name) {
Integer i = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Integer run() {
try {
Class> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
@@ -608,6 +610,7 @@ public class Java2D {
System.err.println("Starting initialization of J2D FBO share context");
}
invokeWithOGLSharedContextCurrent(device.getDefaultConfiguration(), new Runnable() {
+ @Override
public void run() {
j2dFBOShareContext = GLDrawableFactory.getFactory(GLProfile.getDefault(GLProfile.getDefaultDevice())).createExternalGLContext();
}
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index a29d1e6aa..9173a38cb 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -54,6 +54,7 @@ public class VersionApplet extends Applet {
this.f = f;
this.va = va;
}
+ @Override
public void windowClosing(WindowEvent ev) {
f.setVisible(false);
va.stop();
@@ -129,24 +130,28 @@ public class VersionApplet extends Applet {
}
}
+ @Override
public void init() {
System.err.println("VersionApplet: init() - begin");
my_init();
System.err.println("VersionApplet: init() - end");
}
+ @Override
public void start() {
System.err.println("VersionApplet: start() - begin");
canvas.setVisible(true);
System.err.println("VersionApplet: start() - end");
}
+ @Override
public void stop() {
System.err.println("VersionApplet: stop() - begin");
canvas.setVisible(false);
System.err.println("VersionApplet: stop() - end");
}
+ @Override
public void destroy() {
System.err.println("VersionApplet: destroy() - start");
my_release();
@@ -154,6 +159,7 @@ public class VersionApplet extends Applet {
}
class GLInfo implements GLEventListener {
+ @Override
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
String s = JoglVersion.getGLInfo(gl, null).toString();
@@ -161,12 +167,15 @@ public class VersionApplet extends Applet {
tareaVersion.append(s);
}
+ @Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
}
+ @Override
public void display(GLAutoDrawable drawable) {
}
+ @Override
public void dispose(GLAutoDrawable drawable) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 1179e2b7f..7b85c3e75 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -47,20 +47,24 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
super();
}
+ @Override
public final List getToolGetProcAddressFuncNameList() {
List res = new ArrayList();
res.add("eglGetProcAddress");
return res;
}
+ @Override
public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
}
+ @Override
public final boolean useToolGetProcAdressFirst(String funcName) {
return true;
}
+ @Override
public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
final List libsGL = new ArrayList();
@@ -90,6 +94,7 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
return libsList;
}
+ @Override
public final List getGlueLibNames() {
return glueLibNames;
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index 89f34432d..3d864ad76 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -65,6 +65,7 @@ public class EGLDisplayUtil {
this.createdStack = DEBUG ? new Throwable() : null;
}
+ @Override
public String toString() {
return "EGLDisplay[0x"+Long.toHexString(eglDisplay)+": refCnt "+refCount+"]";
}
@@ -248,9 +249,11 @@ public class EGLDisplayUtil {
}
public static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
+ @Override
public long eglGetAndInitDisplay(long[] nativeDisplayID) {
return eglGetDisplayAndInitialize(nativeDisplayID);
}
+ @Override
public void eglTerminate(long eglDisplayHandle) {
EGLDisplayUtil.eglTerminate(eglDisplayHandle);
}
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index bf269c548..ab28fb3fb 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -115,6 +115,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
}
}
+ @Override
protected void destroyHandle() {
final EGLWrappedSurface eglws = (EGLWrappedSurface) surface;
if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
index 9ffcea864..361ec26ff 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES1DynamicLibraryBundleInfo.java
@@ -35,6 +35,7 @@ public final class EGLES1DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
super();
}
+ @Override
public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
{
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
index de1f0a42e..74738463f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLES2DynamicLibraryBundleInfo.java
@@ -40,6 +40,7 @@ public final class EGLES2DynamicLibraryBundleInfo extends EGLDynamicLibraryBundl
super();
}
+ @Override
public final List> getToolLibNames() {
final List> libsList = new ArrayList>();
{
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index 5764a6178..31fa14fbb 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -115,6 +115,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
private EGLGraphicsConfigurationFactory() {
}
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl (
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
index 5083c854f..dac058dc7 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
@@ -44,6 +44,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
static String getThreadName() { return Thread.currentThread().getName(); }
+ @Override
public final void setSize(int width, int height) {
if(null != upstreamSurfaceHookMutableSize) {
upstreamSurfaceHookMutableSize.setSize(width, height);
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index b4383c2e6..717b1255c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -164,6 +164,7 @@ public class GLUquadricImpl implements GLUquadric {
replaceImmModeSink();
}
+ @Override
public void enableImmModeSink(boolean val) {
if(gl.isGL2()) {
immModeSinkEnabled=val;
@@ -175,10 +176,12 @@ public class GLUquadricImpl implements GLUquadric {
}
}
+ @Override
public boolean isImmModeSinkEnabled() {
return immModeSinkEnabled;
}
+ @Override
public void setImmMode(boolean val) {
if(immModeSinkEnabled) {
immModeSinkImmediate=val;
@@ -187,10 +190,12 @@ public class GLUquadricImpl implements GLUquadric {
}
}
+ @Override
public boolean getImmMode() {
return immModeSinkImmediate;
}
+ @Override
public ImmModeSink replaceImmModeSink() {
if(!immModeSinkEnabled) return null;
@@ -222,6 +227,7 @@ public class GLUquadricImpl implements GLUquadric {
return res;
}
+ @Override
public void resetImmModeSink(GL gl) {
if(immModeSinkEnabled) {
immModeSink.reset(gl);
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index f57c2310f..4213dfd46 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -92,6 +92,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
/**
* Pushes eval bit
*/
+ @Override
public void bgnmap1f() {
// DONE
if (output_triangles) {
@@ -108,6 +109,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
/**
* Pops all OpenGL attributes
*/
+ @Override
public void endmap1f() {
// DONE
if (output_triangles) {
@@ -127,6 +129,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param order curve order
* @param ps control points
*/
+ @Override
public void map1f(int type, float ulo, float uhi, int stride, int order,
CArrayOfFloats ps) {
if (output_triangles) {
@@ -153,6 +156,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* Calls opengl enable
* @param type what to enable
*/
+ @Override
public void enable(int type) {
// DONE
gl.glEnable(type);
@@ -164,6 +168,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param u1 low u
* @param u2 high u
*/
+ @Override
public void mapgrid1f(int nu, float u1, float u2) {
if (output_triangles) {
// System.out.println("TODO curveevaluator.mapgrid1f");
@@ -179,6 +184,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
* @param from lowest param
* @param to highest param
*/
+ @Override
public void mapmesh1f(int style, int from, int to) {
/* //DEBUG drawing control points
this.poradi++;
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
index 155c4f9a9..e9c9fca3f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -72,6 +72,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
/**
* Pushes eval bit
*/
+ @Override
public void bgnmap2f() {
if (output_triangles) {
@@ -88,6 +89,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* Sets glPolygonMode
* @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
*/
+ @Override
public void polymode(int style) {
if (!output_triangles) {
switch (style) {
@@ -109,6 +111,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
/**
* Pops all attributes
*/
+ @Override
public void endmap2f() {
// TODO Auto-generated method stub
if (output_triangles) {
@@ -126,6 +129,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param vlo
* @param vhi
*/
+ @Override
public void domain2f(float ulo, float uhi, float vlo, float vhi) {
// DONE
}
@@ -139,6 +143,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param v0 lowest v
* @param v1 highest v
*/
+ @Override
public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
if (output_triangles) {
@@ -157,6 +162,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param vmin minimum V
* @param vmax maximum V
*/
+ @Override
public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
if (output_triangles) {
// System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
@@ -195,6 +201,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* @param vorder surface order in v direction
* @param pts control points
*/
+ @Override
public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
// TODO Auto-generated method stub
@@ -210,6 +217,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
* Calls opengl enable
* @param type what to enable
*/
+ @Override
public void enable(int type) {
//DONE
gl.glEnable(type);
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 5269024b4..0c155ff96 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -56,6 +56,7 @@ public class Extract1010102 implements Extract {
public Extract1010102() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
@@ -76,6 +77,7 @@ public class Extract1010102 implements Extract {
extractComponents[3] = (float)( ( uint & 0x00000003 ) ) / 3.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 6982931d3..5208ea537 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -56,6 +56,7 @@ public class Extract1555rev implements Extract {
public Extract1555rev() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
@@ -76,6 +77,7 @@ public class Extract1555rev implements Extract {
extractComponents[3] = (float)( ( ushort & 0x8000 ) >> 15);
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 00000000,00011111 == 0x001F
// 00000011,11100000 == 0x03E0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 1c7db6218..1bf8abcc3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -56,6 +56,7 @@ public class Extract2101010rev implements Extract {
public Extract2101010rev() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
@@ -76,6 +77,7 @@ public class Extract2101010rev implements Extract {
extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index 672c86c32..c86b39e63 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -56,6 +56,7 @@ public class Extract233rev implements Extract {
public Extract233rev() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
@@ -66,6 +67,7 @@ public class Extract233rev implements Extract {
extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 6cdbc5cb0..706f0c3f2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -56,6 +56,7 @@ public class Extract332 implements Extract {
public Extract332() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
// 11100000 == 0xe0
// 00011100 == 0x1c
@@ -66,6 +67,7 @@ public class Extract332 implements Extract {
extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11100000 == 0xE0
// 00011100 == 0x1C
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index b36b9fb82..182d66ce2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -56,6 +56,7 @@ public class Extract4444 implements Extract {
public Extract4444() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
@@ -76,6 +77,7 @@ public class Extract4444 implements Extract {
extractComponents[3] = (float)( ( ushort & 0x000F ) ) / 15.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index b7a3ed55f..52ecdc17c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -56,6 +56,7 @@ public class Extract4444rev implements Extract {
public Extract4444rev() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
@@ -76,6 +77,7 @@ public class Extract4444rev implements Extract {
extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 4dc566b25..21f53aa1d 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -56,6 +56,7 @@ public class Extract5551 implements Extract {
public Extract5551() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
@@ -76,6 +77,7 @@ public class Extract5551 implements Extract {
extractComponents[3] = (float)( ( ushort & 0xF000 ) );
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index e198e46d4..7408c45b2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -56,6 +56,7 @@ public class Extract565 implements Extract {
public Extract565() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
@@ -74,6 +75,7 @@ public class Extract565 implements Extract {
extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11111000,00000000 == 0xF800
// 00000111,11100000 == 0x07E0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index fe19540ee..adaafa7ea 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -56,6 +56,7 @@ public class Extract565rev implements Extract {
public Extract565rev() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
int ushort = 0;
@@ -74,6 +75,7 @@ public class Extract565rev implements Extract {
extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 00000000,00111111 == 0x001F
// 00000111,11100000 == 0x07E0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index 4602f2af9..be155d578 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -56,6 +56,7 @@ public class Extract8888 implements Extract {
public Extract8888() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
@@ -76,6 +77,7 @@ public class Extract8888 implements Extract {
extractComponents[3] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 373cb102a..294e60e12 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -56,6 +56,7 @@ public class Extract8888rev implements Extract {
public Extract8888rev() {
}
+ @Override
public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
long uint = 0;
@@ -76,6 +77,7 @@ public class Extract8888rev implements Extract {
extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
}
+ @Override
public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
// 11110000,00000000 == 0xF000
// 00001111,00000000 == 0x0F00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index ac0f2f290..1dd8bff8a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -56,6 +56,7 @@ public class ExtractFloat implements ExtractPrimitive {
public ExtractFloat() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer data ) {
float f = 0;
if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractFloat implements ExtractPrimitive {
return( f );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 1.0);
data.asFloatBuffer().put( index, (float)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index 399386e30..dcbe52a40 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -56,12 +56,14 @@ public class ExtractSByte implements ExtractPrimitive {
public ExtractSByte() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer sbyte ) {
byte b = sbyte.get();
assert( b <= 127 );
return( b );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
data.position( index );
data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index be3fb3092..547bd944a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -56,6 +56,7 @@ public class ExtractSInt implements ExtractPrimitive {
public ExtractSInt() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer uint ) {
int i = 0;
if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractSInt implements ExtractPrimitive {
return( i );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < Integer.MAX_VALUE);
IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 1e123c9b4..7dc172976 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -56,6 +56,7 @@ public class ExtractSShort implements ExtractPrimitive {
public ExtractSShort() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer ushort ) {
short s = 0;
if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractSShort implements ExtractPrimitive {
return( s );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 32768.0);
ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 26ca5cd40..3e933811c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -56,12 +56,14 @@ public class ExtractUByte implements ExtractPrimitive {
public ExtractUByte() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer ubyte ) {
int i = 0x000000FF & ubyte.get();
assert( i <= 255 );
return( i );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 256.0);
data.position( index );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index 8c94c89fc..1c34828b3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -56,6 +56,7 @@ public class ExtractUInt implements ExtractPrimitive {
public ExtractUInt() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer uint ) {
long i = 0;
if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractUInt implements ExtractPrimitive {
return( i );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 0xFFFFFFFF);
IntBuffer ib = data.asIntBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 55115c6f7..8e0d25c42 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -56,6 +56,7 @@ public class ExtractUShort implements ExtractPrimitive {
public ExtractUShort() {
}
+ @Override
public double extract( boolean isSwap, ByteBuffer ushort ) {
int i = 0;
if( isSwap ) {
@@ -67,6 +68,7 @@ public class ExtractUShort implements ExtractPrimitive {
return( i );
}
+ @Override
public void shove( double value, int index, ByteBuffer data ) {
assert(0.0 <= value && value < 65536.0);
ShortBuffer sb = data.asShortBuffer();
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
index 474056cc3..1ac0fd438 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -81,6 +81,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqHeapDeletePriorityQ */
+ @Override
void pqDeletePriorityQ() {
handles = null;
nodes = null;
@@ -137,6 +138,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqHeapInit */
+ @Override
boolean pqInit() {
int i;
@@ -152,6 +154,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqHeapInsert */
/* returns LONG_MAX iff out of memory */
+ @Override
int pqInsert(Object keyNew) {
int curr;
int free;
@@ -207,6 +210,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqHeapExtractMin */
+ @Override
Object pqExtractMin() {
jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
@@ -229,6 +233,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqHeapDelete */
+ @Override
void pqDelete(int hCurr) {
jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
@@ -252,10 +257,12 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
freeList = hCurr;
}
+ @Override
Object pqMinimum() {
return handles[nodes[1].handle].key;
}
+ @Override
boolean pqIsEmpty() {
return size == 0;
}
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
index f9e0225e3..cf54b15c3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -71,6 +71,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqSortDeletePriorityQ */
+ @Override
void pqDeletePriorityQ() {
if (heap != null) heap.pqDeletePriorityQ();
order = null;
@@ -100,6 +101,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqSortInit */
+ @Override
boolean pqInit() {
int p, r, i, j;
int piv;
@@ -191,6 +193,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
/* really __gl_pqSortInsert */
/* returns LONG_MAX iff out of memory */
+ @Override
int pqInsert(Object keyNew) {
int curr;
@@ -220,6 +223,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqSortExtractMin */
+ @Override
Object pqExtractMin() {
Object sortMin, heapMin;
@@ -240,6 +244,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqSortMinimum */
+ @Override
Object pqMinimum() {
Object sortMin, heapMin;
@@ -257,11 +262,13 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
}
/* really __gl_pqSortIsEmpty */
+ @Override
boolean pqIsEmpty() {
return (size == 0) && heap.pqIsEmpty();
}
/* really __gl_pqSortDelete */
+ @Override
void pqDelete(int curr) {
if (curr >= 0) {
heap.pqDelete(curr);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
index 1801e1c59..a2e973508 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -279,6 +279,7 @@ class Render {
}
private static class RenderTriangle implements renderCallBack {
+ @Override
public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Just add the triangle to a triangle list, so we can render all
* the separate triangles at once.
@@ -323,6 +324,7 @@ class Render {
}
private static class RenderFan implements renderCallBack {
+ @Override
public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Render as many CCW triangles as possible in a fan starting from
* edge "e". The fan *should* contain exactly "size" triangles
@@ -345,6 +347,7 @@ class Render {
}
private static class RenderStrip implements renderCallBack {
+ @Override
public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
/* Render as many CCW triangles as possible in a strip starting from
* edge "e". The strip *should* contain exactly "size" triangles
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
index b4a400c1c..364a7f198 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -1150,6 +1150,7 @@ class Sweep {
*/ {
/* __gl_dictListNewDict */
tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
+ @Override
public boolean leq(Object frame, Object key1, Object key2) {
return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
}
@@ -1231,6 +1232,7 @@ class Sweep {
/* __gl_pqSortNewPriorityQ */
pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
+ @Override
public boolean leq(Object key1, Object key2) {
return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 5cc4003fe..03aae3f78 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -822,6 +822,7 @@ public class MacOSXCGLContext extends GLContextImpl
texID = fbod.getTextureBuffer(GL.GL_FRONT).getName();
pbufferHandle = 0;
fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
+ @Override
public void swapBuffers(boolean doubleBuffered) {
MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
} } ) ;
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index 6f86e840b..994eee8d7 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -229,6 +229,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
}
}
+ @Override
protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
final String connection = adevice.getConnection();
SharedResource sr;
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 535c4d2d3..13e249a58 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -59,6 +59,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
super(screen, capsChosen, capsRequested);
}
+ @Override
public Object clone() {
return super.clone();
}
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index e761be7b7..db2a1df68 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -59,6 +59,7 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
private MacOSXCGLGraphicsConfigurationFactory() {
}
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index c08259665..21923531f 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -63,6 +63,7 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
private MacOSXAWTCGLGraphicsConfigurationFactory() {
}
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 5f9b25530..0d4452864 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -46,12 +46,14 @@ public class GLArrayHandlerInterleaved extends GLVBOArrayHandler implements GLAr
super(ad);
}
+ @Override
public final void setSubArrayVBOName(int vboName) {
for(int i=0; i() {
+ @Override
public DynamicLibraryBundle run() {
return new DynamicLibraryBundle(new FFMPEGDynamicLibraryBundleInfo());
} } );
@@ -272,6 +273,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
// lookup
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
for(int i = 0; i() {
+ @Override
public Object run() {
final ProcAddressTable pt = ctx.getGLProcAddressTable();
final long procAddrGLTexSubImage2D = pt.getAddressFor("glTexSubImage2D");
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index 2d74fa532..3b443fdd0 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -50,14 +50,17 @@ public class GLSLArrayHandler extends GLVBOArrayHandler implements GLArrayHandle
super(ad);
}
+ @Override
public final void setSubArrayVBOName(int vboName) {
throw new UnsupportedOperationException();
}
+ @Override
public final void addSubHandler(GLArrayHandlerFlat handler) {
throw new UnsupportedOperationException();
}
+ @Override
public final void enableState(GL gl, boolean enable, Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
index a5f78b5d6..34a381d7d 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
@@ -47,10 +47,12 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
this.ad = ad;
}
+ @Override
public GLArrayDataWrapper getData() {
return ad;
}
+ @Override
public final void syncData(GL gl, Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
@@ -77,6 +79,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
}*/
}
+ @Override
public final void enableState(GL gl, boolean enable, Object ext) {
final GL2ES2 glsl = gl.getGL2ES2();
if( null != ext ) {
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index bcc146d78..b175bb5dc 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -50,12 +50,14 @@ public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler implements GL
super(ad);
}
+ @Override
public final void setSubArrayVBOName(int vboName) {
for(int i=0; i 0) {
eobrun--;
@@ -1288,6 +1299,7 @@ public class JPEGDecoder {
}
}
class ACSuccessiveDecoder implements DecoderFunction {
+ @Override
public void decode(ComponentIn component, int[] zz) throws IOException {
int k = spectralStart, e = spectralEnd, r = 0;
while (k <= e) {
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
index 906ce6373..e6afd8694 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
@@ -315,6 +315,7 @@ public class ImageLine {
/**
* Basic info
*/
+ @Override
public String toString() {
return "row=" + rown + " cols=" + imgInfo.cols + " bpc=" + imgInfo.bitDepth + " size=" + scanline.length;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
index 438a69984..4636c3955 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
@@ -92,6 +92,7 @@ public class ImageLineHelper {
public double[] maxdif = { BIG_VALUE_NEG, BIG_VALUE_NEG, BIG_VALUE_NEG, BIG_VALUE }; // maxima
public final int channels; // diferencia
+ @Override
public String toString() {
return channels == 3 ? String.format(
"prom=%.1f (%.1f %.1f %.1f) max=%.1f (%.1f %.1f %.1f) min=%.1f (%.1f %.1f %.1f)", promlum, prom[0],
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
index 1f598a5de..9e64c3eb1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
@@ -186,6 +186,7 @@ public class PngHelperInternal {
}
private static final ThreadLocal crcProvider = new ThreadLocal() {
+ @Override
protected CRC32 initialValue() {
return new CRC32();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
index 73442e0bb..0412beb8c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
@@ -994,6 +994,7 @@ public class PngReader {
/**
* Basic info, for debugging.
*/
+ @Override
public String toString() { // basic info
return "filename=" + filename + " " + imgInfo.toString();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index 82abb902d..4e8bf5635 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -47,12 +47,14 @@ public class ChunkHelper {
public static final String zTXt = "zTXt";
private static final ThreadLocal inflaterProvider = new ThreadLocal() {
+ @Override
protected Inflater initialValue() {
return new Inflater();
}
};
private static final ThreadLocal deflaterProvider = new ThreadLocal() {
+ @Override
protected Deflater initialValue() {
return new Deflater();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
index 3aba26cca..dcb1958df 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
@@ -108,6 +108,7 @@ public class ChunkRaw {
return new ByteArrayInputStream(data);
}
+ @Override
public String toString() {
return "chunkid=" + ChunkHelper.toString(idbytes) + " len=" + len;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 3e0d03051..75107d761 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -59,12 +59,14 @@ public class ChunksList {
protected static List getXById(final List list, final String id, final String innerid) {
if (innerid == null)
return ChunkHelper.filterList(list, new ChunkPredicate() {
+ @Override
public boolean match(PngChunk c) {
return c.id.equals(id);
}
});
else
return ChunkHelper.filterList(list, new ChunkPredicate() {
+ @Override
public boolean match(PngChunk c) {
if (!c.id.equals(id))
return false;
@@ -152,12 +154,14 @@ public class ChunksList {
*/
public List getEquivalent(final PngChunk c2) {
return ChunkHelper.filterList(chunks, new ChunkPredicate() {
+ @Override
public boolean match(PngChunk c) {
return ChunkHelper.equivalent(c, c2);
}
});
}
+ @Override
public String toString() {
return "ChunkList: read: " + chunks.size();
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index 3b84ab800..c502e9071 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -149,6 +149,7 @@ public class ChunksListForWrite extends ChunksList {
return queuedChunks;
}
+ @Override
public String toString() {
return "ChunkList: written: " + chunks.size() + " queue: " + queuedChunks.size();
}
@@ -156,6 +157,7 @@ public class ChunksListForWrite extends ChunksList {
/**
* for debugging
*/
+ @Override
public String toStringFull() {
StringBuilder sb = new StringBuilder(toString());
sb.append("\n Written:\n");
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
index 5247169e0..7df5ba021 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
@@ -12,6 +12,7 @@ public abstract class PngChunkSingle extends PngChunk {
super(id, imgInfo);
}
+ @Override
public final boolean allowsMultiple() {
return false;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index fa3649613..139603448 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -41,6 +41,7 @@ public class PngMetadata {
throw new PngjException("cannot set chunk : readonly metadata");
if (lazyOverwrite) {
ChunkHelper.trimList(cl.getQueuedChunks(), new ChunkPredicate() {
+ @Override
public boolean match(PngChunk c2) {
return ChunkHelper.equivalent(c, c2);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 203af110c..95485b033 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -92,6 +92,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
synchronized(WindowsWGLDrawableFactory.class) {
if( null == windowsWGLDynamicLookupHelper ) {
windowsWGLDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public DesktopGLDynamicLookupHelper run() {
DesktopGLDynamicLookupHelper tmp;
try {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index cb445f005..5f2b0c227 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -119,6 +119,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return cfg;
}
+ @Override
public Object clone() {
return super.clone();
}
@@ -715,6 +716,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return createPixelFormatDescriptor(0, 0);
}
+ @Override
public String toString() {
return "WindowsWGLGraphicsConfiguration["+getScreen()+", pfdID " + getPixelFormatID() + ", ARB-Choosen " + isChoosenByARB() +
",\n\trequested " + getRequestedCapabilities() +
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 9e917a0eb..961295208 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -79,6 +79,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
private WindowsWGLGraphicsConfigurationFactory() {
}
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
index ddfcbb55b..96bd0bdd0 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -68,6 +68,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
private WindowsAWTWGLGraphicsConfigurationFactory() {
}
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index 3f0841b6c..78e549508 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -95,6 +95,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
synchronized(X11GLXDrawableFactory.class) {
if( null == x11GLXDynamicLookupHelper ) {
x11GLXDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public DesktopGLDynamicLookupHelper run() {
DesktopGLDynamicLookupHelper tmp;
try {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index 5aea33f21..4d1ed3985 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -69,6 +69,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
this.chooser=chooser;
}
+ @Override
public Object clone() {
return super.clone();
}
@@ -478,6 +479,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return tmp.get(tmp.position());
}
+ @Override
public String toString() {
return "X11GLXGraphicsConfiguration["+getScreen()+", visualID " + toHexString(getXVisualID()) + ", fbConfigID " + toHexString(getFBConfigID()) +
",\n\trequested " + getRequestedCapabilities()+
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index abe310a3f..6050dabbb 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -92,6 +92,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
private X11GLXGraphicsConfigurationFactory() {
}
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
if (!(absScreen instanceof X11GraphicsScreen)) {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index 15f3355d0..aa9b876dd 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -109,6 +109,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
}
// open access to superclass method
+ @Override
public void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
super.setChosenCapabilities(capsChosen);
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
index d3cf5bff6..83d6efa75 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
@@ -87,6 +87,7 @@ public class AWTGraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
return new AWTGraphicsScreen(AWTGraphicsDevice.createDefault());
}
+ @Override
public Object clone() {
return super.clone();
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
index e350aaff4..27275c6e0 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -119,6 +119,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
* otherwise return the AWT/Swing close operation value translated to
* a {@link WindowClosingProtocol} value .
*/
+ @Override
public final WindowClosingMode getDefaultCloseOperation() {
synchronized(closingListenerLock) {
if(defaultCloseOperationSetByUser) {
@@ -129,6 +130,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
return AWTMisc.getNWClosingOperation(comp);
}
+ @Override
public final WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
synchronized(closingListenerLock) {
final WindowClosingMode _op = defaultCloseOperation;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
index e4d3884a7..c02fc0a04 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
@@ -247,6 +247,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #setElem(int, int)
* @see #setElem(int, int, int)
*/
+ @Override
public int getElem(int i) {
return data.get(i+offset);
}
@@ -260,6 +261,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #setElem(int, int)
* @see #setElem(int, int, int)
*/
+ @Override
public int getElem(int bank, int i) {
return bankdata[bank].get(i+offsets[bank]);
}
@@ -273,6 +275,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #getElem(int)
* @see #getElem(int, int)
*/
+ @Override
public void setElem(int i, int val) {
data.put(i+offset, val);
}
@@ -286,6 +289,7 @@ public final class DirectDataBufferInt extends DataBuffer {
* @see #getElem(int)
* @see #getElem(int, int)
*/
+ @Override
public void setElem(int bank, int i, int val) {
bankdata[bank].put(i+offsets[bank], val);
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
index 89df7f853..99ca006fa 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
@@ -43,6 +43,7 @@ public class MacOSXGraphicsDevice extends DefaultGraphicsDevice implements Clone
super(NativeWindowFactory.TYPE_MACOSX, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
}
+ @Override
public Object clone() {
return super.clone();
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
index 6057f6700..361d61c65 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
@@ -122,6 +122,7 @@ public class SWTAccessor {
static {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
NativeWindowFactory.initSingleton(); // last resort ..
return null;
@@ -360,6 +361,7 @@ public class SWTAccessor {
if(null != OS_gtk_class) {
invoke(true, new Runnable() {
+ @Override
public void run() {
if(realize) {
callStaticMethodL2V(OS_gtk_widget_realize, handle);
@@ -434,6 +436,7 @@ public class SWTAccessor {
public static long newGC(final Control swtControl, final GCData gcData) {
final Object[] o = new Object[1];
invoke(true, new Runnable() {
+ @Override
public void run() {
o[0] = ReflectionUtil.callMethod(swtControl, swt_control_internal_new_GC, new Object[] { gcData });
}
@@ -447,6 +450,7 @@ public class SWTAccessor {
public static void disposeGC(final Control swtControl, final long gc, final GCData gcData) {
invoke(true, new Runnable() {
+ @Override
public void run() {
if(swt_uses_long_handles) {
ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { new Long(gc), gcData });
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
index 7468d254b..643982715 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
@@ -47,6 +47,7 @@ public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Clon
super(NativeWindowFactory.TYPE_WINDOWS, connection, unitID);
}
+ @Override
public Object clone() {
return super.clone();
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
index 8aac7095a..700937829 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
@@ -63,6 +63,7 @@ public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneabl
return X11Lib.DefaultVisualID(getDevice().getHandle(), getIndex());
}
+ @Override
public Object clone() {
return super.clone();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
index 6095db052..77cbe2995 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -76,6 +76,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
private final static int NO_SCORE = -9999999;
private final static int COLOR_MISMATCH_PENALTY_SCALE = 36;
+ @Override
public int chooseCapabilities(final CapabilitiesImmutable desired,
final List extends CapabilitiesImmutable> available,
final int windowSystemRecommendedChoice) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index 3e32f30df..42d7f3a23 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -69,18 +69,22 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
}
}
+ @Override
final public AbstractGraphicsScreen getScreen() {
return screen;
}
+ @Override
final public CapabilitiesImmutable getChosenCapabilities() {
return capabilitiesChosen;
}
+ @Override
final public CapabilitiesImmutable getRequestedCapabilities() {
return capabilitiesRequested;
}
+ @Override
public AbstractGraphicsConfiguration getNativeGraphicsConfiguration() {
return this;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index ffcad235c..4bd548916 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -54,10 +54,12 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
}
}
+ @Override
public AbstractGraphicsDevice getDevice() {
return device;
}
+ @Override
public int getIndex() {
return idx;
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
index e1aa91959..c09e6eaa4 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -80,10 +80,12 @@ public abstract class GraphicsConfigurationFactory {
this.hash32 = hash32;
}
+ @Override
public final int hashCode() {
return hash32;
}
+ @Override
public final boolean equals(Object obj) {
if(this == obj) { return true; }
if (obj instanceof DeviceCapsType) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index bad72f355..6962ce505 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -123,6 +123,7 @@ public abstract class NativeWindowFactory {
return AccessController.doPrivileged(new PrivilegedAction() {
private final File vcliblocation = new File(
"/opt/vc/lib/libbcm_host.so");
+ @Override
public Boolean run() {
if ( vcliblocation.isFile() ) {
return Boolean.TRUE;
@@ -160,12 +161,14 @@ public abstract class NativeWindowFactory {
final String[] _tmp = new String[] { null };
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
Platform.initSingleton(); // last resort ..
_DEBUG[0] = Debug.debug("NativeWindow");
_tmp[0] = Debug.getProperty("nativewindow.ws.name", true);
Runtime.getRuntime().addShutdownHook(
new Thread(new Runnable() {
+ @Override
public void run() {
NativeWindowFactory.shutdown(true);
} }, "NativeWindowFactory_ShutdownHook" ) ) ;
@@ -318,6 +321,7 @@ public abstract class NativeWindowFactory {
ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) {
Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Method[] run() {
try {
Class> _jawtUtilClass = Class.forName(JAWTUtilClassName, true, NativeWindowFactory.class.getClassLoader());
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
index eb0a6cf04..0af2bdaf9 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -122,5 +122,6 @@ public interface ProxySurface extends MutableSurface {
public void clearUpstreamOptionBits(int v);
public StringBuilder toString(StringBuilder sink);
+ @Override
public String toString();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
index 4ee71ee79..4ed79b1dc 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
@@ -120,6 +120,7 @@ public interface VisualIDHolder {
this.type = type;
}
+ @Override
public int compare(VisualIDHolder vid1, VisualIDHolder vid2) {
final int id1 = vid1.getVisualID(type);
final int id2 = vid2.getVisualID(type);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index b8b48a46c..b8dc53c83 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -45,10 +45,12 @@ public class Dimension implements Cloneable, DimensionImmutable {
this.height=height;
}
+ @Override
public Object cloneMutable() {
return clone();
}
+ @Override
public Object clone() {
try {
return super.clone();
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
index 9caa433a6..e6cacf4ff 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/DimensionImmutable.java
@@ -59,8 +59,10 @@ public interface DimensionImmutable extends WriteCloneable, Comparabletrue if the two dimensions are equal;
* otherwise false.
*/
+ @Override
boolean equals(Object obj);
+ @Override
int hashCode();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
index dbd997c60..c84359dcd 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
@@ -45,10 +45,12 @@ public class Insets implements Cloneable, InsetsImmutable {
this.b=bottom;
}
+ @Override
public Object cloneMutable() {
return clone();
}
+ @Override
protected Object clone() {
try {
return super.clone();
@@ -99,6 +101,7 @@ public class Insets implements Cloneable, InsetsImmutable {
return sum3 * (sum3 + 1)/2 + val2;
}
+ @Override
public String toString() {
return new String("[ l "+l+", r "+r+" - t "+t+", b "+b+" - "+getTotalWidth()+"x"+getTotalHeight()+"]");
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
index 0f99a7861..8256068cd 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
@@ -59,8 +59,10 @@ public interface InsetsImmutable extends WriteCloneable {
* @return true if the two Insets are equal;
* otherwise false.
*/
+ @Override
boolean equals(Object obj);
+ @Override
int hashCode();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
index aba515d52..57c6fb716 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
@@ -42,10 +42,12 @@ public class Point implements Cloneable, PointImmutable {
this(0, 0);
}
+ @Override
public Object cloneMutable() {
return clone();
}
+ @Override
public Object clone() {
try {
return super.clone();
@@ -95,6 +97,7 @@ public class Point implements Cloneable, PointImmutable {
return hash;
}
+ @Override
public String toString() {
return new String( x + " / " + y );
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
index f5377e059..08c628cc1 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PointImmutable.java
@@ -54,8 +54,10 @@ public interface PointImmutable extends WriteCloneable, Comparabletrue if the two points are equal;
* otherwise false.
*/
+ @Override
public boolean equals(Object obj);
+ @Override
public int hashCode();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
index 3a51fb67d..8dc8f4562 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
@@ -47,10 +47,12 @@ public class Rectangle implements Cloneable, RectangleImmutable {
this.height=height;
}
+ @Override
public Object cloneMutable() {
return clone();
}
+ @Override
protected Object clone() {
try {
return super.clone();
@@ -191,6 +193,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
return sum3 * (sum3 + 1)/2 + val2;
}
+ @Override
public String toString() {
return new String("[ "+x+" / "+y+" "+width+" x "+height+" ]");
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
index ce735f53f..7ca92ff53 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/RectangleImmutable.java
@@ -78,8 +78,10 @@ public interface RectangleImmutable extends WriteCloneable, Comparabletrue if the two rectangles are equal;
* otherwise false.
*/
+ @Override
boolean equals(Object obj);
+ @Override
int hashCode();
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
index 917f7e230..f1749dfa6 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
@@ -56,6 +56,7 @@ public class SurfaceSize implements Comparable {
return bitsPerPixel;
}
+ @Override
public final String toString() {
return new String("[ "+resolution+" x "+bitsPerPixel+" bpp ]");
}
@@ -89,6 +90,7 @@ public class SurfaceSize implements Comparable {
* @return true if the two dimensions are equal;
* otherwise false.
*/
+ @Override
public final boolean equals(Object obj) {
if(this == obj) { return true; }
if (obj instanceof SurfaceSize) {
@@ -99,6 +101,7 @@ public class SurfaceSize implements Comparable {
return false;
}
+ @Override
public final int hashCode() {
// 31 * x == (x << 5) - x
int hash = 31 + getResolution().hashCode();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
index a7bf536ec..b7197dbca 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -54,6 +54,7 @@ public class Debug extends PropertyAccess {
static {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
PropertyAccess.addTrustedPrefix("nativewindow.");
return null;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
index b3b5d2131..8fb819251 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -36,6 +36,7 @@ package jogamp.nativewindow;
import javax.media.nativewindow.*;
public class DefaultGraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
+ @Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID) {
return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
index 5fdbbf697..cadef9bf1 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/GlobalToolkitLock.java
@@ -72,6 +72,7 @@ public class GlobalToolkitLock implements ToolkitLock {
// nop
}
+ @Override
public String toString() {
return "GlobalToolkitLock[obj 0x"+Integer.toHexString(hashCode())+", isOwner "+globalLock.isOwner(Thread.currentThread())+", "+globalLock.toString()+"]";
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
index 36a25acfb..e7eb13756 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
@@ -39,6 +39,7 @@ import com.jogamp.common.util.cache.TempJarCache;
public class NWJNILibLoader extends JNILibLoaderBase {
public static boolean loadNativeWindow(final String ossuffix) {
return AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Boolean run() {
Platform.initSingleton();
final String libName = "nativewindow_"+ossuffix ;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index e3f6ab5ca..22ac3bd94 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -51,6 +51,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
// This subclass of NativeWindowFactory handles the case of
// NativeWindows being passed in
+ @Override
protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
if (winObj instanceof NativeWindow) {
// Use the NativeWindow directly
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
index d8ce98acb..bda20522c 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NullToolkitLock.java
@@ -64,6 +64,7 @@ public class NullToolkitLock implements ToolkitLock {
// nop
}
+ @Override
public String toString() {
return "NullToolkitLock[]";
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index 8a1048c6f..097fffead 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -253,6 +253,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
return surfaceLock.getOwner();
}
+ @Override
public final StringBuilder getUpstreamOptionBits(StringBuilder sink) {
if(null == sink) {
sink = new StringBuilder();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
index 51dd58543..f1efb8133 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ResourceToolkitLock.java
@@ -73,6 +73,7 @@ public class ResourceToolkitLock implements ToolkitLock {
// nop
}
+ @Override
public String toString() {
return "ResourceToolkitLock[obj 0x"+Integer.toHexString(hashCode())+", isOwner "+lock.isOwner(Thread.currentThread())+", "+lock.toString()+"]";
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
index e20d3d138..7b74e1f1f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
@@ -142,6 +142,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
}
}
+ @Override
public String toString() {
return "SharedResourceToolkitLock[refCount "+refCount+", handle 0x"+Long.toHexString(handle)+", obj 0x"+Integer.toHexString(hashCode())+", isOwner "+lock.isOwner(Thread.currentThread())+", "+lock.toString()+"]";
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
index d11e240fa..1e83232bb 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
@@ -74,6 +74,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
}
}
+ @Override
public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
synchronized(surfaceUpdatedListenersLock) {
for(int i = 0; i < surfaceUpdatedListeners.size(); i++ ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index 815facbee..a5da41424 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -50,6 +50,7 @@ import java.security.PrivilegedAction;
public class JAWTJNILibLoader extends NWJNILibLoader {
static {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
// Make sure that awt.dll is loaded before loading jawt.dll. Otherwise
// a Dialog with "awt.dll not found" might pop up.
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
index 32946fe2d..5a1d915ce 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
@@ -320,6 +320,7 @@ public class JAWTUtil {
j2dExist = ok;
PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
try {
@@ -352,9 +353,11 @@ public class JAWTUtil {
jawtLock = LockFactory.createRecursiveLock();
jawtToolkitLock = new ToolkitLock() {
+ @Override
public final void lock() {
JAWTUtil.lockToolkit();
}
+ @Override
public final void unlock() {
JAWTUtil.unlockToolkit();
}
@@ -380,6 +383,7 @@ public class JAWTUtil {
} else {
final ArrayList